cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Fetching data from SaaS using Rest API

ragarwal
Newcomer

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? 

8 REPLIES 8

ChadTurner
DynaMight Legend
DynaMight Legend

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. 

-Chad

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?

AntonioSousa
DynaMight Guru
DynaMight Guru

You might have some success defining them as a separate service:

https://www.dynatrace.com/support/help/shortlink/third-party-services#monitor-a-third-party-service-...

That will open new possibilities regarding fetching data through the API.

Antonio Sousa

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?

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.

Antonio Sousa

What about the Service-Ids? Do you know a way to fetch service names instead of service IDs from the response?

In my case, I invoke the Entities v2 API, and then correlate the data.

Antonio Sousa

Thanks. that Works!!

Featured Posts