opentelemetry-js
opentelemetry-js copied to clipboard
Clear baggage received as part of http instrumentation.
I am using http auto instrumentation but I'm looking at a way to clear any baggage received as part of propagation. In my example I have an API and I want to not accept any baggage. How can I achieve this?
- [x] This only affects the JavaScript OpenTelemetry library
- [ ] This may affect other libraries, but I would like to get opinions here first
Maybe don't register the W3CBaggagePropagator
?
But this is not limited to HTTP, would also effect GRPC,...
Maybe don't register the
W3CBaggagePropagator
? But this is not limited to HTTP, would also effect GRPC,...
Thanks @Flarna
Do you know how this can be done? I cant see a way to update the baggage propagator in the NodeTraceProvider?
I actually want to block incoming baggage but push some baggage outbound so I dont want to completely disable the propagator but I could make the extract function a noop operation.
You can manually specify the propagators you want during calling register. e.g.
const provider = new NodeTracerProvider();
provider.register({
propagator: new W3CTraceContextPropagator()
});
It should also work to set environment variable to e.g. OTEL_PROPAGATORS=tracecontext
. Default if not set is tracecontext,baggage
.
I actually want to block incoming baggage but push some baggage outbound so I dont want to completely disable the propagator but I could make the extract function a noop operation.
I guess in this case you need a custom propagator which you easily can create from the existing baggage propagator.
But I wonder why you want to send out something which never gets read from anyone.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This issue was closed because it has been stale for 14 days with no activity.