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 the newrelic layer on a nodejs lambda function.
The lambda runtime is Node.js 20.x and the layer arn is arn:aws:lambda:eu-west-1:451483290750:layer:NewRelicNodeJS20XARM64:51
(I have also tried using Node.js 22.x and latest layer version and still got the same issue)
When inspecting logs using the newrelic UI and when I tried correlating them using aws.lambda_request_id, I have noticed I get strange
data and something was not adding up.
The aws.lambda_request_id which is automatically injected via the layer, had the wrong aws request id in some cases.
In some cases, it seems it always has the previous request id.
This behaviour can be seen more clear in following screenshot. I have explicitly injected the awsRequestId using pino-lambda to try and compare and to troubleshoot the issue(the request id is ready from context each time the handler is called), and logger
As
Steps to Reproduce
This does not appear to happen at small scale, but only whenever we have concurrent invocations.
Here is a screenshot to illustrate behaviour.
I have managed to work around this by explicitly injecting aws.lambda_request_id as part of the logger context which I get from the lambda context. It seems the newrelic lambda layer does not ovewrite aws.lambda_request_id if explicitly provided.
This works for me now, but it would be great if this can be fixed from the newrelic layer.
Expected Behaviour
aws.lambda_request_id to always have the correct aws request id from context.
Relevant Logs / Console output
Your Environment
ex: Browser name and version:
ex: Operating System and version:
Additional context
The text was updated successfully, but these errors were encountered:
Description
I am using the newrelic layer on a nodejs lambda function.
The lambda runtime is
Node.js 20.x
and the layer arn isarn:aws:lambda:eu-west-1:451483290750:layer:NewRelicNodeJS20XARM64:51
(I have also tried using Node.js 22.x and latest layer version and still got the same issue)
When inspecting logs using the newrelic UI and when I tried correlating them using
aws.lambda_request_id
, I have noticed I get strangedata and something was not adding up.
The
aws.lambda_request_id
which is automatically injected via the layer, had the wrong aws request id in some cases.In some cases, it seems it always has the previous request id.
This behaviour can be seen more clear in following screenshot. I have explicitly injected the
awsRequestId
using pino-lambda to try and compare and to troubleshoot the issue(the request id is ready from context each time the handler is called), and loggerAs
Steps to Reproduce
This does not appear to happen at small scale, but only whenever we have concurrent invocations.
Here is a screenshot to illustrate behaviour.
I have managed to work around this by explicitly injecting
aws.lambda_request_id
as part of the logger context which I get from the lambda context. It seems the newrelic lambda layer does not ovewriteaws.lambda_request_id
if explicitly provided.This works for me now, but it would be great if this can be fixed from the newrelic layer.
Expected Behaviour
aws.lambda_request_id
to always have the correct aws request id from context.Relevant Logs / Console output
Your Environment
Additional context
The text was updated successfully, but these errors were encountered: