Fork me on GitHub
#portkey
<
2018-06-09
>
viesti05:06:37

Invoke API has LogType parameter, which set to Tail (when InvokeType is RequestResponse) returns last 4kB of logs https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax

viesti05:06:56

That might do it

viesti05:06:35

aws cli has this wrapped, but we can use our lib :)

viesti07:06:23

but I guess people might already know how to get logs from Cloudwatch, in this particular case it might be that we swallow the actual cause

viesti07:06:05

or say the java crypto classes, a field isn’t serialized (I think) and stack just says “npe”: https://circleci.com/gh/portkey-cloud/portkey/62

baptiste-from-paris08:06:55

love to see portkey growing 😄

viesti08:06:57

so whipped a test for instaparse, similar serialization issue I think

viesti08:06:38

maybe I’m pessimist but at least it breaths and is kind of warm 🙂

baptiste-from-paris08:06:12

so far it’s still growing

viesti08:06:24

last summer had many more of these exceptions, should not forget my veteran status 🙂

baptiste-from-paris08:06:32

so, you will find an example of the generated fns ser and resp in here

baptiste-from-paris08:06:15

it compiles but there is an error in resp generation (quick fix, I just don’t destructure the input)

baptiste-from-paris08:06:11

and we still have ser-create-function-request somehow 😞

baptiste-from-paris08:06:16

next step => 1) fix destructuring for resp 2) integrate with the existing -rest-json-call

baptiste-from-paris08:06:20

and make it work 😄

cgrand08:06:52

@baptiste-from-paris had a quick glance: dudn’t you switch resp and req?

baptiste-from-paris08:06:13

no no, reload the file

baptiste-from-paris08:06:11

ser does serialization & resp gather inputs by request type and required inputs

baptiste-from-paris08:06:26

(clojure.core/defn resp-list-event-source-mappings-request [resp-input48914] (clojure.core/cond-> {} (clojure.core/contains? resp-input48914 "EventSourceArn") (clojure.core/assoc-in [:query-string "EventSourceArn"] (ser-arn resp-input48914)) (clojure.core/contains? resp-input48914 "FunctionName") (clojure.core/assoc-in [:query-string "FunctionName"] (ser-function-name resp-input48914)) (clojure.core/contains? resp-input48914 "Marker") (clojure.core/assoc-in [:query-string "Marker"] (ser-string resp-input48914)) (clojure.core/contains? resp-input48914 "MaxItems") (clojure.core/assoc-in [:query-string "MaxItems"] (ser-max-list-items resp-input48914))))

cgrand08:06:32

Resp is for response not for request > resp gather inputs by request type

baptiste-from-paris08:06:03

it’s just a little typo

cgrand08:06:31

That’s what I said :-)

baptiste-from-paris08:06:44

req/resp, who cares ? 😄

baptiste-from-paris08:06:15

I really need to leave paris for few days 👌

cgrand08:06:44

Only us who deal with code gen. Let’s all agree to mentally switch request and response.

baptiste-from-paris08:06:18

lol, I’ll fix it immediatly, was it req<- ?

baptiste-from-paris13:06:41

so I just fixed destructuring for req<-*, it should be close to something working

baptiste-from-paris13:06:49

so this function request =>

baptiste-from-paris13:06:53

(req<-create-alias-request {:function-name "The Name" :name "kikoulol" :function-version 3})

baptiste-from-paris13:06:10

{:uri {"FunctionName" "The Name"}, :body {"Name" "kikoulol", "FunctionVersion" 3}}

baptiste-from-paris13:06:19

all this work for this 😂