Dynatrace API enables pull of real-time data

Dynatrace collects and evaluates a tremendous amount of data related to your monitored environment. The data include many important metrics that span all the way across datacenters and all the way down to individual service- and application methods. The new Dynatrace API enables your developers to pull real-time data directly from Dynatrace.

Although we strive to offer the right metric chart for every case you might encounter, and allow you to build customized dashboards, you may still face a requirement to integrate Dynatrace data with, for example, your intranet status indicators or third-party reporting tools. So that we can offer you convenient and flexible access to all collected data, Dynatrace now offers an HTTP-based API. Using token-authorized HTTP GET and POST requests, any client technology can now be used to read JSON-encoded time series data directly from Dynatrace. All your developers need to do is create an access key and use the Dynatrace HTTP service endpoints to query the demanded time series. Multiple API keys can be created for different purposes.

The following example shows how to use the Dynatrace API to fetch the response time time series for an application.

Create an access key going to Settings > Integration > API as shown below:

Dynatrace API access key

Use the generated key AIDsuFvnQwyZUe7j95Fur either as the HTTP parameter or as the HTTP authorization header to create your first API query. For details, have a look at the Dynatrace API Documentation.

This example query requests the user action duration time of our sample EasyTravel application over the last hour. If you’d like to test this example in your own environment, replace the bold parts of the request (environment ID, API key and your application ID) with your own values.

https://umsaywsjuo.live.ruxit.com/api/v1/timeseries/?Api-Token=AIDsuFvnQwyZUe7j95Fur&relativeTime=hour&entity=APPLICATION-8DA6B5708620D472&aggregationType=AVG&timeseriesId=com.ruxit.builtin:app.useractionduration

The example API call returns a timeseries of data points representing the action duration time for the requested period of time. A part of the JSON result is shown in the following screenshot. The result also contains meta information for the data points such as the unit, aggregation, and time resolution for the returned values.

result

By writing some lines of JavaScript that use the Google charts library to visualize timeseries data, this JSON result can be rendered as shown below:

Action duration chart

Wolfgang is a Technical Product Manager at Dynatrace. He has a long record of research in software analytics and mobile computing. At Dynatrace, he's responsible for baseline calculation and event correlation in performance analytics. He also drives the topic of mobile app monitoring.