opentelemetry-cpp-contrib
opentelemetry-cpp-contrib copied to clipboard
ApacheModuleOtelExporterHeaders for OTEL_EXPORTER_OTLP_HEADERS
Is your feature request related to a problem?
Is there a way to configure OTEL_EXPORTER_OTLP_HEADERS with the Apache Module? The current version works wonderfully with Jaeger. I can change my ApacheModuleOtelExporterEndpoint to Jaeger running in Docker on my local machine, and the traces show up as expected. However, I'd like to send data to other endpoints that require an API key in the header.
Describe the solution you'd like
Can you allow something like ApacheModuleOtelExporterHeaders in opentelemetry_module.conf so that OTEL_EXPORTER_OTLP_HEADERS can be configurable? This will let users configure OTEL_EXPORTER_OTLP_HEADERS.
Describe alternatives you've considered
I've tried using environment variables in Linux but this didn't work for me with this Apache Module: export OTEL_EXPORTER_OTLP_HEADERS="api-key=abc123". I was hoping the headers would be picked up automatically like my other applications instrumented with OpenTelemetry.
Thanks @pnvnd for raising this. Let me evaluate this and take this forward.
CC: @kpratyus
I think something happens for nginx module. I couldn't see OTEL_EXPORTER_OTLP_HEADERS into the nginx config options https://github.com/open-telemetry/opentelemetry-cpp-contrib/tree/main/instrumentation/otel-webserver-module#configuration-1 and would be nice to have it. Thanks 🙏
Closing as fixed