Dynatrace data source for Grafana
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: <api type> environmentId: <environment id> secureJsonData: apiToken: API token version: 1
|API Type||Description||Valid values for environmentId|
||This is the
||This is the host name of your on-prem dynatrace instance (ex:
||Enter the full url of your dynatrace instance
apiVersion: 1 datasources: - name: Dynatrace type: grafana-dynatrace-datasource access: proxy editable: true enabled: true jsonData: apiType: managed environmentId: <hostname> domain: <domain> secureJsonData: apiToken: API token version: 1
In the esample above for a managed on-prem installation, the url to your dynatrace instance will look like
Query the data source
The query editor allows you to query Dynatrace metrics and problems.
The query type can be on of the following:
Direct API Access
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.
USQL Query Type
- Add deeplink fields
- Add additional deep linked fields into the query
- Run Query
- Click to run the query. This will have the same effect as clicking refresh
- USQL Query
- Enter your USQL query in the editor below. Note that hitting Alt+S/Cmd+S will also save and run the query.
Direct API Access Query Type
- API Endpoint
- Refers to the portion of the URL that starts with the version of the API call you wish to make. (ex:
- Define fields to parse
- Unselected (default): Use the standard parsing, which is to return every field as it’s own column. The column name refers to the JSON Path to the associated data in the column.
- Selected: Define a custom parsing method, as outlined below.
Define a custom parsing method
- The JSON Path to the data to reference
- The type assigned to the data. Timestamp fields are not autodetected, and must be specifically typed to be parsed as a timestamp.
- Use the text entered as the data column title, rather than the default title
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|
- Filter values for key
- Retrieving these values requires the display name of the associated Filter key. Example: To retrieve values for the filter key “Host Group”, rather than using the type “Host_Group”, the expected input is the display name which would be “Host Group”
Generally, the display name is always the type without “_”, as in the above example. However, this is not always the case. When in doubt, use
Direct API Accessto look at the display name
- (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.
Get the most out of the plugin
Related Plugins resources
Unify your data with Grafana plugins: Splunk, MongoDB, Datadog, and more
Show how Grafana can be used to take data from multiple different sources and unify it, without disrupting the investments that are working today.
Grafana plugins demo: Github, Gitlab, JIRA, ServiceNow, and more
In this webinar, we want to show you how to use Grafana to unlock these insights and have better visibility into the performance of your software development team.
All about Grafana plugins: Visualizing disparate data sources in one place
Grafana Enterprise plugins are integrations with other commercial monitoring tools (such as Datadog, Splunk, New Relic, ServiceNow, Oracle, and Dynatrace) that are created, maintained, and supported by the Grafana Labs team.