01 Nov 2020 02:45 PM
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:
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`.
Solved! Go to Solution.
02 Nov 2020 08:20 AM
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.
03 Nov 2020 06:59 AM
Hi @Enrico F. 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
/api/v2/metrics
What am I missing?
03 Nov 2020 07:40 AM
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 but that would be unexpected.
03 Nov 2020 09:04 AM
Looks like that could be the case. This works well with Explorer but not working with Python script.
06 Nov 2020 08:41 AM
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