# Querying to find the most costly ingested metrics

**URL:** <https://community.dynatrace.com/t/querying-to-find-the-most-costly-ingested-metrics/55950>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed, cost-optimization\
**Created:** [May 19, 2026, 3:46pm UTC](https://community.dynatrace.com/t/querying-to-find-the-most-costly-ingested-metrics/55950 "2026-05-19T15:46:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![siavash1996](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/siavash1996/32/19300_2.png) [@siavash1996](https://community.dynatrace.com/u/siavash1996)\
**Post date:** [May 19, 2026, 3:46pm UTC](https://community.dynatrace.com/t/querying-to-find-the-most-costly-ingested-metrics/55950/1 "2026-05-19T15:46:51Z")

</div>

Hi there,

I’m trying to find a way to query grail to find the most expensive metrics that we are ingesting via API. In Gen2, it was pretty easy to get an idea of the cost of custom metrics, but I have been unable to find any way of doing it for the new Gen3 Grail-enabled metrics. I know it is usually a function of cardinality and the number of metric points, but I want to be able to target specific expensive custom metrics to reduce their ingestion if possible and reduce cost. Only problem is I don’t know which of our ingested metrics to look at first.

If I run a DQL query for “metrics”, none of the returned columns seem to have anything that would be useful for estimating cost.

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [May 20, 2026, 7:12am UTC](https://community.dynatrace.com/t/querying-to-find-the-most-costly-ingested-metrics/55950/2 "2026-05-20T07:12:25Z")

</div>

Hi,

We have a section in the Account level where you can find notebooks about this.

Best regards

---

<div class="post-metadata">

**Author:** ![siavash1996](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/siavash1996/32/19300_2.png) [@siavash1996](https://community.dynatrace.com/u/siavash1996)\
**Post date:** [May 20, 2026, 8:43pm UTC](https://community.dynatrace.com/t/querying-to-find-the-most-costly-ingested-metrics/55950/3 "2026-05-20T20:43:51Z")

</div>

Maybe I’m not seeing clearly, but the notebook that is linked in the Account portal doesn’t seem to have any queries that split upon the metric key.

---

<div class="post-metadata">

**Author:** ![AntonioSousa](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antoniosousa/32/50_2.png) [@AntonioSousa](https://community.dynatrace.com/u/AntonioSousa)\
**Post date:** [May 20, 2026, 10:11pm UTC](https://community.dynatrace.com/t/querying-to-find-the-most-costly-ingested-metrics/55950/4 "2026-05-20T22:11:55Z")

</div>

[@siavash1996](https://community.dynatrace.com/user/71316)&nbsp;,  
Dynatrace took it away. It was the Consumption in the menu.

There still is a metric where you can get part of that information, available through Data Explorer:

- builtin:billing.custom\_metrics\_classic.raw.usage\_by\_metric\_key:splitBy(metric\_key):sort(value(auto,descending))

Unfortunately, this metric is not supported in Grail, at least that I know of…

---

<div class="post-metadata">

**Author:** ![siavash1996](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/siavash1996/32/19300_2.png) [@siavash1996](https://community.dynatrace.com/u/siavash1996)\
**Post date:** [May 21, 2026, 3:19pm UTC](https://community.dynatrace.com/t/querying-to-find-the-most-costly-ingested-metrics/55950/5 "2026-05-21T15:19:22Z")

</div>

Thanks for confirming that. I should probably submit a product idea for this then.

---

<div class="post-metadata">

**Author:** ![gernotreiber](https://avatars.discourse-cdn.com/v4/letter/g/ac91a4/32.png) [@gernotreiber](https://community.dynatrace.com/u/gernotreiber)\
**Post date:** [August 3, 2026, 7:53am UTC](https://community.dynatrace.com/t/querying-to-find-the-most-costly-ingested-metrics/55950/6 "2026-08-03T07:53:27Z")

</div>

You can vote on this idea:  
[https://community.dynatrace.com/t5/Ideas/More-granular-sources-for-metrics-ingest-billing-usage-events/idi-p/300502](https://community.dynatrace.com/post/300502)
