-
I am trying to propagate custom headers in a application using the PassThroughPropagator (following the changes made here - typelevel/otel4s#277). I had it all working by instanciating the otel instance within code, i.e. AutoConfiguredOpenTelemetrySdk
.builder()
.addPropagatorCustomizer { (autoConfigured, _) =>
TextMapPropagator.composite(autoConfigured,
PassThroughPropagator.create(propagationConfig.ciHeaders.map(_.toString).asJava))
}
... But then when trying to enable java agent to get jvm metrics etc I obviously ran into issue of agent starting the global instance and then the code also starting it, even with setting global to false still run into issue of multiple prometheus servers starting (yes, want prometheus exporter). So after a lot of digging came across Is there any plan on providing a My simple code is as follows: class PassThroughConfigurablePropagator implements ConfigurablePropagatorProvider {
@Override
public TextMapPropagator getPropagator(ConfigProperties config) {
return PassThroughPropagator.create(config.getList("otel.passthrough.headers"));
}
@Override
public String getName() {
return "passthrough";
}
} The above can then be used by adding |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
hi @grahamia! we'd probably want to see open-telemetry/opentelemetry-specification#1717 make it into the specification, and the name defined in the specification under |
Beta Was this translation helpful? Give feedback.
-
Thanks @trask glad I wasn't incorrect in how I got round the issues, will use what I have implemented and hopefully in the future the implementation within OpenTelemetry isnt a million miles different. |
Beta Was this translation helpful? Give feedback.
hi @grahamia! we'd probably want to see open-telemetry/opentelemetry-specification#1717 make it into the specification, and the name defined in the specification under
OTEL_PROPAGATORS
before adding support for it in the out-of-the-box Java agent