16 Jun 2021 08:54 AM - last edited on 29 Jun 2021 02:02 PM by MaciejNeumann
Hi, I am monitoring a java application hosted on a few servers/hosts using oneagent license. Dynatrace marks a number of requests as 'Request to unmonitored hosts' and 'Requests to Public Networks'. These are basically 'Called services' for third party calls or requests going to internal unmonitored hosts. My question is- I want to fetch data like 'Response Time' and 'Request Count' for all these services using Rest API.
Currently what I find is - Creating key requests for each one of them and creating calculated metric for each one of them (Response time and request count separately) and fetching them one by one. The process is tedious and requires huge amount of effort for large number of services. Is there a better way to do this or fetch the data directly?
Solved! Go to Solution.
16 Jun 2021 01:56 PM
If you can get the data via the new data explorer or the multidimensional analysis chart, then you will need to put in a RFE so s more simplified solution could be provided.
18 Jun 2021 08:50 AM
Hi Chad,
Yes by creating tags I could get them into MDA view and fetch them through API. But the problem lies in identifying these services because responses contain service IDs rather than service Names. Is there a way to get service names into the API responses?
16 Jun 2021 06:44 PM
You might have some success defining them as a separate service:
That will open new possibilities regarding fetching data through the API.
18 Jun 2021 08:47 AM
Hi Antonio, I actually did that and by saying 'creating key request' in my question, I actually meant marking them as a 'separate service'. But the problem is - Once they are created as a separate service, they mix into the entire services list and parsing them gets difficult. Especially when responses return service-IDs rather than human readable service names. So, there are 2 challenges: 1. Sorting them out from the entire list of services
2. Converting the service-Ids into service names.
For point 1. I could resolve it by creating tags and assigning it to services that I want to fetch through the APIs. The APIs then use filter paramater and gets back response for only the tagged services.
For Point 2. I manually added a list of <key:value> pairs into my code where keys are the service ids and values are the service names. The Api response is then parsed and compared against this list of key:value pairs. The metric values are then allotted accordingly to the backend.
This process is cumbersome and may require frequent modifications from time to time. If you are someone who needs to monitor a dynamic list of services, Point 2 may not work for you. I just hope there is some better way to do this completely through the api rather than hard coding values. Please Let me know if there is a better way?
18 Jun 2021 02:38 PM
I would go the tag way. Of course, you have to tag them as you mark them as separate services, but then it should be pretty straightforward.
18 Jun 2021 03:01 PM
What about the Service-Ids? Do you know a way to fetch service names instead of service IDs from the response?
18 Jun 2021 07:09 PM
In my case, I invoke the Entities v2 API, and then correlate the data.
12 Jul 2021 06:21 AM
Thanks. that Works!!