TraceQL structural operator how to combine/select fields from e.g. parent #4313
Unanswered
WizzardMaker
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi @WizzardMaker. What visualization are you using: explore or a table panel? With a union structural operator and selecting |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We want to aggregate run time metrics of LLM calls in an application with categorized searches.
Each LLM call has a span associated with all its metrics and that span is a child of a "category" span (with other child spans as well)
Now the category span has an attribute which we want as "group by" key for the aggregation, and a single trace contains multiple category spans.
Problem is, that we don't really see a performant/easy way to get the tag from the parent span in a child query
The query looks something like this:
But that won't get us the span.tag of the parent
A way that could work would be to use a union structural, but parent and child would need to have a common value to aggregate them later with e.g. Grafana transformations. We couldn't find any attribute that "links" both together.
Example result for a union looks like this (there are more rows in the result than in the image):
Our goal is to have a query that results in a single row combining parent-child
What would be the best way to accomplish a true "union" of parent and child span attributes in the same result row?
Beta Was this translation helpful? Give feedback.
All reactions