Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuration of property casing convention for automatic properties #51

Open
jaredcnance opened this issue Oct 13, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@jaredcnance
Copy link
Member

jaredcnance commented Oct 13, 2020

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
@jaredcnance jaredcnance changed the title Allow configuration of property casing convention for automatically added properties Allow configuration of property casing convention for automatic properties Oct 13, 2020
@jaredcnance jaredcnance added the enhancement New feature or request label Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant