-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
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=valueAlternatively, support the standard OpenTelemetry environment variable OTEL_EXPORTER_OTLP_HEADERS for ecosystem consistency.
Describe alternatives you've considered
- OpenTelemetry Collector sidecar: Deploy a collector to handle authentication - adds infrastructure overhead
- Manual OTEL implementation: Implement OpenTelemetry manually using the Go SDK - loses GoFr's built-in convenience
- Reverse proxy: Use an authentication proxy in front of the OTLP endpoint - increases latency and complexity
Additional context
- OpenTelemetry OTLP Exporter Configuration
- GoFr Observability Documentation
- The Go OTEL SDK already supports custom headers via
otlptracegrpc.WithHeaders()- this enhancement would expose that capability through GoFr's configuration layer