Adding a Custom Context Propagator #1355
-
Hi, I'd like to write a custom propagator to handle the conversion of an in-house proprietary tracing format to OpenTelemetry format, as we start to migrate Ruby-based services. While I see that Is there a way to extend the SDK configuration class to accept a custom gem name to use as an additional context propagator? I see that Thoughts here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
We don't have a way to automatically "register" a new third party propagator and then make it available by way of environment variable, unfortunately. I think if you came up with a clean way to implement that, we may be open to a PR that implemented the functionality - although I think the SIG might want to discuss a little about that first (here, or in the meeting, etc). Right now the way you would do this is by setting up the SDK programatically. That would look something like: my_propagator = My::Custom::Thing.new
OpenTelemetry::SDK.configure do |c|
# set up your SDK however you like
# c.use_all(instrumentation_config)
# c.resource = resource
# c.service_name = service_name
# etc, etc
# This is the important bit!
c.propagators = [my_propagator]
end If you choose to implement a registration function, you might have a look at the new
That package might be overkill for what we need; perhaps we could do something simpler, somehow. |
Beta Was this translation helpful? Give feedback.
We don't have a way to automatically "register" a new third party propagator and then make it available by way of environment variable, unfortunately. I think if you came up with a clean way to implement that, we may be open to a PR that implemented the functionality - although I think the SIG might want to discuss a little about that first (here, or in the meeting, etc).
Right now the way you would do this is by setting up the SDK programatically. That would look something like: