Plugins 〉Datadog

Data Source
grafana
Enterprise

Datadog

  • Overview
  • Installation
  • Change log
  • Related content

Grafana Datadog Datasource Plugin

The Grafana Datadog Datasource allows you to visualize metrics from the Datadog monitoring service in Grafana.

Usage

Caching

For large dashboards, that make lots of queries it is possible to be rate limited by the Datadog API (reach the maximum number of API calls per hour that the Datadog API allows). The caching feature caches unique queries for 60 seconds. This interval can be changed to be longer or shorter on the config page.

Query Editor

Metrics

query editor

It's easy - select aggregation and metric. If you want to filter result, select one or more tags.

The Datadog datasource supports all of the advanced functions that the Datadog query editor. Select it from dropdown and arrange by clicking function name. query editor

Service Level Objectives

Alias by field usage possibilities:

  • Type in the alias into the "Alias by" field.
  • Use scoped variables:
  • Metrics
    • $__metric = replaced with metric name
    • $__display_name = replaced with metric name
    • $__expression = replaced with full metric expression
    • $__aggr = replaced with metric aggregation function (e.g. avg, max, min, sum)
    • $__scope = replaced with metric scope (e.g. region, site, env, host)
  • SLOs (Service Level Objectives)
    • $__name = Replaced with the name (same as what is selected in the Objective dropdown)
      • $__aggr = Replaced with the aggregation
      • $__metric = Replaced with the metric name
      • $__scope = Replaced with the scope
    • $__numerator = Replaced with the metric used as the numerator in the SLO calculation
    • $__denominator = Replaced with the metric used as the denominator in the SLO calculation

scoped_vars

  • Use regular expressions:

    • Type in your regular expression into "Alias RegExp" field in /you regexp here/flags format.

    • If "Alias by" field is empty, RegExp results will be joined using ,.<br> Example with metric expression = avg:system.load.5{*} :<br> "Alias by" field input: ""<br> "Alias RegExp" field input: avg:(.+)\.(\d)<br> Result: system.load, 5<br>

    • Use $<group_number> variables in "Alias by" field.<br> Example with metric expression = avg:system.load.5{*} :<br> "Alias by" field input: $1: $2 seconds<br> "Alias RegExp" field input: avg:(.+)\.(\d)<br> Result: system.load: 5 seconds<br>

    • Use $0 to get the whole expression.<br> Example with metric expression = datadog.dogstatsd.packet.count{*} :<br> "Alias by" field input: Expression: $0<br> "Alias RegExp" field input: DOGstatsd\.(.*)\.(.*){\*}/i<br> Result: Expression: datadog.dogstatsd.packet.count{*}<br>

    Note: you'll get an error using nonexistent group number.

sloquery

Metric arithmetic

To use metric arithmetic set Query type to Arithmetic. Link to desired metric by using # sign. For example, #A * 2 will double the result of query A. Arithmetic between two metrics works in the same way - add queries which results you want to use for the calculation and then link to these metrics in the third query, like #A / #B.

Monitor

Status of Datadog monitors can be listed using Monitor feature of the plugin.

monitors list

Following options are available

  • Count by Status/Type/Tags/ Mute status
  • Monitors list

Count by : This will show the count of monitors by status/type/tag/mute status.

Monitors list : This will list all the monitors and their corresponding states and other related details.

Query : In all the above options, you can optionally specify the filter query. If the filter query is specified, count/list will return only the monitors matching the query.

Refer https://docs.datadoghq.com/monitors/manage_monitor/#query for more help related to monitor queries.

Example queries :

  • status:(alert OR ok OR "no data" OR warn) will list the monitors with one of status of alert/ok/no data/warn
  • status:(alert OR warn) type:metric "cassandra" will list the metric monitors with alert or warn status and also related to "cassandra"
  • id:(7254197 OR 240232) will only shows the status of monitors with id 7254197/240232

Note: For the monitors list option, Due the API limits only the top N monitors specified by items per page setting will be retrieved and showed.

Annotations

annotations editor

An annotation is an event that is overlaid on top of graphs - an example of an event is a deployment or an outage. With this datasource, you can fetch events from Datadog and overlay them on graphs in Grafana.

Templating

There are a few options for getting values of template variable - metrics and tags. To fetch the list of available metrics specify * in the Query field.

To return all tags use the value: tag or scope.

To return tags for a specified tag group then use one of the following default category values:

  • host
  • device
  • env
  • region
  • site
  • status
  • version

For custom tag groups, then just enter the tag group name e.g. if your custom tag group name is subscription_name then enter that in the Query field.

Filter results by using the Regex field. Multi-value variables are supported when using tags - multiple selected tag values will be converted into a comma separated list of tags.

Ad-hoc filters

There is a new special type of template variable in Grafana called Ad-hoc filters. This variable will apply to all the Datadog queries in a dashboard. This allows using it like a quick filter. An ad-hoc variable for Datadog fetches all the key-value pairs from tags, for example, region:east, region:west, and uses them as query tags. To create this variable, select the Ad-hoc filters type and choose your Datadog datasource. You can set any name for this variable.

Dashboards included

  • Monitors Explorer - Dashboard to explore and query the list of datadog monitors.

For more information, visit the docs on plugin installation.

Change Log

[2.3.1] - 2021-4-12

  • Chore: Update SDK

[2.3.0] 09-Apr-2021

Features

  • #229: Monitor API
  • #229: Default Dashboard: Monitors Explorer

[2.2.2] 31-Mar-2021

Fixes

  • #214: Sort hosts by name when looking for tag values
  • #219: Show query error message
  • #222: Fix panic when no hosts are returned

[2.2.1] 01-Mar-2021

Fixes

  • #199: Fix cache settings unmarshal when changed through UI

[2.2.0] 16-Feb-2021

Features

  • #197: Added support for Basic Auth credentials

Enhancements

  • #199: Use a struct to unmarshal settings
  • #191: Fix and enable e2e tests

[2.1.1] 25-Jan-2021

Enhancements

  • #164: Added tests for ad-hoc filters

Fixes

  • #166: Update annotations editor screenshot in README
  • #176: SLO dropdown is not sorted or sortable
  • #177: SLO dropdown typeahead search does not work
  • #185: Annotations editor does not display the query

[2.1.0] 07-Dec-2020

Enhancements

  • #146: Support SLO History endpoint

Fixes

  • #150: AdHoc Filters not working
  • #168: Update to new SDK to support individual plugin licensing
  • #167: Add the ability to ALIAS BY without regex
  • #166: Update plugin documentation
  • #152: Metric name empty when editing query
  • #159: From clause does not show all options
  • #163: Duplicate values in ad-hoc filter drop-downs
  • #166: Documentation page for the plugin is old
  • #164: Can't remove an ad-hoc filter if the request fails

[2.0.4]

Fix

  • Metric Select filtering

[2.0.3]

Added

  • Metric Select Paging and Server side filtering

[2.0.2]

Fix

  • Add check for resource cache limit error and log warning
  • Use map for static cache - client is hitting cache limit

[2.0.1] - 2020-08-19

Fixed

  • Query fails without aggregate selected
  • Hitting cache limit causes call to fail, don't fail and return notice
  • Add setting to adjust cache limit

[2.0.0] - 2020-08-13

Added

  • #103 Add backend datasource to support Alerting
  • #108 Health check
  • Caching to improve performance/reduce hiting rate limits
  • #112 Metrics select - virtual scrolling for large lists
  • #112 Metrics cache and manual refresh
  • #111 Allow setting Datadog URL

Fixed

  • #109 Move credentials to secure json
  • #105 typo in query editor
  • #106 Selecting template variable crashes UI

[1.4.9] - 2020-05-05

  • Conversion to react
  • Support for alternate SaaS endpoints

[1.4.8] - 2020-04-10

  • Add migration for regex

[1.4.7] - 2019-10-23

  • Added regex match and alias by fields to raw query editor
  • Changed default alias to something more useable, being the one returned from datadog.

[1.4.6] - 2019-09-09

  • Add migration for regex

[1.4.5] - 2019-09-06

  • Fix styles for functions in Query Editor

[1.4.4] - 2019-08-26

  • Fix for Query Editor
  • Updated packages
  • Now uses toolkit

[1.4.3] - 2019-05-17

[1.4.0] - 2019-02-15

  • Caching for API queries. Limits calls to Datadog to 1 per minute per unique query
  • Tags. Adds support for all tag groups and fixes a bug that limited the number of tag groups when using ad hoc queries.

[1.3.1] - 2019-01-14

Fixed

  • Error when adding new datasource (proxy error: unsupported protocol scheme) (#54)
  • Metric editor broken if query type is not the one of 'arithmetic' or 'query'

[1.3.0] - 2019-01-10

Added

  • Support arithmetic (#31)

Fixed

  • Show all tags in ad-hoc filter (#52)
  • Fix error while getting tags in ad-hoc filter (Error: this.request is not a function) (#50)

[1.2.0] - 2018-11-29

Added

  • Support template variable for annotations (#38)

Fixed

  • Invalid space aggregator error when no aggregation selected (#42)

[1.1.0] - 2018-10-04

Added

  • Metric arithmetic using a number (multiply a metric value by 100 for example) (#33)
  • Adds three Datadog functions (#32):
    • Arithmetic -> Log10 function
    • Smoothing -> Auto Smoother
    • Regression -> Trend Line

[1.1.0] - 2018-09-19

Added

  • Improved Legend Formatting - The Alias By field in the Query Editor now allows you to specify which part of the metric name you want to use. It also now supports regexp for full control over the legend item/alias format.