Skip to content

fix: respect OTEL_EXPORTER_OTLP_ENDPOINT for Application Signals traces endpoint - #1506

Open
srprash wants to merge 2 commits into
mainfrom
fix/otlp-generic-endpoint-precedence
Open

srprash wants to merge 2 commits into
mainfrom
fix/otlp-generic-endpoint-precedence

Conversation

@srprash

@srprash srprash commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

Bug

With Application Signals enabled outside Lambda, customizeProperties sets otel.exporter.otlp.traces.endpoint=http://localhost:4316/v1/traces whenever the traces-specific endpoint is unset. That default also wins over a user-set generic endpoint. Example:

OTEL_AWS_APPLICATION_SIGNALS_ENABLED=true
OTEL_EXPORTER_OTLP_ENDPOINT=http://my-collector:4318

Expected: traces go to http://my-collector:4318/v1/traces. Actual: traces go to http://localhost:4316/v1/traces, because the injected signal-specific property takes precedence over the generic one.

Per the OTLP exporter configuration spec, the precedence is OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, then OTEL_EXPORTER_OTLP_ENDPOINT, then the default. The ADOT localhost default should only apply when neither is set.

Fix

Only inject the localhost traces endpoint when otel.exporter.otlp.traces.endpoint is unset and otel.exporter.otlp.endpoint is unset or empty. An empty generic endpoint is treated as unset, matching the Lambda path in the same file (hasCustomOtlpTracesEndpoint, #1486 and #1500). An explicitly set signal-specific endpoint is still left untouched.

Tests

New unit tests in AwsApplicationSignalsCustomizerProviderTest:

  • neither endpoint set: traces endpoint defaults to http://localhost:4316/v1/traces
  • generic endpoint set: traces endpoint is not overridden
  • signal-specific endpoint set: left untouched
  • empty generic endpoint: treated as unset, localhost default applies

./gradlew :awsagentprovider:check passes locally (1122 tests, 0 failures). The generic-endpoint test fails without the fix.

Related changes in sibling ADOT repos

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

@srprash
srprash requested a review from a team as a code owner December 4, 2026 20:01

This branch has not been deployed

No deployments
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.

1 participant