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

Extensibility for Propagators and Samplers

Open pbrisbin opened this issue 1 year ago • 1 comments

:wave: Hi there!

We're just getting started with OpenTelemetry and are looking to emit OTel traces from our app and then us the AWS collector to export to X-Ray. This means we need an AWS X-Ray Propagator, IdGenerator, and Sampler. I've written some of this code and it's working (I think), but it's been awkward (IMO) to get the SDK to use it.

I had to basically re-implement initializeGlobalTracerProvider just so that I could inject a record update to add my propagator after all the environment-variable-based configuration has happened. But then I look at the docs for said environment variables, and it seems like I should be able to "register" these things somehow, and then just say (e.g.) OTEL_PROPAGATORS=tracecontext,baggage,awsxray at runtime to turn them on. That would be really useful as we start migrating from X-Ray to Datadog -- to be able to choose via ENV at runtime like that.

So I guess my question is, am I missing a way in this library to do that?

pbrisbin avatar Mar 06 '23 14:03 pbrisbin