We automatically add some properties for each environment:
|
public void configureContext(MetricsContext context) { |
|
addProperty(context, "executionEnvironment", getEnv(AWS_EXECUTION_ENV)); |
|
addProperty(context, "functionVersion", getEnv(LAMBDA_FUNCTION_VERSION)); |
|
addProperty(context, "logStreamId", getEnv(LAMBDA_LOG_STREAM)); |
|
getSampledTrace().ifPresent(traceId -> addProperty(context, "traceId", traceId)); |
|
} |
If customers are emitting similar properties from a different LogGroup, it can be cumbersome to correlate them. For example, if the customer is using Lambda Insights (which uses snake case), they would have to query data like:
filter requestId = "X" or request_id = "X"
# OR
fields coalesce(requestId, request_id) as req
| filter req = "X"
Instead, we could offer a configuration parameter that defines the convention this library uses. For example:
AWS_EMF_CASE_CONVENTION=snake
We automatically add some properties for each environment:
aws-embedded-metrics-java/src/main/java/software/amazon/cloudwatchlogs/emf/environment/LambdaEnvironment.java
Lines 60 to 65 in 9875fed
If customers are emitting similar properties from a different LogGroup, it can be cumbersome to correlate them. For example, if the customer is using Lambda Insights (which uses snake case), they would have to query data like:
Instead, we could offer a configuration parameter that defines the convention this library uses. For example: