Skip to content

OpenTelemetry tracing to Tempo fails using backendRef, works using host/port (HTTP used instead of GRPC?) #5887

Closed

Description

@rtomadpg

Description:

Attempting to get OpenTelemetry tracing to Tempo working, I noticed following EnvoyProxy configuration works:

...
  telemetry:
    tracing:
      samplingRate: 100
      provider:
        type: OpenTelemetry
        host: tempo-distributor.tempo.svc.cluster.local.
        port: 4317
      customTags:
        ...

... but this does NOT work:

...
  telemetry:
    tracing:
      samplingRate: 100
      provider:
        type: OpenTelemetry
        backendRefs:
          - name: tempo-distributor
            namespace: tempo
            port: 4317
            group: ''
            kind: Service
      customTags:
        ...

"It works" means:

  • Tempo receives the data. Traces are visible via Tempo API or Grafana.
  • HTTP 200s: envoy_cluster_upstream_rq{envoy_cluster_name="tracing",envoy_response_code="200"} > 0

"It does not work" means:

  • Tempo receives data, but tcpdump shows connection resets (by Tempo). Nothing in Grafana
  • HTTP 502s: envoy_cluster_upstream_rq{envoy_cluster_name="tracing",envoy_response_code="502"} > 0

Repro steps:

  • Install Tempo (or another OTEL collector)
  • Configure a Envoy Proxy with OTEL tracing, using a backendRef to Tempo
  • Check Tempo

Environment:

  • AWS EKS 1.32
  • Gateway v1.3.2, installed via Helm chart
  • Using Envoy Proxy v1.33.1
  • Envoy Proxy with aforementioned config snippet

Logs:

I've compared Envoy config_dump output between tracing-to-service-hostname vs tracing-to-backend. Here are the differences relevant to tracing:

  1. when it works, the provider has grpc_service.envoy_grpc.authority:
Image
  1. the socket address is different: the service hostname vs the service endpoint:
Image

And here is a screenshot of the tcpdump showing a HTTP POST is used to the GRPC port 4317:

Image

And here are the response codes for the "tracing" cluster during my tests, showing 502 codes with the backendRef, and 200 codes with the hostport:

Image

Activity

  1. fallard84 commented on May 1, 2025

    @fallard84

    I'm encountering the same issue, and using the provider.host and provider.port fixes the issue for me.

  2. added this to the v1.4.0 milestone on May 1, 2025
  3. arkodg commented on May 1, 2025

    @arkodg
    Contributor
  4. zirain commented on May 1, 2025

    @zirain
    Member

    can you share the svc yaml? you may need set appProtocol on the port.

  5. rtomadpg commented on May 8, 2025

    @rtomadpg
    ContributorAuthor

    Hi @zirain, thank you for looking into this.

    We're using the official Tempo Helm chart https://github.com/grafana/helm-charts/tree/main/charts/tempo-distributed
    Looking in the distributor Service template https://github.com/grafana/helm-charts/blob/main/charts/tempo-distributed/templates/distributor/service-distributor.yaml I see:

        - name: grpc-distributor-otlp
          port: 4317
          protocol: TCP
          targetPort: grpc-otlp
          {{- if .Values.distributor.appProtocol.grpc }}
          appProtocol: {{ .Values.distributor.appProtocol.grpc }}
          {{- end }}
    

    The values file defaults this value to null:

    distributor:
      ...
      appProtocol:
        # -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https"
        grpc: null
    

    We do not override this default, so - as you suspected - the deploy Service does not have appProtocol set.

    Let me test what happens if I set distributor.appProtocol.grpc: grpc

  6. rtomadpg commented on May 8, 2025

    @rtomadpg
    ContributorAuthor

    Tested with:

    distributor:
      appProtocol:
        grpc: grpc
    

    ... in values for Tempo and it works. 🥳

    So, for me this issue is resolved. But I am wondering how to prevent this issue for others. Maybe EnvoyGateway can default the protocol to "grpc"?

  7. zirain commented on May 8, 2025

    @zirain
    Member

    nop, we cannot assume that because OTel support HTTP.

    IMO, what we can is improving the doc.

  8. rtomadpg commented on May 8, 2025

    @rtomadpg
    ContributorAuthor

    Something like #5963 ?

    Closing this issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions