clickhouse-datasource
clickhouse-datasource copied to clipboard
Add support for kind, status, instrumentation library, links, events and state data for traces
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.
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
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.
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 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?
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
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 👌
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
@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
