clickhouse-datasource icon indicating copy to clipboard operation
clickhouse-datasource copied to clipboard

references (span links) not showing for traces in Grafana

Open Sup3rGeo opened this issue 5 months ago • 1 comments

Hi,

When we query traces from Clickhouse as a data source we don't see the span references listed, which is different from when I check traces from Tempo, where the reference links are in fact listed in the trace view.

I was able to somewhat fix it by adding another transformation to the sql query:

arrayMap(x,y -> map('spanID', x, 'traceID', y), Links.SpanId, Links.TraceId) AS references

This makes the links appear, but we are missing link attributes which are useful to identify/name each of the links.

Unfortunately trying to add the Links.Attributes column as tags (as it seems to be the case with Tempo) wouldn't work:

arrayMap(x,y,z -> map('spanID', x, 'traceID', y, 'tags', z), Links.SpanId, Links.TraceId, Links.Attributes) AS references

the query fails because clickhouse requires all map values to be of the same type, and in this case we have (String, String, Map).

Is there a way to have Links.Attributes showing up as span references in the Trace view in Grafana? Thanks!

Environment:

  • Grafana version: 11.2.0
  • Plugin version: 4.3.2

Sup3rGeo avatar Sep 10 '24 13:09 Sup3rGeo