18 Feb 2020 02:54 PM
Hi
I need to collect Memory, CPU of a Host.
I also need to collect Response time of a service.
I read the API Document but didn't understand what to do.
Can you give me an exemple then i will learn from it
Can you help me?
Regards
Solved! Go to Solution.
18 Feb 2020 03:22 PM
Hello @EBA'A CHI O.,
Remember to never provide the Dynatrace environment ID in your question. Here are a couple of tips on how to ask the best question on our forum and increase your chances of getting a quick and precise answer:
18 Feb 2020 04:25 PM
Hello @EBA'A CHI O.,
Here is an example request to capture host CPU idle for every hour in the last day:
https://xxxx.live.dynatrace.com/api/v2/metrics/query?metricSelector=builtin%3Ahost.cpu.idle&resolution=h&from=now-1d%2Fh&entitySelector=type%28HOST%29%2CentityId%28HOST-C98F015DFD9D8A95%29
Keep in mind you will also need your token for this.
Here are some good resources for creating these requests:
https://www.dynatrace.com/news/blog/integrate-dynatrace-more-easily-using-the-new-metrics-rest-api/
Also, if you haven't tried. Go to your tenant and click the user icon. Under "dynatrace API" select "Environment API". This gives you a pretty great interface for creating a simple query.
Let me know if you need more help.
Thanks
-Dallas