Prefer Lambda X-Ray trace header from carrier - #3083
Conversation
|
Hi @srprash @wangzlei, I opened this replacement PR from a clean branch name. It carries the same Lambda X-Ray propagator update as the earlier green PR and pairs with open-telemetry/opentelemetry-java-instrumentation#19920. |
There was a problem hiding this comment.
Pull request overview
Updates the AWS X-Ray Lambda propagator to first look for the Lambda trace header in the extraction carrier under com.amazonaws.xray.traceHeader (including a lowercase variant) before falling back to the system property and _X_AMZN_TRACE_ID. This keeps the active-tracing Lambda-specific behavior isolated to AwsXrayLambdaPropagator while leaving the regular AwsXrayPropagator unchanged.
Changes:
- Prefer carrier-provided
com.amazonaws.xray.traceHeaderduring extraction, falling back to system property and environment variable. - Support lowercase carrier key lookup (
com.amazonaws.xray.traceheader) to match common header normalization behavior. - Add unit tests covering precedence, lowercase lookup, and link behavior when both the standard X-Ray header and Lambda trace header are present.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| aws-xray-propagator/src/main/java/io/opentelemetry/contrib/awsxray/propagator/AwsXrayLambdaPropagator.java | Adds carrier-first lookup (plus lowercase fallback) before reading system property / env var. |
| aws-xray-propagator/src/test/java/io/opentelemetry/contrib/awsxray/propagator/AwsXrayLambdaPropagatorTest.java | Adds tests verifying new precedence behavior, lowercase carrier key support, and link/parent interactions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Fixes open-telemetry/opentelemetry-java-instrumentation#15517
This updates the AWS X-Ray Lambda propagator to prefer the Lambda trace header from the extraction carrier under
com.amazonaws.xray.traceHeaderbefore falling back to the system property and_X_AMZN_TRACE_ID.It preserves the existing regular X-Ray propagator behavior and keeps the Lambda-only active tracing path scoped to the Lambda propagator.
Validation: previous CI on the same code path was green; this replacement PR uses the same branch contents after the branch rename.