Configure EMF
and CompactLog
Exporters for Lambda Environment
#1222
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes:
Java version of these PRs:
This PR introduces Console EMF exporter and Compact Console logs exporter and enabling them for Lambda environments, allowing all forms of telemetry to be emitted directly to CloudWatch for users who've installed the Application Signals lambda layer.
To enable the Compact Console logs exporter, users must set the following environment variables in their Lambda:
OTEL_LOGS_EXPORTER
:console
requiredTo enable the Console EMF exporter, users must set the following environment variables in their Lambda:
OTEL_METRICS_EXPORTER
:awsemf
requiredOTEL_EXPORTER_OTLP_LOGS_HEADERS
:x-aws-log-group=your-log-group,x-aws-log-stream=your-log-stream,x-aws-metric-namespace
optionalEnabling the console exporters for EMF and logs will store the user's OTel metrics and logs directly in their Lambda log group.
Note 1: if users would like to store their EMF logs to a separate log group, they MUST* set this configuration
OTEL_EXPORTER_OTLP_LOGS_HEADERS
:x-aws-log-group=your-log-group,x-aws-log-stream=your-log-stream
Note 2:
x-aws-metric-namespace
will usedefault
if it is not setTesting:
Manual end to end testing with a custom built Lambda layer using the sample app configured with the following environment variables in Lambda environment:

EMF translated OTel metrics and OTel logs:


OTel log:
EMF log
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.