[BUG] Azure Core does NOT perform Open Telemetry context propagation as documented #44216
Open
3 tasks done
Labels
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-triage
Workflow: This is a new issue that needs to be triaged to the appropriate team.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
azure-messaging-servicebus and azure-core-tracing-opentelemetry do NOT support Open Telemetry Context Propagation although the Open Telemetry documentation claims Azure Core does:
"Context propagation" is not limited to "trace context propagation." It can include "baggage propagation", or whatever else is configured (e.g. via system property
otel.propagators
).Typically, instrumentations use
OpenTelemetry.getPropagators()
, NOTW3CTraceContextPropagator
directly. Many other instrumented java libraries and frameworks support "context propagation" (see code search forGlobalOpenTelemetry.getPropagators()
).Exception or Stack Trace
None.
To Reproduce
SERVICE_BUS_CONNECTION_STRING
andSERVICE_BUS_QUEUE_NAME
accordingly.ServiceBusOtelContextPropagationTest
.Code Snippet
ServiceBusOtelContextPropagationTest.kt
build.gradle.kts
Expected behavior
I expected:
0000000ace0fba53
but receivedf23fb7bec62766d9
)."Bilbo" to "Baggins", "Samwise" to "Gamgee"
but received nothing).Here are some failed test output snippets to help understand quickly:
Screenshots
Not applicable.
Setup
build.gradle.kts
above for more information) com.azure:azure-sdk-bom:1.2.31, com.azure:azure-messaging-servicebus:7.17.8, io.opentelemetry.javaagent:opentelemetry-javaagent:2.12.0, probably com.azure:azure-core-tracing-opentelemetry:1.0.0-beta.45 (based on this line)Additional context
Here's an example of how context propagation using all configured propagators might look (e.g.
-Dotel.propagators=tracecontext,baggage,custom
):🤔💡 Semi-random side note: it seems to me like other libraries KISS and leverage their existing interceptor support and "simply" inject an additional interceptor into their client (see OkHttp example). Wouldn't it be great if azure-messaging-servicebus support interceptors? 🤞. It would also greatly help users to implement cross-cutting functionality as in many other clients.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: