dd-trace-java
dd-trace-java copied to clipboard
Feature Request: OpenTelemetry: Support Baggage in OtelContext
Currently when OtelContext.with or OtelContext.get is called with context key opentelemetry-baggage-key (defined in io.opentelemetry.api.baggage.BaggageContextKey#KEY)
null is returned.
Setup:
Java agent running with DD_TRACE_OTEL_ENABLED=true
This key seems to be used by otel to set or get an instance of io.opentelemetry.api.baggage.Baggage.
In order to be able to use baggage with open-telemetry this context key needs to be handled.
Hello @Xyaren 👋
Thanks for reaching us.
We currently don't support baggage with our OTel instrumentation.
It is mainly due to the lack of support for the Context lifecycle.
So even if you were able to store baggage, you won't retrieve any meaningful value when needed.
It is identified as a compatibility issue on our OTel support roadmap though. We really appreciate if you can open a feature request on our support page so we can make sure to keep track of it, and our support team will be able to learn more about you and your context. Don't hesitate to link this issue as reference.
Best, Bruce
Hello, is there a link to the OTEL Support Roadmap you mentioned?
Best Regeards, Tobias
Any news ? I saw a few changes around baggage handling
Is this on any roadmap? It is such an essential feature when it comes to propagating information in a large scale microservice network...
@PerfectSlayer Since you support Baggage now with https://github.com/DataDog/dd-trace-java/pull/9289 could you have another look please ?
Current status - the following use cases are supported in 1.47.0 and later:
- manually using the OTel API to set/get baggage in the same JVM
- automatic propagation of baggage from upstream services to downstream services
The remaining gap is being able to manually use the OTel API to affect the automatic baggage propagation. This requires some additional work in how we map and manage baggage context keys, like we do for the span context keys.
I'll update this issue once the remaining gap is closed.
The remaining gap should be addressed by the following PRs:
- https://github.com/DataDog/dd-trace-java/pull/9982
- https://github.com/DataDog/dd-trace-java/pull/9987
These PRs will ship in the v1.56.0 release
:robot: This issue has been addressed in the latest release. Check full details in the Release Notes.