Enterprise plugins, along with support and assistance from the core team behind Grafana, are available with Grafana Enterprise.
Please sign up or log in to get started.
Sign UpDynatrace Dashboard Metric Selection
Dynatrace Grafana Datasource
Datasource for https://www.dynatrace.com/
Table of Contents
Features
Core Features
- Template Variables
- Metric Names
- Single selection only (no multi-select)
- Ad-Hoc Filters
- Annotations
- Not currently supported
- Aliasing
- Metric Names
- Aggregation
- Display Name
- Host
- Description
- Alerting
- Full alerting support
Dynatrace Specific Features
- Dynatrace API Support
- Currently, only v2 metric APIs are supported
- Custom Metrics
Installation
Grafana CLI
grafana-cli plugins install grafana-dynatrace-datasource
Docker
docker run -d -p 3000:3000 --name grafana -e "GF_INSTALL_PLUGINS=grafana-dynatrace-datasource" grafana/grafana
Manual Install
Download the .zip
archive from the plugin downloads page and extract it to the grafana plugins directory.
Configuration
- After installing the Dynatrace plugin, navigate to
Settings/Data Sources
within the Grafana UI and clickAdd data source
. - On the
Add data source
page, filter forDynatrace
and select the Dynatrace plugin. - Configuring a Dynatrace datasource requires 4 parameters:
Name
- What name you would like to apply to the Dynatrace datasource (default: Dynatrace).Dynatrace API Type
- What type of Dynatrace instance you're connecting to. This is eitherSaaS
orManaged Cluster
.Environment ID
- The environment ID that you see when logging into Dynatrace. It will be the first portion of the URL. In the example ofyfc55578.live.dynatrace.com
, your environment ID would beyfc55578
.Dynatrace API Token
- This is a token generated per Dynatrace environment. To create a token, navigate to your Dynatrace environment dashboard, click settings on the left hand navigation panel. Once on the settings page, navigate to the Integration section in the left hand navigation and select Dynatrace API. From the Dynatrace API page, copy and existing token or generate a new token by clicking "Generate token".
- Once all of the configuration values have been set, click Save & Test to validate the configuration and save your changes.
Your completed datasource configuration should look similar to this:
Usage
Adding a query template variable
- To create a new Dynatrace template variable for a dashboard, click the settings cog on the top right portion of the dashboard.
- Click
Variables
in the left hand panel. - Click
New
in the top right corner of the variables page. - Enter a
Name
and aLabel
for the template variable you'd like to create.Name
is the value you will use inside of queries to reference the template variable.Label
is a human friendly name to display for the template variable on the dashboard select panel. - Select the type
Query
for the type field (it should be selected by default). - Under the
Query Options
heading, selectDynatrace
in theData source
drop down. - Select a type in the
Query type
drop down (e.g...Metric Names
). - If you would like to filter out any of the returned values from your query, enter a regular expression in the
Regex
input field. - Apply any sorting preferences you might have by choosing a sort type in the
Sort
drop down. - After verifying the configuration, click
Add
to add the template variable, then clickSave dashboard
on the left hand navigation panel to save your changes.
WARNING
Multi-value
and Include All option
are currently not supported by the Dynatrace plugin.
Your finalized template variable configuration should look similar to this:
If the above steps have been completed correctly, you should see the template variable in the top-left corner of your dashboard panel:
Using Template Variables
After completing the steps to add a new template variable, you're now ready to use the template variable within your dashboard panels to create dynamic visualizations.
- Add a new dashboard panel using the panel+ icon in the top right corner of your dashboard.
- Click the metric drop down inside of the query editor. You should see the template variable
$metric
as an available option to select for the metric field. Select it. - Add any aggregations, filters, or aliases that you would like.
- Save the panel.
You should now be able to cycle through different metric types and have your panel dynamically update!
If things have gone as expected, your dashboard panel should now look like:
Adding an ad-hoc filter
Click the settings cog on the top right portion of the dashboard.
Click
Variables
in the left hand panel.Click
New
in the top right corner of the variables page.Enter a
Name
and aLabel
for the template variable you'd like to create.Name
is the value you will use inside of queries to reference the template variable.Label
is a human friendly name to display for the template variable on the dashboard select panel.Select the type
Ad hoc filters
for the type field.- You will see a message that states
Adhoc filters are applied automatically to all queries that target this datasource
. This is OK. Continue to the next step.
- You will see a message that states
Click
Add
to add the template variable, then clickSave dashboard
on the left hand navigation panel to save your changes.
Unlike normal template variables, ad-hoc filters will apply to any panel on your dashboard that can be filtered by the selected key and value.
In the example below, we have a Dynatrace dashboard with panels representing two different metrics. The top panel is builtin.host.disk.free
and the bottom is builtin.host.cpu.load
. As you can see in the example, the dashboard is dynamically filtered to the host value of ubuntu-s-1vcpu-1gb-nyc1-01
without having to apply it directly in the query.
Using Filters
The Dynatrace plugin will dynamically query the appropriate filters for each metric.
To add a filter, click the +
next to the Filters
label on the Dynatrace query editor, select which field you would like to filter on, select the operator you would like to use, and select a value to filter by.
The Dynatrace plugin allows you to create Filter Groups
that can be joined together to create complex logical comparisons. For most use cases, Filter Groups
aren't required.
Using Aliases
While creating a new query via the query editor, you can hover over the Alias
tooltip to see the aliases that are available along with their corresponding values. There are two different types of aliases you will encounter while using the Dynatrace plugin. The first is a static alias
, these aliases will be available on every query that you build and will start with a lowercase letter. The second is a dynamic alias
, these will change based on the metric you are using in your query and will start with an uppercase letter.
In the example below, using the alias tooltip, we can see that this metric builtin:host.disk.avail
has 5 potential aliases. The first three: $name
, $aggregation
, and $displayName
are static aliases. The last two are $Host
and $Disk
which are dynamic aliases.
The Dynatrace plugin supports five different aliases: Metric Names
, Aggregation
, Display Name
, Host
, and Description
. To use one of these aliases, simply add the alias you would like to use in the text box labeled Alias
on the Dynatrace query editor.
Using Aggregations
The Dynatrace plugin allows you to select which aggregation you would like to use for a specific metric. Click the drop down next to Aggregations
on the Dynatrace query editor to change the aggregation type for your query.
FAQ
Rate Limiting
Querying the API can result in failed queries.
Failed to load resource: the server responded with a status of 429 (Too Many Requests)