envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.85k stars 4.78k forks source link

Add the route name to trace data #21605

Open dasch opened 2 years ago

dasch commented 2 years ago

Title: Add the route name to trace data

Description:

I would like to group and filter traces by route name, since that will be a key dimension for us; right now there's no good way of doing it. The route name is available in the access logs, but we sample those heavily and mostly rely on traces, which integrate much better with the rest of our observability data.

daixiang0 commented 2 years ago

Please check https://www.envoyproxy.io/docs/envoy/latest/api-v3/type/tracing/v3/custom_tag.proto and related docs. I think if you specify the route name as a custom tag, it will be added since route name is stored in stream_info: https://github.com/envoyproxy/envoy/blob/fa0899c7f06194fc1d0eac150dc931f5b2b1071e/source/common/tracing/http_tracer_impl.cc#L215-L222