Dynatrace

Data SourceENTERPRISE

Dynatrace Datasource
Enterprise

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 Up
  • Dynatrace Dashboard
    Dynatrace Dashboard
  • Metric Selection
    Metric Selection

CircleCI

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

  1. After installing the Dynatrace plugin, navigate to Settings/Data Sources within the Grafana UI and click Add data source.
  2. On the Add data source page, filter for Dynatrace and select the Dynatrace plugin.
  3. 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 either SaaS or Managed 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 of yfc55578.live.dynatrace.com, your environment ID would be yfc55578.
    • 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".
  4. 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:

configuration editor

Usage

Adding a query template variable

  1. To create a new Dynatrace template variable for a dashboard, click the settings cog on the top right portion of the dashboard.
  2. Click Variables in the left hand panel.
  3. Click New in the top right corner of the variables page.
  4. Enter a Name and a Label 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.
  5. Select the type Query for the type field (it should be selected by default).
  6. Under the Query Options heading, select Dynatrace in the Data source drop down.
  7. Select a type in the Query type drop down (e.g... Metric Names).
  8. If you would like to filter out any of the returned values from your query, enter a regular expression in the Regex input field.
  9. Apply any sorting preferences you might have by choosing a sort type in the Sort drop down.
  10. After verifying the configuration, click Add to add the template variable, then click Save 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:

add template var

If the above steps have been completed correctly, you should see the template variable in the top-left corner of your dashboard panel:

template variable success

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.

  1. Add a new dashboard panel using the panel+ icon in the top right corner of your dashboard.
  2. 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.
  3. Add any aggregations, filters, or aliases that you would like.
  4. 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:

panel using template var

Adding an ad-hoc filter

  1. Click the settings cog on the top right portion of the dashboard.

  2. Click Variables in the left hand panel.

  3. Click New in the top right corner of the variables page.

  4. Enter a Name and a Label 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.

  5. 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.
  6. Click Add to add the template variable, then click Save 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.

ad-hoc-filters

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.

dynatrace filters

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.

alias tooltip

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.

dynatrace aliases

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)
Sign up Now

Version

Includes:
  • System Overview

Dependencies:
  • Grafana 7.0.x