awslabs / awslabs/aws-embedded-metrics-java

@requestId is not logged for metrics log line when using in Lambda

Open
#101 2 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
48
Forks
39
PR merge metrics
No merged PRs in 30d

Description

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**
![1](https://user-images.githubusercontent.com/26944442/168230918-08cd0453-9eea-4226-8fc7-62fd7a6ebc73.jpeg)

**when searching logs with @requestId, EMF log line is not included due to missing @requestId**
![2](https://user-images.githubusercontent.com/26944442/168230904-9395bf01-e7fb-4cb3-b22e-2116a07a496f.jpg)

Do we think this is something we can fix?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.