I have a http header: X-Seq-ApiKey send as part of the request going to the otel collector.
I need to forward this through the otelhttp exporter.
I have found this extension, that i believe should be able to solve my problem. However I am having a LOT of trouble understanding how to use this extension correctly.
receivers:
otlp:
protocols:
grpc:
include_metadata: true
exporters:
debug:
#verbosity: detailed
otlphttp/seq:
endpoint: http://seq:5341/ingest/otlp
otlp/jaeger:
endpoint: http://jaeger:4317
tls:
insecure: true
extensions:
health_check:
pprof:
zpages:
endpoint: ":55679"
headers_setter:
headers:
- action: upsert
key: X-Seq-ApiKey
from_context: X-Seq-ApiKey
service:
extensions: [zpages, headers_setter]
pipelines:
traces:
receivers: [otlp]
processors: []
exporters: [otlp/jaeger]
metrics:
receivers: [otlp]
processors: []
exporters: [debug]
logs:
receivers: [otlp]
processors: []
exporters: [otlphttp/seq]
I have tried using both value and from_context - with no luck.
Since the documentation is lacking an example of the incoming http request header, it is a bit tricky to figure out what the correct values are here.
I have tried all the combinations i can think of, so i must be doing something else wrong. Any input?
Here's what you can do:
headers_setterconfiguration, you should set the header with a static value for testing. If it works, then switch tofrom_context:After making these changes, restart the OpenTelemetry Collector and observe if the header is being forwarded correctly. If it's not, the issue might not be with your configuration but with how the header is being handled by the collector or the exporter.