# Finding the list of metrics applicable to an Entity via Dynatrace API v2

**URL:** <https://community.dynatrace.com/t/finding-the-list-of-metrics-applicable-to-an-entity-via-dynatrace-api-v2/20701>\
**Category:** Dynatrace API\
**Tags:** dynatrace-api\
**Created:** [November 1, 2020, 2:45pm UTC](https://community.dynatrace.com/t/finding-the-list-of-metrics-applicable-to-an-entity-via-dynatrace-api-v2/20701 "2020-11-01T14:45:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rswarnka](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/rswarnka/32/10979_2.png) [@rswarnka](https://community.dynatrace.com/u/rswarnka)\
**Post date:** [November 1, 2020, 2:45pm UTC](https://community.dynatrace.com/t/finding-the-list-of-metrics-applicable-to-an-entity-via-dynatrace-api-v2/20701/1 "2020-11-01T14:45:01Z")

</div>

Hello experts,

I am trying to find the list of metrics applicable to specific entity and entity type such as specific host, application, process, service. `/metrics` api gives list of all metric ids:

```auto
https://abc12345.live.dynatrace.com/api/v2/metrics?pageSize=2000

```

But How do I find only the applicable metrics only to an entity or entity types, to, say `PROCESS_GROUP_INSTANCE` or `PROCESS-ABCDEFGHIJ123456`.

---

<div class="post-metadata">

**Author:** ![Enrico\_F](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/enrico_f/32/23774_2.png) [@Enrico\_F](https://community.dynatrace.com/u/Enrico_F)\
**Post date:** [November 2, 2020, 8:20am UTC](https://community.dynatrace.com/t/finding-the-list-of-metrics-applicable-to-an-entity-via-dynatrace-api-v2/20701/2 "2020-11-02T08:20:06Z")

</div>

This is something I struggled with, too. IMO there is currently no straight forward method to achieve that. Might be a good candidate for an RFE.

As a workaround to retrieve all applicable metricId’s for a certain entity type I guess one can query the full metric tree using

/api/v2/metrics?pageSize=5000&fields=entityType

and then filter/extract each returned MetricDescriptor object according to the values present in the entityType array.

---

<div class="post-metadata">

**Author:** ![rswarnka](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/rswarnka/32/10979_2.png) [@rswarnka](https://community.dynatrace.com/u/rswarnka)\
**Post date:** [November 3, 2020, 6:59am UTC](https://community.dynatrace.com/t/finding-the-list-of-metrics-applicable-to-an-entity-via-dynatrace-api-v2/20701/3 "2020-11-03T06:59:17Z")

</div>

Hi [@Enrico F.](https://answers.dynatrace.com/users/3956/view.html) Great! I was able to extract the entity - metric. But I am not sure why I only see just 500 entries with `/api/v2/metrics?pageSize=5000&fields=entityType `.

However there are about 2000 metrics via

```auto
/api/v2/metrics

```

What am I missing?

---

<div class="post-metadata">

**Author:** ![Enrico\_F](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/enrico_f/32/23774_2.png) [@Enrico\_F](https://community.dynatrace.com/u/Enrico_F)\
**Post date:** [November 3, 2020, 7:40am UTC](https://community.dynatrace.com/t/finding-the-list-of-metrics-applicable-to-an-entity-via-dynatrace-api-v2/20701/4 "2020-11-03T07:40:35Z")

</div>

Strange. In my case I’m getting \>2000 entries when testing this on our managed instance. Maybe there are some additional restrictions for SaaS tenants on top of the already imposed [request throttling](https://www.dynatrace.com/support/help/shortlink/api-access-limit#request-throttling) but that would be unexpected.

---

<div class="post-metadata">

**Author:** ![rswarnka](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/rswarnka/32/10979_2.png) [@rswarnka](https://community.dynatrace.com/u/rswarnka)\
**Post date:** [November 3, 2020, 9:04am UTC](https://community.dynatrace.com/t/finding-the-list-of-metrics-applicable-to-an-entity-via-dynatrace-api-v2/20701/5 "2020-11-03T09:04:14Z")

</div>

- Environment API 50 requests per minute.

Looks like that could be the case. This works well with Explorer but not working with Python script.

---

<div class="post-metadata">

**Author:** ![AK](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ak/32/164_2.png) [@AK](https://community.dynatrace.com/u/AK)\
**Post date:** [November 6, 2020, 8:41am UTC](https://community.dynatrace.com/t/finding-the-list-of-metrics-applicable-to-an-entity-via-dynatrace-api-v2/20701/6 "2020-11-06T08:41:59Z")

</div>

You are making just one API call hence 50 requests per minute limit doesn’t count here 🙂  
I’m also able to get all metric list and the count is 2019 for me
