23 Jul 2020 04:43 AM - last edited on 10 Jun 2021 04:09 AM by MaciejNeumann
Does dynatrace have an api to extract cpu usage and ram usage details for all hosts for last 2 months? We would like to use curl to fetch the data.
We are on version 22.214.171.12400323-145140.
Solved! Go to Solution.
Take a look in https://xXxXxXx.live.dynatrace.com/rest-api-doc/index.jsp?urls.primaryName=Environment%20API%20v1#/ for the API page (replacing the x’s with your tenant ID). This is an interact-able page to build the API calls you would be interested in; I would focus in on timeseries section. Also, once you have built your API calls, you can make it into a fully formed URL and take advantage of the “from web” data option in excel to automatically pull your information and format it into an excel chart
I have done this many times myself and found it to work wonders. You can also download a json each time and import it into Excel but that inquires a bit more manual work.
Hi @Michael O.
That's is really great way to utilize dynatrace rest api.
The only question I do have here is if you managed to utilize the v2 metric with csv output? I didn't succeed to create the accept-type to be send as a url query parameter
I am working on a similar report using the Metrics API. We have had some luck with building the API request, but I'm curious if there's a way to extract the request URL or if someone has knowledge to what the API request is for the XLS export from a dashboard. The XLS report download shows all data points for the time frame. How would you condense the data points down to one (as shown in the snippet)? The report request I have is to have Max CPU and Max Memory for a specific time period. I'm guessing the one number is an average of all the data points. Can this be built into the request?