Hi, I want to get some metrics from the dynatrace but I’m not sure they belong to which version V1 or V2? Can anyone help me with finding the correct address for getting the following metrics:
memory usage(service and process), CPU usage(service and process), throughput, network traffic, responsiveness, network connectivity and data round trip time
it’s not relevant if you use APIv1 or APIv2. All metrics are available on both API versions, just in a different way and possibilities how to get them.
You can use the “Metric” browser in Dynatrace to find the metric IDs for the ones you want to query. For example a generic memory usage of processes can be found with this ID:
the metric ID is “builtin:tech.generic.cpu.usage” not “com.dynatrace.builtin:…”
With that it should work. But I also recommend to using the V2 API for anything new you design, it provides some more nice features.
For response time , the only metric that I could successfully receive from the API, I entered “com.dynatrace…” and it worked so I thought maybe I need to enter that part for all of the metrics. I just deleted that part and still got the same error!
Thank you, I went to that page and under “/metrics/{metricKey} Gets the descriptor of the specified metric” entered “tech.generic.mem.usage” but it returned a 404 error! Do I need to add anything else in that input box?
I could get the data from V2 but unfortunately, it lacks information such as display name, aggregation types and I need them as well. Also, I cannot get the values for only one specific entity although I added the entity id for my process.
Regarding the information that you are lacking, you might need to make other API calls. That is typically the case when you get Entity codes in the JSON replies, and you want to get detailed information about those entities.
Regarding the second part of your question, it would be important for you to post here the API call you are invoking (please do not include sensitive information, eg. url & API token).
You need to add the process name you are looking for to the enttitySelector.
In order to do taht you can go to the data explorer select Process CPU usage metric, split by process and in the filter pick the process.name you are looking for.