How do I trace a client request without propagating traceid and other headers? #6335
-
In my golang application I make lots of calls to internal services and that works well, propagation included. My codebase has a second http client initialised for external calls, with its own otelhttp.NewTransport configuration. I can't work out how I can disable propagation of headers to the resulting service (AWS s3 presigned URL PUT request) while still retaining the span and the information I want like status code in the parent trace span. Any help to work out how to use otelhttp in a way that gives me the client call information without leaking the headers upstream to external API calls would be great. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Try using the https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp#WithPropagators option with an empty propagator composite: https://pkg.go.dev/go.opentelemetry.io/otel/propagation#NewCompositeTextMapPropagator |
Beta Was this translation helpful? Give feedback.
Try using the https://pkg.go.dev/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp#WithPropagators option with an empty propagator composite: https://pkg.go.dev/go.opentelemetry.io/otel/propagation#NewCompositeTextMapPropagator