# Split metrics and SLOs by tag

**URL:** <https://community.dynatrace.com/t/split-metrics-and-slos-by-tag/38497>\
**Category:** Automations\
**Tags:** dynatrace-managed, slo\
**Created:** [February 20, 2023, 2:00am UTC](https://community.dynatrace.com/t/split-metrics-and-slos-by-tag/38497 "2023-02-20T02:00:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [February 20, 2023, 2:00am UTC](https://community.dynatrace.com/t/split-metrics-and-slos-by-tag/38497/1 "2023-02-20T02:00:43Z")

</div>

I am looking to&nbsp;[splitBy](https://www.dynatrace.com/support/help/shortlink/api-metrics-v2-selector#splitby)&nbsp;a tag for a metric expression to generate one SLO definition that covers all entities.

The use-case is instead of having hundreds of metrics/SLOs defined per tag value (i.e. using a filter), to instead split by the tag.

On the metricsSelector, I can only seem to splitBy an available dimension and tags is not one of these. Is this use-case possible, or are multiple entitySelectors with filters for each tagging value necessary?

Did anyone have examples of how they solved this before?

Management zone filters the SLO dashboard tiles by the selected data, so it seems this calculation is possible. But it would have to be beyond dashboards, such as SLO alerts, etc.

---

<div class="post-metadata">

**Author:** ![Fin\_Ubels](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/fin_ubels/32/18008_2.png) [@Fin\_Ubels](https://community.dynatrace.com/u/Fin_Ubels)\
**Post date:** [February 20, 2023, 4:43am UTC](https://community.dynatrace.com/t/split-metrics-and-slos-by-tag/38497/2 "2023-02-20T04:43:51Z")

</div>

Hey Andrew,  
From what I’ve seen this will be possible once metrics on Grail rolls around allowing for DQL queries against metrics. I haven’t found a workaround in the current metric selector.

Looking at this blog post,&nbsp;[Expanded Grail data lakehouse and new Dynatrace user experience unlock boundless analytics | Dynatrace news](https://www.dynatrace.com/news/blog/boundless-exploratory-observability-and-security-analytics/), I reckon to do something like splitting by a parameter the DQL would look something like:

```markup
fetch dt.entity.host
| lookup [fetch metrics 
	| filter metric.key == "dt.host.cpu.system" 
	| summarize avg = avg(value), by:dt.entity.host], sourceField:entityId, lookupField:dt.entity.host
| summarize avg(lookup.avg), by:{cpuCores}

```

The above example would splitBy core count.

---

<div class="post-metadata">

**Author:** ![The\_AM](https://avatars.discourse-cdn.com/v4/letter/t/ce7236/32.png) [@The\_AM](https://community.dynatrace.com/u/The_AM)\
**Post date:** [February 22, 2023, 12:03am UTC](https://community.dynatrace.com/t/split-metrics-and-slos-by-tag/38497/3 "2023-02-22T00:03:22Z")

</div>

Thanks Fin
