Dynatrace Grafana data source
The Dynatrace data source plugin allows you to query and visualize Dynatrace metrics from within Grafana.
The Dynatrace data source has the following requirements:
- Grafana Enterprise with a valid license
- Grafana user with a server admin or org admin role
- A Dynatrace account
- Template variables cannot be multi-select; only single selection is supported.
- Only v2 metric APIs are supported.
Install the Dynatrace data source plugin
To install the data source, refer to Installation.
Get an API key from Dynatrace
To set up an API token, refer to Dynatrace API - Tokens and authentication.
entities.read permissions for your API token.
Configure the data source in Grafana
Add a data source by filling in the following fields:
- A name for this particular Dynatrace data source.
- Dynatrace API Type
Managed Clusterdepending on the instance type you are connecting to.
- Environment ID
- The first portion of the URL after logging in. e.g.
yfc55578.live.dynatrace.com, your environment ID would be
- Dynatrace API token
- An API token generated with
entities.readpermissions. Refer to Get an API key and application key from Dynatrace.
Configure the data source with provisioning
It is possible to configure data sources using config files with Grafana’s provisioning system. To read more about how configuration works, including all the settings that you can set for data sources, refer to Provisioning Grafana.
apiVersion: 1 datasources: - name: Dynatrace type: grafana-dynatrace-datasource access: proxy editable: true enabled: true jsonData: apiType: saas environmentId: environment Id secureJsonData: apiToken: API token version: 1
Query the data source
The query editor allows you to query Dynatrace metrics and problems.
The query type can be
Metric query type
- Select the metric that you want to see. To get the metric list from Dynatrace again, click the Refresh button.
- Select the aggregation you want to use for a specific metric. Click the aggregations value to change the aggregation type or click the + button to add another aggregation.
- You can select transformations in the query editor. Afterwards, enter a number of parameters into the selected transformation. Currently, only the merge transformation is supported. For information about the merge transforms, refer to Merge transformation.
- The Dynatrace plugin dynamically queries the appropriate filters for each metric.
- To add a filter, click the + symbol next to the
Filterslabel on the Dynatrace query editor, select which field you would like to filter on, select the operator you would like to use, and then select a value to filter by.
- The Dynatrace plugin allows you to create
Filter Groupsthat you can join together to create complex logical comparisons. For most use cases,
Filter Groupsare not required.
- When creating filters with
Tags, regardless of the conjunction selected, Dynatrace will always use
AND. Dynatrace does not support
- There are two different types of aliases you will encounter while using the Dynatrace plugin. The first is a
static alias. An alias of this type is available on every query that you build, and the name of the alias starts with a lowercase letter. The second is a
dynamic alias, which changes based on the metric that you are using in your query, and the name of the alias starts with an uppercase letter.
- The Dynatrace plugin supports several different aliases:
|$displayName||Reported error count (by key user action, OS) [mobile, custom]|
Problems query type
- Problem Query Type
- Select a problem query type. Currently, only the feed problem query type is supported. For information about the feed problem query type, refer to Problems API - GET feed.
- Status Filter
- Filter the result problems by the status.
- Impact Filter
- Filter the result problems by the impact level.
- Severity Filter
- Filter the result problems by the severity level.
- Expand Details
- Include related events to the response, if set.
Templates and variables
To add a new Dynatrace query variable, refer to Add a query variable. Use your Dynatrace data source as your data source for the following available queries:
- Query type
- Select a query type. The query type associate some data with some key or descriptor.
|Metric names||Returns a list of all metric names|
|Filter keys||Returns a list of all the possible dimensions (e.g. Hostname) that can be used to filter|
|Filter values for key||Returns a list of filtered values by a key name or a key name template variable|
|Problem status options||Returns a list of all problem statuses|
|Problem impact options||Returns a list of all problem impacted areas|
|Problem severity options||Returns a list of all problem severity types|
- (Optional) Filter out any of the returned values from your query with a regular expression
Include All option are currently not supported by the Dynatrace plugin.
After creating a variable, you can find it in the
Metric drop-down menu. For more information about variables, refer to Templates and variables.
Import a dashboard for Dynatrace
To import a dashboard, refer to Importing a dashboard. Imported dashboards can be found in Configuration > Data Sources > select your Dynatrace data source > select the Dashboards tab to see available pre-made dashboards.