opentelemetry-ruby icon indicating copy to clipboard operation
opentelemetry-ruby copied to clipboard

How can I have per instrumentation propagators?

Open hmadison opened this issue 5 years ago • 3 comments

Hi,

While looking at the Kafka implementation I noticed that OpenTelemetry.propagation.inject is a share singleton across all of the running instrumentations. I'm wondering if its possible to have per instrumentation propagators in situations where there are different trace context protocols.

To the best of my understanding, opentelemtry-ruby would need to have some kind of mechanism for this to be able to support AMQP and MQTT trace contexts following the W3 standard. It also appears, with regards to Kafka, that the current implementation of trace context instrumentation is undefined since there is no registry entry for the protocol?

Thanks, Hunter

hmadison avatar Feb 11 '21 12:02 hmadison

Thanks for the reference. From that, I see that protocol-specific (MQTT, AMQP, HTTP, etc.) encodings are defined. This should be handled with protocol-specific Getters and Setters rather than per instrumentation propagators, although you could choose instead to add a configuration option to instrumentation to override the propagator.

with regards to Kafka, that the current implementation of trace context instrumentation is undefined since there is no registry entry for the protocol

That's an interesting point. My knowledge of Kafka is not that deep, but if this is a problem, it presumably affects all OTel language implementations that instrument Kafka. It should be brought up at the spec level. If you have sufficient context, can you please open an issue in the https://github.com/open-telemetry/opentelemetry-specification repo?

fbogsany avatar Feb 11 '21 16:02 fbogsany

Thanks for the guidance! I'll work on getting something written up for the specification repo.

Hunter

hmadison avatar Feb 12 '21 17:02 hmadison

👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this issue will be closed eventually by the stale bot.

github-actions[bot] avatar Apr 26 '24 01:04 github-actions[bot]