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

Add support for kind, status, instrumentation library, links, events and state data for traces

Open benceszikora opened this issue 1 year ago • 8 comments

This PR adds support for the kind, status, instrumentation library, links, events and state fields in the trace panel in Grafana. This will bring the plugin to feature parity with what Tempo can offer today.

benceszikora avatar Nov 01 '24 16:11 benceszikora

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 01 '24 16:11 CLAassistant

Also AFAIU In the default schema Links is a Nested table and you need to select the fields individually:

 arrayMap(
  (traceid, spanid, attributes) -> tuple(
                     traceid,
                     spanid,
                     arrayMap(
                       key -> map('key', key, 'value', attributes[key]),
                       mapKeys(attributes)
                     )
                   )::Tuple(traceID String, spanID String, tags Array(Map(String, String)))
                   , Links.TraceId, Links.SpanId, Links.Attributes
  ) AS references

Sup3rGeo avatar Nov 07 '24 13:11 Sup3rGeo

Also AFAIU In the default schema Links is a Nested table and you need to select the fields individually

@Sup3rGeo not disputing the table schema, but arrayMap(l -> ..., Links) does work here - is it possible this is a newer clickhouse feature?

@SpencerTorres @benceszikora is it worth splitting the bits of this PR that can work with the current schema into something that's mergeable now? In my case I'm itching for span events to be supported, and this achieves that out of the box which is really nice.

jwhitaker-gridcog avatar Dec 03 '24 22:12 jwhitaker-gridcog

is it worth splitting the bits of this PR that can work with the current schema into something that's mergeable now?

@jwhitaker-gridcog Yes, there's some parts of this that need changing. I don't mind picking apart the code myself for it, but I want to make sure the author is okay with that (@benceszikora)

SpencerTorres avatar Jan 07 '25 22:01 SpencerTorres

@SpencerTorres with @harryjph's changes this PR should now conform to the same schema as the OTel Collector. Are there any changes you would suggest before this can be merged?

benceszikora avatar Feb 24 '25 18:02 benceszikora

Just tested out this fork locally and note that span link redirection is not working so far.

When you click on the link it basically redirects you to the same trace instead of the one linked. Echoes to this issue

Screenshot 2025-03-25 at 16 08 17

ValentinLvr avatar Mar 25 '25 15:03 ValentinLvr

Hello! I appreciate all the changes and comments everyone contributed here.

The main value of this PR was solving how to properly decode these Nested columns, and it seems like this was solved for multiple cases (flatten_nested = 0/1). Thank you for testing that

There were some large structural changes I wanted to address before merging this into the main branch, and instead of writing a bunch of suggestions I decided to fix them myself in a different PR: #1208

These are mainly related to how the components are used, along with fixing some test cases and adding flexibility. If you have any more comments related to the code of this PR, I would recommend writing them over there where I can address them asap.

Hopefully we can get this merged soon now that everything is working smoothly 👌

SpencerTorres avatar Mar 26 '25 06:03 SpencerTorres

Just tested out this fork locally and note that span link redirection is not working so far.

When you click on the link it basically redirects you to the same trace instead of the one linked. Echoes to this issue

Screenshot 2025-03-25 at 16 08 17

@ValentinLvr Hey! I finally found a sample row that shows this. Let's put it into a new issue, this might have something to do with the linking. Maybe even a conflict with our existing TraceId link. I'll ask the Grafana team

SpencerTorres avatar Mar 26 '25 06:03 SpencerTorres