generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 67
feat: [Java] EMF Exporter Implementation #1209
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
Merged
Merged
+2,918
−483
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2cf0524 to
746e989
Compare
wangzlei
reviewed
Sep 27, 2025
...ftware/amazon/opentelemetry/javaagent/providers/AwsApplicationSignalsCustomizerProvider.java
Show resolved
Hide resolved
wangzlei
previously approved these changes
Sep 27, 2025
…eader, and consolidated unit tests
wangzlei
reviewed
Dec 4, 2025
...java/software/amazon/opentelemetry/javaagent/providers/AwsApplicationSignalsConfigUtils.java
Show resolved
Hide resolved
mxiamxia
reviewed
Dec 4, 2025
...re/amazon/opentelemetry/javaagent/providers/exporter/aws/metrics/common/BaseEmfExporter.java
Show resolved
Hide resolved
mxiamxia
reviewed
Dec 4, 2025
...re/amazon/opentelemetry/javaagent/providers/exporter/aws/metrics/common/BaseEmfExporter.java
Outdated
Show resolved
Hide resolved
mxiamxia
approved these changes
Dec 5, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 the complete CloudWatch EMF (Embedded Metric Format) exporter implementation for sending OpenTelemetry metrics directly to CloudWatch without requiring a Collector or Agent.
In order to enable this exporter, users MUST set the following environment variables:
OTEL_METRICS_EXPORTER=awsemf-OTEL_EXPORTER_OTLP_LOGS_HEADERS=x-aws-log-group=<log-group-name>,x-aws-log-stream=<log-stream-name>, x-aws-metric-namespace=<namespace>AWS_REGION=<region>ORAWS_DEFAULT_REGION=<region>This PR includes:
TODO:
Testing:
Added unit tests to validate EMF exporter configuration scenarios, including parameterized tests for both valid configurations (supporting AWS_REGION and AWS_DEFAULT_REGION) and invalid configurations (missing headers, wrong exporter type, missing region). The tests ensure the EMF exporter is correctly enabled only when all required environment variables are properly configured.
Manual end to end testing with the following environment variables to ensure the EMF logs show up:
AWS_REGION=us-east-1OTEL_METRICS_EXPORTER=awsemfOTEL_EXPORTER_OTLP_LOGS_HEADERS=x-aws-log-group=test,x-aws-log-stream=default,x-aws-metric-namespace=testNamespaceOTEL_RESOURCE_ATTRIBUTES=service.name=testService,aws.log.group.names=test,cloud.resource_id=agent-12345OTEL_LOGS_EXPORTER=noneOTEL_TRACES_EXPORTER=noneExample EMF log emitted:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.