-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Broken trace context propagation: OTel Trace ID
of DD agent spans converted by OTel Col Datadog Receiver are wrong
#36926
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
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@boostchicken @gouthamve @MovieStoreGuy please review as codeowners |
I've looked into this today as I've tried a similar setup, but with Go tracing libraries. Taking Cyrille's example above, I've found that the TraceIDs on spans coming from the Datadog instrumentation have the lower 64 bits of the full 128 bits TraceID, and that the upper 64 bits were stores in a different tag/attribute (
In my tests, I've also found that
Internally though, the tracing library (at least the go one), keeps the 128 bits traceID and is able to propagate it down to a downstream service. Here's a context dump from the datadog instrumented service in which we can see TraceID (lower 64 bits) and TraceID128 (full 128 bits TraceID):
In datadog-receiver, we just use the lower 64 bits: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/datadogreceiver/internal/translator/traces_translator.go#L104 (the upper part is set to 0). I'll push a PR with a tentative fix. |
With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID _dd.p.tid: upper 64 bits of * the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. Fixes open-telemetry#36926
With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID _dd.p.tid: upper 64 bits of * the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. Fixes open-telemetry#36926
With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID _dd.p.tid: upper 64 bits of * the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. Fixes open-telemetry#36926
With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID _dd.p.tid: upper 64 bits of * the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. Fixes open-telemetry#36926
With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID * _dd.p.tid: upper 64 bits of the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. Fixes open-telemetry#36926
With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID * _dd.p.tid: upper 64 bits of the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. Fixes open-telemetry#36926
With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID * _dd.p.tid: upper 64 bits of the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. Fixes open-telemetry#36926
With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID * _dd.p.tid: upper 64 bits of the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. Fixes open-telemetry#36926
With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID * _dd.p.tid: upper 64 bits of the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. Fixes open-telemetry#36926
With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID * _dd.p.tid: upper 64 bits of the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. Fixes open-telemetry#36926
With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID * _dd.p.tid: upper 64 bits of the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. Fixes open-telemetry#36926
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID * _dd.p.tid: upper 64 bits of the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes #36926 <!--Describe what testing was performed and which tests were added.--> #### Testing Tested the setup with the following chain: OTel Instrumented Service --> Datadog Instrumented Service -> OTel Instrumented Service. The TraceID was maintained on the whole chain. Also added a unit test (`TestToTraces64to128bits`). #### Documentation Updated README.md in [58129d5](58129d5)
…-telemetry#39654) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description With this commit, we add support for 128 bits TraceIDs coming from Datadog instrumented services. This can happen when an OTel instrumented service calls a downstream Datadog instrumented one. Datadog instrumentation libraries store the 128 bits TraceID into two different fields: * TraceID: lower 64 bits of the 128 bits TraceID * _dd.p.tid: upper 64 bits of the 128 bits TraceID This commit adds logic that reconstructs the 128 bits TraceID. Before this commit, only the lower 64 bits were used as TraceID. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#36926 <!--Describe what testing was performed and which tests were added.--> #### Testing Tested the setup with the following chain: OTel Instrumented Service --> Datadog Instrumented Service -> OTel Instrumented Service. The TraceID was maintained on the whole chain. Also added a unit test (`TestToTraces64to128bits`). #### Documentation Updated README.md in [58129d5](open-telemetry@58129d5)
Uh oh!
There was an error while loading. Please reload this page.
Component(s)
receiver/datadog
What happened?
Description
When doing W3C Trace Context Propagation from an app instrumented with OTel to an app instrumented with the Datadog agent and the Datadog agent sending spans to the OTel Collector Datadog Receiver, the Trace Id reported by the OTel Collector Datadog
Receiver is different from the Trace ID of the parent spans, breaking the trace.
I can't confirm but I suspect that this is caused by the logic in the OTel Col Datadog
Receiver to produce the OTel Trace ID from the Datadog ids.
Architecture:
OTel Collector debug log.
traceId=37940834c74a2dfc11835c979eca1433
spanId=bb4331d223d59950
parentId=bb4331d223d59950
as expectedtraceId=000000000000000011835c979eca1433
which is NOT expected, we expect37940834c74a2dfc11835c979eca1433
Steps to Reproduce
traceparent
http header to verify the context is propagatedExpected Result
traceID
and theparentId
of the HTTP handler of the "downstream_app" matches thespanId
of th HTTP call of the "upstream_App".Actual Result
The
parentId
is properly propagated by theTraceId
is wrong.Collector version
v0.116.0
Environment information
Environment
MacOS 15.2
Demo app:
OpenTelemetry Collector configuration
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: