Hi everyone,
I’m currently working with a DQL query that fetches spans and filters them based on a tag applied to the service (or process group) the span belongs to.
In my dashboard, I created a variable that contains a list of tag values. Then, in the DQL, I do the following:
fetch spans
| expand entityAttr(dt.entity.process_group_instance, "tags"), alias: tags2
| filter tags2 == $Service
Functionally, this works exactly as expected:
the spans returned correctly match the selected tag from the variable.
However, the downside is that each execution processes a very large amount of data (many GBs), which makes the query expensive.
My question is:
Is there a more efficient or recommended way to filter spans by the tags of the service (or related entity) they belong to, without having to expand all tags?
For example:
- Is there a way to filter earlier in the pipeline using entityAttribute() or similar functions?
- Any best practices to reduce data processed when filtering spans by entity tags?
- Or an alternative approach using service-level filtering instead of expanding tags on spans?
Any advice or examples would be greatly appreciated.
Thanks in advance!