Open oceddi opened 4 months ago
Seeing the same for GCPs x-cloud-trace-context
after upgrading to the latest versions
rolling back @opentelemetry/sdk-trace-node
to v1.24.1
seems to resolve the issue (although that causes a dependency discrepancy with @opentelemetry/api,
which should be rolled back to 1.8.0
as well).
any update on this? Not sure if it's 100% the same issue, but I'm also not seeing gcp's X-Cloud-Trace-Context
being propagated, making it impossible to upgrade the packages to their latest versions
any update on this? Not sure if it's 100% the same issue, but I'm also not seeing gcp's
X-Cloud-Trace-Context
being propagated, making it impossible to upgrade the packages to their latest versions
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