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

API to get a list of Web Transactions

raghu_iitr
Newcomer

I just got onto dynatrace SaaS offering and installed the dynatrace one agent. I then installed an apache tomcat webserver on the box and started sending it some traffic. The traffic shows up in the UI under this

Transactions & Services -> Service Name -> View dynamic request

What i need is to get this list of web transactions (with their time series ids etc) through REST API so that i can fetch their data and do some analysis.

I looked at the documentation here https://www.dynatrace.com/support/help/dynatrace-a... and i explored the timeseries and Topology & Smartscape apis. There are things i noticed

1. When i asked for all the time series metrics i get a huge list of time series metrics but it doesn't show any of my application metrics.
2. I could not find any way to filter these time series by any service or application.

Need this urgently so any help is greatly appreciated.

3 REPLIES 3

pahofmann
Champion


If you make a call to the timeseries API endpoint with no filters or incorrect parameters it will return a list of all available timeseries metrics, that is probably what you are seeing.


If you want a timeseries for a specific request, first you need to mark it as a key request and then choose the right timeseries ID, for the response time e.g:


com.dynatrace.builtin:servicemethod.responsetime


The API call then could be:

..../api/v1/timeseries?relativeTime=day&aggregationType=MEDIAN&timeseriesId=com.dynatrace.builtin:servicemethod.responsetime

This will give you the response time for all key requests, e.g.:

{
"result": {
"dataPoints": {
"SERVICE_METHOD-899CCEBC08736F7A": [
[
1517512200000,
2613281.5
],
[
1517512800000,
null
]
]
},
"timeseriesId": "com.dynatrace.builtin:servicemethod.responsetime",
"unit": "MicroSecond (µs)",
"entities": {
"SERVICE_METHOD-899CCEBC08736F7A": " /dologin.action"
},
"resolutionInMillisUTC": 600000,
"aggregationType": "MEDIAN"
}
}

Each entry in the first array is a timestamp and the corresponding response time (or null if the request did not occur in that timeframe).

You can then filter for specific entities with the entity parameter.

If I had multiple request in the previous example and wanted to filter on the /dologin.action request I could do so with:

..../api/v1/timeseries?relativeTime=day&aggregationType=MEDIAN&timeseriesId=com.dynatrace.builtin:servicemethod.responsetime&entity=SERVICE_METHOD-899CCEBC08736F7A

You can also find the entity parameter in the URL if you open any entity, be it request, application, host, service, ....

Hope this gets you going, if you have any further question, just shoot them over!

hayden_miedema
Inactive

There is no way to get a list of transactions serviced by a particular service at this time through the API, though. If you are looking for metrics then the timeseries API is what you need, but these are things like response time, failure rate, 4xx/5xx errors, etc. Unfortunately, no method to just pull a list of transactions for a given time.

Hayden

vladislav_samoy
Inactive

Hi!

Is there any way to get list of transactions with metrics right now?