Skip to content

Allow configuration of property casing convention for automatic properties #51

@jaredcnance

Description

@jaredcnance

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions