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
Hello, I'm having issues with my metrics after turning on JSON format logs for my Lambda. The documentation says:
To ensure that your functions' EMF logs continue to be properly parsed by CloudWatch, update your EMF and Powertools for AWS Lambda libraries to the latest versions.
I have updated to the latest version of aws-embedded-metrics-node (4.2.0).
My basic code:
metricsClient.putMetric(MetricName, Value, Unit ?? undefined);
await metricsClient.flush();
However, my logs are missing a few fields mentioned in https://docs.aws.amazon.com/lambda/latest/dg/nodejs-logging.html, "Using structured JSON logs with Node.js" section of the doc says the following fields should be in the JSON, but they are missing from the JSON that aws embedded metrics node productes in the logs
"timestamp" - the time the log message was generated
"level" - the log level assigned to the message
"message" - the contents of the log message
"requestId" - the unique request ID for the function invocation
It would be nice if all 4 fields were in the logs for standardization.
But the big issue is @requestId is sent to the metric's log in plain text mode. But in JSON format mode, neither @requestId or requestId is logged. RequestID is useful for correlating a specific data point to a Lambda invocation. Also, example shows requestId: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-logging.html under "Using embedded metric format (EMF) client libraries with structured JSON logs".
The text was updated successfully, but these errors were encountered:
Do you have more some code snippets of what your setup looks like? Or how you've set up the logger? What was it before and after? What is the current output?
It's rather hard to help you debug with so much information lacking.
Hello, I'm having issues with my metrics after turning on JSON format logs for my Lambda. The documentation says:
https://docs.aws.amazon.com/lambda/latest/dg/nodejs-logging.html#nodejs-logging-advanced-emf
I have updated to the latest version of aws-embedded-metrics-node (4.2.0).
My basic code:
However, my logs are missing a few fields mentioned in https://docs.aws.amazon.com/lambda/latest/dg/nodejs-logging.html, "Using structured JSON logs with Node.js" section of the doc says the following fields should be in the JSON, but they are missing from the JSON that aws embedded metrics node productes in the logs
It would be nice if all 4 fields were in the logs for standardization.
But the big issue is
@requestId
is sent to the metric's log in plain text mode. But in JSON format mode, neither@requestId
orrequestId
is logged. RequestID is useful for correlating a specific data point to a Lambda invocation. Also, example shows requestId: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-logging.html under "Using embedded metric format (EMF) client libraries with structured JSON logs".The text was updated successfully, but these errors were encountered: