-
Notifications
You must be signed in to change notification settings - Fork 825
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
propagator-aws-xray broken with GRPC? #4830
propagator-aws-xray broken with GRPC? #4830
Comments
Seeing the same for GCPs |
rolling back |
any update on this? Not sure if it's 100% the same issue, but I'm also not seeing gcp's |
The issue I was having was causes by some weirdness in package-lock.json. Recreating the lock file resolved the issue |
What happened?
Steps to Reproduce
Send a gRPC message using AWSXRay propagation from a client to a server. You will see that the 'x-amzn-trace-id' header is not getting parsed correctly by the AXS X-ray propagator during extraction. This results in spans created on the server not getting linked/made children of the originating calling span in the gRPC handlers.
Expected Result
The gRPC handlers on the server side should be linked/parented by the caller.
Actual Result
No linkage is occurring.
Additional Details
I think this bug is caused by the following code in the AWS X-Ray Propagator:
https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/propagator-aws-xray/src/AWSXRayPropagator.ts#L102
The code fetches the 'x-amzn-trace-id' from the carrier (the HTTP headers). The gRPC instrumentation provides these as key values where the value is always wrapped in an array (with the first element containing the key). The code in the AWS propagator doesn't account for that and rejects the header if it isn't of type string.
I looked at the other two propagators (B3 and Jaeger) and they seem to properly handle this situation by checking if the value returned from getter.get is an array and pulling element zero from it:
https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-propagator-b3/src/B3Propagator.ts#L67
https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-propagator-jaeger/src/JaegerPropagator.ts#L94
Someone needs to update the AWS Xray propagator to do the same check.
OpenTelemetry Setup Code
package.json
Relevant log output
No response
The text was updated successfully, but these errors were encountered: