21 Jul 2020 09:04 AM
Hi
Is there any API with which I can fetch all the metrics like CPU, Memory etc. for a particular application or any service which is being monitored by dynatrace ?
Solved! Go to Solution.
21 Jul 2020 02:14 PM
Yes, anything that you can include in a custom chart can be polled through the metrics API:
https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/
22 Jul 2020 01:30 PM
Thanks for your quick response
But i need some more info on this
Suppose i created a custom chart and pinned that to dashboard
now can you please suggest me how to fetch the data from that chart using API
how can i create a metrics API for that chart?
22 Jul 2020 04:55 PM
You don't pull data from charts, using the API you are accessing the same underlying datastore that the custom charts themselves use.
22 Jul 2020 05:20 PM
Okay
Can you please guide me from where i can create the APIs which can fetch the data from datastore (datastore used by custom chart).
22 Jul 2020 07:16 PM
The API I linked initially is the 'interface' that you interact with to pull that data out of Dynatrace.
https://www.dynatrace.com/support/help/dynatrace-api/environment-api/metric-v2/
You create an API token (in the settings > integration > Dynatrace API) and then you use that token to query the API which is described in the link above. All you would need to get started is described in the main page for the API (e.g. authentication) and it described how to try things out using the API explorer.
23 Jul 2020 05:24 AM
Thanks for guiding, James.