Description
When clicking "Logs for this span" on a span in the Traces Drilldown app, the resulting Loki query only filters by service_name (and service_namespace), without including a trace_id filter. This causes all logs from the service to be shown instead of only the logs correlated with the selected span/trace.
Steps to Reproduce
- Open Traces Drilldown app
- Select a trace
- Select a span
- Click "Logs for this span"
Expected Behavior
The Loki query should include a trace_id filter, e.g.:
{`service_name`="frontend", `service_namespace`="demo"} | `trace_id` = "<`trace_id`>"
Actual Behavior
The generated Loki query only filters by service labels:
{`service_name`="frontend", `service_namespace`="demo"}
No trace_id filter is applied, resulting in all logs from the service being shown.
Additional Context
trace_id is stored as Loki structured metadata (not a stream label), which is why {trace_id="..."} cannot be used as a stream selector. A label filter (| trace_id = "...") is required instead.
- The Tempo datasource "Trace to logs" custom query configuration is ignored by the Traces Drilldown app.
- Grafana version: 13.1.0 (Cloud Advanced)
- Traces Drilldown app: grafana-exploretraces-app
Description
When clicking "Logs for this span" on a span in the Traces Drilldown app, the resulting Loki query only filters by
service_name(andservice_namespace), without including atrace_idfilter. This causes all logs from the service to be shown instead of only the logs correlated with the selected span/trace.Steps to Reproduce
Expected Behavior
The Loki query should include a
trace_idfilter, e.g.:Actual Behavior
The generated Loki query only filters by service labels:
No
trace_idfilter is applied, resulting in all logs from the service being shown.Additional Context
trace_idis stored as Loki structured metadata (not a stream label), which is why{trace_id="..."}cannot be used as a stream selector. A label filter (| trace_id = "...") is required instead.