solo-io / gloo

The Feature-rich, Kubernetes-native, Next-Generation API Gateway Built on Envoy

Home Page:https://docs.solo.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set tracestate on trace initiated by gloo from an incoming/transformed header

huzlak opened this issue · comments

Gloo Edge Product

Enterprise

Gloo Edge Version

v1.16.7

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

I want to set tracestate header value based on value of a header created by transformation when trace is initiated by gateway-proxy. Currently envoy only sets empty tracestate when it initiates the trace.

Describe the solution you'd like

An option in tracing provider configuration that would allow that, e.g.:

    tracing:
      openTelemetryConfig:
        tracestateFromHeader: $headerName
        collectorUpstreamRef:
          namespace: "gloo-system"
          name: "opentelemetry-collector"

Describe alternatives you've considered

Using baggage to propagate the header, but it's currently not propagated by upstream services which makes it a non-viable solution.
Using a transformation to set the header doesn't work as it's overridden by the tracer.

Additional Context

No such option is currently available in upstream envoy opentelemetry tracer.

Zendesk ticket #3912 has been linked to this issue.

@nfuden According to the linked Zendesk ticket, when you try to set the tracestate header in a regular stagedTransformation, it gets overridden/reset by the tracer. Before we dive into adding new options to configurations, can you check what's actually happening, and see if there is an option to do this via a transformation. Since we had that discussion about being able to define more transformations in the chain, we might actually have a use-case for it here ....