Open frittentheke opened 4 years ago
With OpenTelemetry going beta we could make use of this new standard. It supports W3C headers out of the box. We would only have to add the OpenTelementry API as a dependency and set two user properties, given that MQTT 5 is used. No API change is required. It will also work if the application does not use OpenTelemetry.
I had a quick browse through the code and the change seems to be more complicated than anticipated due to the different API flavors and the enormous level of indirectness (builders, many layers of inheritance, ...), which I guess is in the nature of Java.
Any pointers w.r.t. the right place to inject / extract the context is appreciated. I might be able to piece up a pull request.
@SgtSilvio @dobermai The W3C has now moved this to a draft status (https://w3c.github.io/trace-context-mqtt/) with Sergey Kanzhelev (Google) and Clemens Vasters (Microsoft) as editors.
Any update here?
Problem or use case
While distributed systems are already a pain to debug, adding asynchronicity as with MQTT makes things even harder. More and more tools add OpenTracing (or later OpenTelemetry) capabilities to their code. While this comes quite natural to HTTP with its headers, it is not limited to be used via HTTP.
The W3C trying to standardize the way the context is propagated via MQTT in https://github.com/w3c/trace-context-mqtt
Would you kindly consider adding
Initially: Context Propagation (receive, forward and emit a new trace context - to NOT be a blackhole to tracing)
Later: Native support to add a spans / metadata to traces.
Preferred solution or suggestions
W3C is already working on a standard: https://github.com/w3c/trace-context-mqtt