DQL
Questions about Dynatrace Query Language
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using DQL to Filter Metrics Based on Entity Segments – Best Approach?

tarjei_statkraf
Visitor

Hi!

I would like to create a segment, preferrably for all entities and metrics with a specific tag.
I have tried multiple variants now but I am unable to find anything.

Any suggestions?

I am trying to duplicate the functionality of Management Zones for dashboards.

2 REPLIES 2

t_pawlak
Champion

Hi,
Here’s a pattern that works for any metric:

timeseries p95 = percentile(dt.service.request.response_time, 95),
    by:{dt.entity.service},
    filter:{ in(
        dt.entity.service,
        classicEntitySelector("type(SERVICE),tag(\"criticality:Gold\")")
    )}
| fieldsAdd service_name = entityName(dt.entity.service)


This is currently the closest equivalent to Management Zone–style filtering in Grail dashboards.
If you want dashboard-wide filtering, you can put the selector into a dashboard variable and reuse it across tiles.

So I would like to have both entities and metrics filtered by this. How would I go about it?

Do I have to create one entity segment and one metric segment?

Featured Posts