Skip to content

Support for Custom Headers in OTLP Exporter #2636

@Thomas-Matheus

Description

@Thomas-Matheus

Is your feature request related to a problem? Please describe.

GoFr's OpenTelemetry integration only supports basic configuration (TRACE_EXPORTER, TRACER_URL, TRACER_RATIO) without the ability to specify custom authentication headers. Many observability platforms (Grafana Cloud, New Relic, Datadog, Honeycomb, etc.) require custom headers for authentication (e.g., X-API-Key, Api-Key, X-Honeycomb-Team). Currently, users must either deploy an OpenTelemetry Collector as a proxy or implement OTEL manually, adding unnecessary complexity.

Describe the solution you'd like

Add support for custom headers in the OTLP exporter configuration via environment variables:

TRACE_EXPORTER=otlp
TRACER_URL=otel.example.com:4317
TRACER_HEADERS=X-Api-Key=secret,X-Custom-Header=value

Alternatively, support the standard OpenTelemetry environment variable OTEL_EXPORTER_OTLP_HEADERS for ecosystem consistency.

Describe alternatives you've considered

  1. OpenTelemetry Collector sidecar: Deploy a collector to handle authentication - adds infrastructure overhead
  2. Manual OTEL implementation: Implement OpenTelemetry manually using the Go SDK - loses GoFr's built-in convenience
  3. Reverse proxy: Use an authentication proxy in front of the OTLP endpoint - increases latency and complexity

Additional context

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions