envoy icon indicating copy to clipboard operation
envoy copied to clipboard

Envoy doesn't set span name, aka operation name, when using the OpenTelemetry tracing provider

Open therealak12 opened this issue 9 months ago • 1 comments

Title: Envoy doesn't set span name, aka operation name when using the OpenTelemetry tracing provider

Description:

When using the OpenTelemetry tracing provider, although the decorator.operation is set, the produces spans have the default ingress and egress names.

Repro steps:

We're experiencing the issue in a relatively large cluster (+3000 routes). The opentelemetry sandbox can be used to reproduce the issue. Just run the sandbox and view the logs of the opentelemetry container.

Config:

The configuration file provided in the examples/opentelemetry directory can be used. Although it sets the decoration.operation, the logs show it's not used.

Logs: Note the Name field below. It should be filled with the decorator.operation config not egress ....

Resource SchemaURL: 
Resource attributes:
     -> service.name: Str(front-envoy)
ScopeSpans #0
ScopeSpans SchemaURL: 
InstrumentationScope  
Span #0
    Trace ID       : c70726f22ff543661b4cec65b6a531d1
    Parent ID      : 
    ID             : a0eeb5dd051282f8
    Name           : egress localhost:10000
    Kind           : Client
    Start time     : 2024-04-29 03:48:15.683442 +0000 UTC
    End time       : 2024-04-29 03:48:15.691976 +0000 UTC
    Status code    : Unset
    Status message : 
Attributes:
     -> node_id: Str()
     -> zone: Str()
     -> guid:x-request-id: Str(97637684-df5e-920e-abf3-fbf13901205e)
     -> http.url: Str(http://localhost:10000/trace/2)
     -> http.method: Str(GET)
     -> downstream_cluster: Str(-)
     -> user_agent: Str(curl/7.81.0)
     -> http.protocol: Str(HTTP/1.1)
     -> peer.address: Str(172.22.0.1)
     -> request_size: Str(0)
     -> response_size: Str(37)
     -> component: Str(proxy)
     -> upstream_cluster: Str(envoy_cluster2)
     -> upstream_cluster.name: Str(envoy_cluster2)
     -> http.status_code: Str(200)
     -> response_flags: Str(-)
	{"kind": "exporter", "data_type": "traces", "name": "logging"}

Apparently, the fix is simple. I'm accompanying the issue with PR#34062. Kindly please let me know if not implementing the setOperation function was intentional.

therealak12 avatar May 09 '24 18:05 therealak12

cc @alexanderellis @htuch

phlax avatar May 10 '24 08:05 phlax