You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this library in my Lambda to log custom metrics. When using it, I observe for the EMF log line it will add those Lambda autogenerated fields like @ingestionTime, @logstream, @message, @timestamp and etc but @requsetId is missing from it. Other normal log lines generated from code will always have @requestid.
The problem caused is when we use log Insight to search for all logs of a specific Lambda invocation by filter @requestId = "something", with @requestid missed on this line, it won't show up in search result.
If I use putProperty to set requestID ( and I use "@requestid" as key to mimic other Lambda system properties), in the logInsight search, it will actually show as "@@requestid", double "@" so that's still not going to work.
If I use just "requestId" without "@", it will be a normal key.
The 2nd method is a workaround as I can definitely do filter @requestid = "blabla" or requestId = "blabla" to get all logs but this is not a decent solution.
I have actually already talked to the PE @jaredcnance on this and he said the problem is because EMF library cannot get the requestId from env variable because it's coming from the request Object. He suggested there is some backend processing of the Lambda logs in Cloudwatch that you guys can try extract the RequestId and expose as a system field @requestid so later EMF can publish it? This is some deep log processing between Lambda and CW which I aren't too familiar with, what do you think?
Hi,
I am using this library in my Lambda to log custom metrics. When using it, I observe for the EMF log line it will add those Lambda autogenerated fields like @ingestionTime, @logstream, @message, @timestamp and etc but
@requsetId
is missing from it. Other normal log lines generated from code will always have @requestid.The problem caused is when we use log Insight to search for all logs of a specific Lambda invocation by
filter @requestId = "something"
, with @requestid missed on this line, it won't show up in search result.See the picture for details.
@requestid is missed
when searching logs with @requestid, EMF log line is not included due to missing @requestid
Do we think this is something we can fix?
The text was updated successfully, but these errors were encountered: