Skip to content
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

Override xray trace header insteand of appending #10766

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

wangzlei
Copy link
Contributor

@wangzlei wangzlei commented Mar 6, 2024

Bug description

It is a bug fix that OTel propagator should always call putHeader() method to override the trace header in AWS request instead of appending a trace header on existing http header values. The method appendMethod() worked before because AWS java SDK only keeps the last value in http header value list.
But recently AWS Java SDK fixed the http header values chunked problem, now all the values in http header are retained, it causes AWS service may receive 2 trace header values for a trace header key, then breaks trace context propagation.
Screenshot 2024-03-05 at 4 05 50 PM

Details regarding AWS request may have trace header not from OpenTelemetry

case 1:
it is an AWS design that in AWS Lambda environment, the AWS SDK will automatically inject a trace header to outgoing requests without OTel SDK needed. If customer instruments his Lambda function by OTel, OTel should override the trace header from AWS SDK one.

case 2:
User makes mistake that he instruments the application by 2 different SDKs

Solution

override existing trace header instead of appending value on it.

@wangzlei wangzlei requested a review from a team March 6, 2024 00:12
@laurit laurit added this to the v2.2.0 milestone Mar 6, 2024
@laurit laurit merged commit a942b23 into open-telemetry:main Mar 11, 2024
49 checks passed
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