Skip to content

Conversation

liustve
Copy link
Contributor

@liustve liustve commented Sep 26, 2025

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 required

To enable the Console EMF exporter, users must set the following environment variables in their Lambda:

  • OTEL_METRICS_EXPORTER: awsemf required
  • OTEL_EXPORTER_OTLP_LOGS_HEADERS: x-aws-log-group=your-log-group,x-aws-log-stream=your-log-stream,x-aws-metric-namespace optional

Enabling 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 use default if it is not set

Testing:

  • Added unit tests to validate EMF and console log record exporter configuration scenarios, including parameterized tests for both valid configurations and invalid configurations. The tests ensure the EMF and console log exporters are correctly enabled only when all required environment variables are properly configured.

Manual end to end testing with a custom built Lambda layer using the sample app configured with the following environment variables in Lambda environment:
image

EMF translated OTel metrics and OTel logs:
OTel log:
image
EMF log
image

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

@liustve liustve requested a review from a team as a code owner September 26, 2025 23:59
@liustve liustve changed the title [WIP] Configure EMF and CompactLog Exporters for Lambda Environment Configure EMF and CompactLog Exporters for Lambda Environment Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants