Description
What part of OPA would you like to see improved?
Distributed tracing support.
Currently OPA distributed tracing supports only W3C context propagation header traceparent
that is standard in Open Telemetry specification.,
So OPA instance creates/reports spans that use traceid and parent span values from traceparent
header.
But OTEL spec and W3C standard is still not completely supported everywhere, so support of older tracing headers that existed before OpenTelemetry specification will be very useful.
For example, Traefik - a widely adopted API gateway and K8s Ingress controller doesn't support OTEL / W3C headers, but supports B3 and Jaeger ones.
Describe the ideal solution
I was thinking about introduction of fallback mechanism via what is called "composite propagator" in OTEL specification.
i.e. OPA would iterate via several supported header formats until find one that can extract parent trace info from headers
- try to find W3C
traceparent
header ( current behaviour) - if not found then try to extract Jaeger's
uber-trace-id
- if not found then try to extract B3 headers
Additional Context
-
Existing Go libraries to use
https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/propagators -
Probable place to inject propagators in OPA code
https://github.com/open-policy-agent/opa/blob/main/internal/distributedtracing/distributedtracing.go#L122
The solution should only be injecting additional propagators together with current W3C one. There should not be a need to manually implement fallback.