<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>OpenTSDB data source on Grafana Labs</title><link>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/</link><description>Recent content in OpenTSDB data source on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v12.4/datasources/opentsdb/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure the OpenTSDB data source</title><link>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/configure/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/configure/</guid><content><![CDATA[&lt;h1 id=&#34;configure-the-opentsdb-data-source&#34;&gt;Configure the OpenTSDB data source&lt;/h1&gt;
&lt;p&gt;This document explains how to configure the OpenTSDB data source in Grafana.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;Before configuring the OpenTSDB data source, ensure you have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Grafana permissions:&lt;/strong&gt; Organization administrator role to add data sources.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OpenTSDB instance:&lt;/strong&gt; A running OpenTSDB server (version 2.1 or later recommended).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Network access:&lt;/strong&gt; The Grafana server can reach the OpenTSDB HTTP API endpoint (default port 4242).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Metrics in OpenTSDB:&lt;/strong&gt; For autocomplete to work, metrics must exist in your OpenTSDB database.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;add-the-data-source&#34;&gt;Add the data source&lt;/h2&gt;
&lt;p&gt;To add and configure the OpenTSDB data source:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Connections&lt;/strong&gt; in the left-side menu.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add new connection&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Type &lt;code&gt;OpenTSDB&lt;/code&gt; in the search bar.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;OpenTSDB&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add new data source&lt;/strong&gt; in the upper right.&lt;/li&gt;
&lt;li&gt;Configure the data source settings as described in the following sections.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configuration-options&#34;&gt;Configuration options&lt;/h2&gt;
&lt;p&gt;The following table describes the available configuration options:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Setting&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The data source name. This is how you refer to the data source in panels and queries.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Default&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggle to make this the default data source for new panels.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;URL&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The HTTP protocol, IP address, and port of your OpenTSDB server. The default port is &lt;code&gt;4242&lt;/code&gt;. Example: &lt;code&gt;http://localhost:4242&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Allowed cookies&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Cookies to forward to the data source. Use this when your OpenTSDB server requires specific cookies for authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Timeout&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;HTTP request timeout in seconds. Increase this value for slow networks or complex queries.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;auth-settings&#34;&gt;Auth settings&lt;/h2&gt;
&lt;p&gt;Configure authentication if your OpenTSDB server requires it:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Setting&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Basic auth&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enable to authenticate with a username and password. When enabled, enter the username and password in the fields that appear.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;With Credentials&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enable to send cookies or auth headers with cross-site requests. Use this when OpenTSDB is on a different domain and requires credentials.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;TLS Client Authentication&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enable to use client certificates for authentication. Requires configuring client certificate and key.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Skip TLS Verify&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enable to skip verification of the OpenTSDB server&amp;rsquo;s TLS certificate. Only use this in development environments.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Forward OAuth Identity&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enable to forward the user&amp;rsquo;s OAuth token to the data source. Useful when OpenTSDB is behind an OAuth-protected proxy.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Custom HTTP Headers&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Add custom headers to all requests sent to OpenTSDB. Useful for API keys or custom authentication schemes.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;opentsdb-settings&#34;&gt;OpenTSDB settings&lt;/h2&gt;
&lt;p&gt;Configure these settings based on your OpenTSDB server version and configuration:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Setting&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Version&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Select your OpenTSDB version. This affects available query features. Refer to the following section for version-specific features.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Resolution&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The resolution of your metric data. Select &lt;code&gt;second&lt;/code&gt; for second-precision timestamps or &lt;code&gt;millisecond&lt;/code&gt; for millisecond-precision timestamps.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Lookup limit&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Maximum number of results returned by suggest and lookup API calls. Default is &lt;code&gt;1000&lt;/code&gt;. Increase this if you have many metrics or tag values.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;version-specific-features&#34;&gt;Version-specific features&lt;/h3&gt;
&lt;p&gt;The version setting enables different query features in Grafana:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Version&lt;/th&gt;
              &lt;th&gt;Available features&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;&amp;lt;=2.1&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Basic queries with tags. Uses legacy tag-based filtering.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;==2.2&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Adds filter support (literal_or, wildcard, regexp, and more). Filters replace tags for more flexible queries.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;==2.3&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Adds explicit tags support for rate calculations and additional filter types.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;==2.4&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Adds fill policy support for downsampling (none, null, zero, nan). Enables &lt;code&gt;arrays=true&lt;/code&gt; for alerting compatibility.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Select the version that matches your OpenTSDB server. If you&amp;rsquo;re unsure, check your OpenTSDB version with the &lt;code&gt;/api/version&lt;/code&gt; endpoint.&lt;/p&gt;
&lt;h2 id=&#34;verify-the-connection&#34;&gt;Verify the connection&lt;/h2&gt;
&lt;p&gt;Click &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt; to verify that Grafana can connect to your OpenTSDB server. A successful test confirms that the URL is correct and the server is responding.&lt;/p&gt;
&lt;p&gt;If the test fails, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/troubleshooting/&#34;&gt;Troubleshooting&lt;/a&gt; for common issues and solutions.&lt;/p&gt;
&lt;h2 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h2&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of the Grafana provisioning system. For more information about provisioning, and for available configuration options, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;yaml-example&#34;&gt;YAML example&lt;/h3&gt;
&lt;p&gt;The following example provisions an OpenTSDB data source:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: 1

datasources:
  - name: OpenTSDB
    type: opentsdb
    access: proxy
    url: http://localhost:4242
    jsonData:
      # OpenTSDB version: 1 = &amp;lt;=2.1, 2 = 2.2, 3 = 2.3, 4 = 2.4
      tsdbVersion: 3
      # Resolution: 1 = second, 2 = millisecond
      tsdbResolution: 1
      # Maximum results for suggest/lookup API calls
      lookupLimit: 1000&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;yaml-example-with-basic-authentication&#34;&gt;YAML example with basic authentication&lt;/h3&gt;
&lt;p&gt;The following example provisions an OpenTSDB data source with basic authentication:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: 1

datasources:
  - name: OpenTSDB
    type: opentsdb
    access: proxy
    url: http://localhost:4242
    basicAuth: true
    basicAuthUser: &amp;lt;USERNAME&amp;gt;
    jsonData:
      tsdbVersion: 3
      tsdbResolution: 1
      lookupLimit: 1000
    secureJsonData:
      basicAuthPassword: &amp;lt;PASSWORD&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;yaml-example-with-custom-headers&#34;&gt;YAML example with custom headers&lt;/h3&gt;
&lt;p&gt;The following example provisions an OpenTSDB data source with custom HTTP headers:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;apiVersion: 1

datasources:
  - name: OpenTSDB
    type: opentsdb
    access: proxy
    url: http://localhost:4242
    jsonData:
      tsdbVersion: 3
      tsdbResolution: 1
      lookupLimit: 1000
      httpHeaderName1: X-Custom-Header
    secureJsonData:
      httpHeaderValue1: &amp;lt;HEADER_VALUE&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The following table describes the available fields:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;basicAuth&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;boolean&lt;/td&gt;
              &lt;td&gt;Enable basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;basicAuthUser&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;Username for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;jsonData.tsdbVersion&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;OpenTSDB version: &lt;code&gt;1&lt;/code&gt; (&amp;lt;=2.1), &lt;code&gt;2&lt;/code&gt; (2.2), &lt;code&gt;3&lt;/code&gt; (2.3), &lt;code&gt;4&lt;/code&gt; (2.4).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;jsonData.tsdbResolution&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;Timestamp resolution: &lt;code&gt;1&lt;/code&gt; (second), &lt;code&gt;2&lt;/code&gt; (millisecond).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;jsonData.lookupLimit&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;number&lt;/td&gt;
              &lt;td&gt;Maximum results for suggest and lookup API calls. Default: &lt;code&gt;1000&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;jsonData.httpHeaderName1&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;Name of a custom HTTP header. Use incrementing numbers for multiple headers.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;secureJsonData.basicAuthPassword&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;Password for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;secureJsonData.httpHeaderValue1&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;string&lt;/td&gt;
              &lt;td&gt;Value for the custom HTTP header.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;provision-with-terraform&#34;&gt;Provision with Terraform&lt;/h2&gt;
&lt;p&gt;You can provision the OpenTSDB data source using &lt;a href=&#34;https://www.terraform.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Terraform&lt;/a&gt; with the &lt;a href=&#34;https://registry.terraform.io/providers/grafana/grafana/latest/docs&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Terraform provider&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For more information about provisioning resources with Terraform, refer to the &lt;a href=&#34;/docs/grafana-cloud/developer-resources/infrastructure-as-code/terraform/&#34;&gt;Grafana as code using Terraform&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h3 id=&#34;terraform-example&#34;&gt;Terraform example&lt;/h3&gt;
&lt;p&gt;The following example provisions an OpenTSDB data source:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;hcl&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-hcl&#34;&gt;terraform {
  required_providers {
    grafana = {
      source  = &amp;#34;grafana/grafana&amp;#34;
      version = &amp;#34;&amp;gt;= 2.0.0&amp;#34;
    }
  }
}

provider &amp;#34;grafana&amp;#34; {
  url  = &amp;#34;&amp;lt;YOUR_GRAFANA_URL&amp;gt;&amp;#34;
  auth = &amp;#34;&amp;lt;YOUR_SERVICE_ACCOUNT_TOKEN&amp;gt;&amp;#34;
}

resource &amp;#34;grafana_data_source&amp;#34; &amp;#34;opentsdb&amp;#34; {
  type = &amp;#34;opentsdb&amp;#34;
  name = &amp;#34;OpenTSDB&amp;#34;
  url  = &amp;#34;http://localhost:4242&amp;#34;

  json_data_encoded = jsonencode({
    # OpenTSDB version: 1 = &amp;lt;=2.1, 2 = 2.2, 3 = 2.3, 4 = 2.4
    tsdbVersion = 3
    # Resolution: 1 = second, 2 = millisecond
    tsdbResolution = 1
    # Maximum results for suggest/lookup API calls
    lookupLimit = 1000
  })
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;terraform-example-with-basic-authentication&#34;&gt;Terraform example with basic authentication&lt;/h3&gt;
&lt;p&gt;The following example provisions an OpenTSDB data source with basic authentication:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;hcl&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-hcl&#34;&gt;resource &amp;#34;grafana_data_source&amp;#34; &amp;#34;opentsdb_auth&amp;#34; {
  type                = &amp;#34;opentsdb&amp;#34;
  name                = &amp;#34;OpenTSDB&amp;#34;
  url                 = &amp;#34;http://localhost:4242&amp;#34;
  basic_auth_enabled  = true
  basic_auth_username = &amp;#34;&amp;lt;USERNAME&amp;gt;&amp;#34;

  json_data_encoded = jsonencode({
    tsdbVersion    = 3
    tsdbResolution = 1
    lookupLimit    = 1000
  })

  secure_json_data_encoded = jsonencode({
    basicAuthPassword = &amp;#34;&amp;lt;PASSWORD&amp;gt;&amp;#34;
  })
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Replace the following placeholders:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;YOUR_GRAFANA_URL&amp;gt;&lt;/code&gt;&lt;/em&gt;: Your Grafana instance URL (for example, &lt;code&gt;https://your-org.grafana.net&lt;/code&gt; for Grafana Cloud)&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;YOUR_SERVICE_ACCOUNT_TOKEN&amp;gt;&lt;/code&gt;&lt;/em&gt;: A service account token with data source permissions&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;USERNAME&amp;gt;&lt;/code&gt;&lt;/em&gt;: The username for basic authentication&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;code&gt;&amp;lt;PASSWORD&amp;gt;&lt;/code&gt;&lt;/em&gt;: The password for basic authentication&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;p&gt;Now that you&amp;rsquo;ve configured OpenTSDB, you can:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/query-editor/&#34;&gt;Query OpenTSDB data&lt;/a&gt; to build dashboards and visualizations&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/template-variables/&#34;&gt;Use template variables&lt;/a&gt; to create dynamic, reusable dashboards&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/annotations/&#34;&gt;Add annotations&lt;/a&gt; to overlay events on your graphs&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/alerting/&#34;&gt;Set up alerting&lt;/a&gt; to get notified when metrics cross thresholds&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/troubleshooting/&#34;&gt;Troubleshoot issues&lt;/a&gt; if you encounter problems&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="configure-the-opentsdb-data-source">Configure the OpenTSDB data source&lt;/h1>
&lt;p>This document explains how to configure the OpenTSDB data source in Grafana.&lt;/p>
&lt;h2 id="before-you-begin">Before you begin&lt;/h2>
&lt;p>Before configuring the OpenTSDB data source, ensure you have:&lt;/p></description></item><item><title>OpenTSDB query editor</title><link>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/query-editor/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/query-editor/</guid><content><![CDATA[&lt;h1 id=&#34;opentsdb-query-editor&#34;&gt;OpenTSDB query editor&lt;/h1&gt;
&lt;p&gt;The query editor allows you to build OpenTSDB queries visually. The available options depend on the OpenTSDB version you configured for the data source.&lt;/p&gt;
&lt;h2 id=&#34;access-the-query-editor&#34;&gt;Access the query editor&lt;/h2&gt;
&lt;p&gt;The OpenTSDB query editor is located on the 
    &lt;a href=&#34;/docs/grafana/v12.4/explore/&#34;&gt;Explore&lt;/a&gt; page. You can also access the OpenTSDB query editor from a dashboard panel. Click the ellipsis in the upper right of the panel and select &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&#34;create-a-query&#34;&gt;Create a query&lt;/h2&gt;
&lt;p&gt;To create a query:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the &lt;strong&gt;OpenTSDB&lt;/strong&gt; data source in a panel.&lt;/li&gt;
&lt;li&gt;Configure the query using the sections described in the following documentation.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;metric-section&#34;&gt;Metric section&lt;/h2&gt;
&lt;p&gt;The Metric section contains the core query configuration:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Metric&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The metric name to query. Start typing to see autocomplete suggestions from your OpenTSDB server.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Aggregator&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The aggregation function to combine multiple time series. Default: &lt;code&gt;sum&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Alias&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Custom display name for the series. Use &lt;code&gt;$tag_&amp;lt;tagname&amp;gt;&lt;/code&gt; to include tag values in the alias.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;alias-patterns&#34;&gt;Alias patterns&lt;/h3&gt;
&lt;p&gt;The alias field supports dynamic substitution using tag values. Use the pattern &lt;code&gt;$tag_&amp;lt;tagname&amp;gt;&lt;/code&gt; where &lt;code&gt;&amp;lt;tagname&amp;gt;&lt;/code&gt; is the name of a tag on your metric.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Pattern&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Example output&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$tag_host&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Inserts the value of the &lt;code&gt;host&lt;/code&gt; tag&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;webserver01&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$tag_env&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Inserts the value of the &lt;code&gt;env&lt;/code&gt; tag&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;production&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$tag_host - CPU&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Combines tag value with static text&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;webserver01 - CPU&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$tag_host ($tag_env)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Multiple tag substitutions&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;webserver01 (production)&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;downsample-section&#34;&gt;Downsample section&lt;/h2&gt;
&lt;p&gt;Downsampling reduces the number of data points returned by aggregating values over time intervals. This improves query performance and reduces the amount of data transferred.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Interval&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The time interval for downsampling. Leave blank to use the automatic interval based on the panel&amp;rsquo;s time range and width.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Aggregator&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The aggregation function for downsampling. Default: &lt;code&gt;avg&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Fill&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;(Version 2.2&#43;) The fill policy for missing data points. Default: &lt;code&gt;none&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Disable downsampling&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggle to disable downsampling entirely. Use this when you need raw data points.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;interval-format&#34;&gt;Interval format&lt;/h3&gt;
&lt;p&gt;The interval field accepts time duration strings:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Format&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Example&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;s&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Seconds&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;30s&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;m&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Minutes&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;5m&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;h&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Hours&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;1h&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;d&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Days&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;1d&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;w&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Weeks&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;1w&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;When the interval is left blank, Grafana automatically calculates an appropriate interval based on the panel&amp;rsquo;s time range and pixel width. This ensures optimal data density for visualization.&lt;/p&gt;
&lt;h2 id=&#34;filters-section&#34;&gt;Filters section&lt;/h2&gt;
&lt;p&gt;Filters (available in OpenTSDB 2.2&#43;) provide advanced filtering capabilities that replace the legacy tag-based filtering.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Key&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The tag key to filter on. Select from autocomplete suggestions or type a custom value.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Type&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The filter type. Determines how the filter value is matched. Default: &lt;code&gt;iliteral_or&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The filter value or pattern. Supports autocomplete for tag values.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Group by&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggle to group results by this tag key. When enabled, separate time series are returned for each unique value.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;add-edit-and-remove-filters&#34;&gt;Add, edit, and remove filters&lt;/h3&gt;
&lt;p&gt;To manage filters:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click the &lt;strong&gt;&#43;&lt;/strong&gt; button next to &amp;ldquo;Filters&amp;rdquo; to add a new filter.&lt;/li&gt;
&lt;li&gt;Configure the filter fields (Key, Type, Filter, Group by).&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;add filter&lt;/strong&gt; to apply the filter.&lt;/li&gt;
&lt;li&gt;To edit an existing filter, click the &lt;strong&gt;pencil&lt;/strong&gt; icon next to it.&lt;/li&gt;
&lt;li&gt;To remove a filter, click the &lt;strong&gt;x&lt;/strong&gt; icon next to it.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You can add multiple filters to a single query. All filters are combined with AND logic.&lt;/p&gt;
&lt;h3 id=&#34;filter-types&#34;&gt;Filter types&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Example&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;literal_or&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Matches exact values. Use &lt;code&gt;|&lt;/code&gt; to specify multiple values.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;web01|web02|web03&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;iliteral_or&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Case-insensitive literal match.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;WEB01|web02&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;wildcard&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Matches using &lt;code&gt;*&lt;/code&gt; as a wildcard character.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;web-*-prod&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;iwildcard&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Case-insensitive wildcard match.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;WEB-*&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;regexp&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Matches using regular expressions.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;web-[0-9]&#43;&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;not_literal_or&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Excludes exact values.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;web01|web02&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;not_iliteral_or&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Case-insensitive exclusion.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;TEST|DEV&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;group-by-behavior&#34;&gt;Group by behavior&lt;/h3&gt;
&lt;p&gt;When &lt;strong&gt;Group by&lt;/strong&gt; is enabled for a filter:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Results are split into separate time series for each unique value of the filtered tag.&lt;/li&gt;
&lt;li&gt;Each time series is labeled with its tag value.&lt;/li&gt;
&lt;li&gt;This is useful for comparing values across hosts, environments, or other dimensions.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When &lt;strong&gt;Group by&lt;/strong&gt; is disabled:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;All matching time series are combined using the selected aggregator.&lt;/li&gt;
&lt;li&gt;A single aggregated time series is returned.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;tags-section&#34;&gt;Tags section&lt;/h2&gt;
&lt;p&gt;Tags filter metrics by key-value pairs. This is the legacy filtering method for OpenTSDB versions prior to 2.2.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Key&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The tag key to filter on. Select from autocomplete suggestions.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Value&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The tag value to match. Use &lt;code&gt;*&lt;/code&gt; to match all values for this key.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;add-edit-and-remove-tags&#34;&gt;Add, edit, and remove tags&lt;/h3&gt;
&lt;p&gt;To manage tags:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click the &lt;strong&gt;&#43;&lt;/strong&gt; button next to &amp;ldquo;Tags&amp;rdquo; to add a new tag.&lt;/li&gt;
&lt;li&gt;Select or type a tag key.&lt;/li&gt;
&lt;li&gt;Select or type a tag value (use &lt;code&gt;*&lt;/code&gt; for wildcard).&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;add tag&lt;/strong&gt; to apply the tag filter.&lt;/li&gt;
&lt;li&gt;To edit an existing tag, click the &lt;strong&gt;pencil&lt;/strong&gt; icon next to it.&lt;/li&gt;
&lt;li&gt;To remove a tag, click the &lt;strong&gt;x&lt;/strong&gt; icon next to it.&lt;/li&gt;
&lt;/ol&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;Tags are deprecated in OpenTSDB 2.2 and later. Use Filters instead for more powerful filtering options including wildcards, regular expressions, and exclusion patterns.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;



&lt;div class=&#34;admonition admonition-caution&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Caution&lt;/p&gt;&lt;p&gt;Tags and Filters are mutually exclusive. If you have filters defined, you cannot add tags, and vice versa. The query editor displays a warning if you attempt to use both.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;rate-section&#34;&gt;Rate section&lt;/h2&gt;
&lt;p&gt;The Rate section computes the rate of change, which is essential for counter metrics that continuously increment.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Rate&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggle to enable rate calculation. Computes the per-second rate of change between consecutive values.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Counter&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;(When Rate is enabled) Toggle to indicate the metric is a monotonically increasing counter that may reset.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Counter max&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;(When Counter is enabled) The maximum value before the counter wraps around.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Reset value&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;(When Counter is enabled) The value the counter resets to after wrapping. Default: &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Explicit tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;(Version 2.3&#43;) Toggle to require all specified tags to exist on matching time series.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;when-to-use-rate-calculation&#34;&gt;When to use rate calculation&lt;/h3&gt;
&lt;p&gt;Enable &lt;strong&gt;Rate&lt;/strong&gt; when your metric is a continuously increasing counter, such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Network bytes sent/received&lt;/li&gt;
&lt;li&gt;Request counts&lt;/li&gt;
&lt;li&gt;Error counts&lt;/li&gt;
&lt;li&gt;Disk I/O operations&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The rate calculation converts cumulative values into per-second rates, making the data more meaningful for visualization.&lt;/p&gt;
&lt;h3 id=&#34;counter-settings&#34;&gt;Counter settings&lt;/h3&gt;
&lt;p&gt;Enable &lt;strong&gt;Counter&lt;/strong&gt; when your metric can reset to zero (for example, after a service restart). The counter settings help OpenTSDB calculate correct rates across resets:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Counter max&lt;/strong&gt;: Set this to the maximum value your counter can reach before wrapping. For 64-bit counters, use &lt;code&gt;18446744073709551615&lt;/code&gt;. For 32-bit counters, use &lt;code&gt;4294967295&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reset value&lt;/strong&gt;: The value the counter resets to, typically &lt;code&gt;0&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;explicit-tags&#34;&gt;Explicit tags&lt;/h3&gt;
&lt;p&gt;When &lt;strong&gt;Explicit tags&lt;/strong&gt; is enabled (version 2.3&#43;), OpenTSDB only returns time series that have all the tags specified in your query. This prevents unexpected results when some time series are missing tags that others have.&lt;/p&gt;
&lt;h2 id=&#34;aggregators&#34;&gt;Aggregators&lt;/h2&gt;
&lt;p&gt;The aggregator function combines multiple time series into one. Grafana fetches the list of available aggregators from your OpenTSDB server, so you may see additional aggregators beyond those listed here.&lt;/p&gt;
&lt;h3 id=&#34;common-aggregators&#34;&gt;Common aggregators&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Aggregator&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Use case&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;sum&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Sum all values at each timestamp.&lt;/td&gt;
              &lt;td&gt;Total requests across all servers.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;avg&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Average all values at each timestamp.&lt;/td&gt;
              &lt;td&gt;Average CPU usage across hosts.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;min&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Take the minimum value at each timestamp.&lt;/td&gt;
              &lt;td&gt;Lowest response time.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;max&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Take the maximum value at each timestamp.&lt;/td&gt;
              &lt;td&gt;Peak memory usage.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;dev&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Calculate the standard deviation.&lt;/td&gt;
              &lt;td&gt;Measure variability in response times.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;count&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Count the number of data points.&lt;/td&gt;
              &lt;td&gt;Number of reporting hosts.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;interpolation-aggregators&#34;&gt;Interpolation aggregators&lt;/h3&gt;
&lt;p&gt;These aggregators handle missing data points differently:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Aggregator&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;zimsum&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Sum values, treating missing data as zero.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;mimmin&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Minimum value, ignoring missing (interpolated) data.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;mimmax&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Maximum value, ignoring missing (interpolated) data.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The available aggregators depend on your OpenTSDB server version and configuration. The aggregator dropdown is populated dynamically from the &lt;code&gt;/api/aggregators&lt;/code&gt; endpoint on your OpenTSDB server.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;fill-policies&#34;&gt;Fill policies&lt;/h2&gt;
&lt;p&gt;Fill policies (available in OpenTSDB 2.2&#43;) determine how to handle missing data points during downsampling. This is important when your data has gaps or irregular collection intervals.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Policy&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Use case&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;none&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Don&amp;rsquo;t fill missing values. Gaps remain in the data.&lt;/td&gt;
              &lt;td&gt;Default behavior; preserves data fidelity.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;nan&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Fill missing values with NaN (Not a Number).&lt;/td&gt;
              &lt;td&gt;Useful for calculations that should propagate missing data.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;null&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Fill missing values with null.&lt;/td&gt;
              &lt;td&gt;Visualizations show gaps at null points.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;zero&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Fill missing values with zero.&lt;/td&gt;
              &lt;td&gt;Treat missing data as zero values; useful for counters.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;choose-the-right-fill-policy&#34;&gt;Choose the right fill policy&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;none&lt;/code&gt; (default) when you want to see actual data gaps in your visualizations.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;null&lt;/code&gt; when you want graphs to show breaks at missing data points.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;zero&lt;/code&gt; when missing data should be interpreted as zero (for example, no requests during a period).&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;nan&lt;/code&gt; when you need missing values to propagate through calculations.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;autocomplete-suggestions&#34;&gt;Autocomplete suggestions&lt;/h2&gt;
&lt;p&gt;The query editor provides autocomplete suggestions to help you build queries quickly and accurately.&lt;/p&gt;
&lt;h3 id=&#34;what-autocomplete-provides&#34;&gt;What autocomplete provides&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Source&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Metric&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;/api/suggest?type=metrics&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Suggests metric names as you type.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tag keys&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Previous query results&lt;/td&gt;
              &lt;td&gt;Suggests tag keys based on the selected metric.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tag values&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;/api/suggest?type=tagv&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Suggests tag values as you type.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter keys&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Previous query results&lt;/td&gt;
              &lt;td&gt;Suggests tag keys for filter configuration.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;autocomplete-requirements&#34;&gt;Autocomplete requirements&lt;/h3&gt;
&lt;p&gt;For autocomplete to work:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The OpenTSDB suggest API must be enabled on your server.&lt;/li&gt;
&lt;li&gt;Metrics must exist in your OpenTSDB database.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Lookup limit&lt;/strong&gt; setting in your data source configuration controls the maximum number of suggestions returned.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If autocomplete isn&amp;rsquo;t working, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/troubleshooting/&#34;&gt;Troubleshooting&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-template-variables&#34;&gt;Use template variables&lt;/h2&gt;
&lt;p&gt;You can use template variables in any text field in the query editor. Template variables are replaced with their current values when the query executes.&lt;/p&gt;
&lt;p&gt;Common uses include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Metric field&lt;/strong&gt;: &lt;code&gt;$metric&lt;/code&gt; to dynamically select metrics.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Filter values&lt;/strong&gt;: &lt;code&gt;$host&lt;/code&gt; to filter by a variable-selected host.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tag values&lt;/strong&gt;: &lt;code&gt;$environment&lt;/code&gt; to filter by environment.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information about creating and using template variables, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/template-variables/&#34;&gt;Template variables&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;query-examples&#34;&gt;Query examples&lt;/h2&gt;
&lt;p&gt;The following examples demonstrate common query patterns.&lt;/p&gt;
&lt;h3 id=&#34;basic-metric-query-with-tag-filtering&#34;&gt;Basic metric query with tag filtering&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sys.cpu.user&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;avg&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Tags&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;host=webserver01&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;This query returns the average CPU usage for the host &lt;code&gt;webserver01&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;query-with-wildcard-filter-opentsdb-22&#34;&gt;Query with wildcard filter (OpenTSDB 2.2&#43;)&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;http.requests.count&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sum&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Key&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;host&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Type&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;wildcard&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Value&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;web-*&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Group by&lt;/td&gt;
              &lt;td&gt;enabled&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;This query sums HTTP request counts across all hosts matching &lt;code&gt;web-*&lt;/code&gt; and groups results by host.&lt;/p&gt;
&lt;h3 id=&#34;rate-calculation-for-network-counters&#34;&gt;Rate calculation for network counters&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;net.bytes.received&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sum&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Rate&lt;/td&gt;
              &lt;td&gt;enabled&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Counter&lt;/td&gt;
              &lt;td&gt;enabled&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Counter max&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;18446744073709551615&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;This query calculates the rate of bytes received per second. The counter max is set to the 64-bit unsigned integer maximum to handle counter wraps correctly.&lt;/p&gt;
&lt;h3 id=&#34;using-alias-patterns&#34;&gt;Using alias patterns&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;app.response.time&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;avg&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Tags&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;host=*&lt;/code&gt;, &lt;code&gt;env=production&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Alias&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;$tag_host - Response Time&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;This query uses the alias pattern to create readable legend labels like &lt;code&gt;webserver01 - Response Time&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;downsampling-with-custom-interval&#34;&gt;Downsampling with custom interval&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sys.disk.io.bytes&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sum&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Downsample Interval&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;5m&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Downsample Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;avg&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Fill&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;zero&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;This query downsamples disk I/O data to 5-minute averages, filling gaps with zero values.&lt;/p&gt;
&lt;h3 id=&#34;compare-environments-with-filters&#34;&gt;Compare environments with filters&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;app.errors.count&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sum&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Key&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;env&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Type&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;literal_or&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Value&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;staging|production&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Group by&lt;/td&gt;
              &lt;td&gt;enabled&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;This query shows error counts for both staging and production environments as separate time series for comparison.&lt;/p&gt;
&lt;h3 id=&#34;exclude-specific-hosts&#34;&gt;Exclude specific hosts&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sys.cpu.user&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;avg&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Key&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;host&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Type&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;not_literal_or&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Value&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;test-server|dev-server&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Group by&lt;/td&gt;
              &lt;td&gt;enabled&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;This query shows CPU usage for all hosts except test-server and dev-server.&lt;/p&gt;
&lt;h3 id=&#34;query-with-explicit-tags-version-23&#34;&gt;Query with explicit tags (version 2.3&#43;)&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;app.request.latency&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;avg&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Key&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;host&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Type&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;wildcard&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Value&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;*&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Group by&lt;/td&gt;
              &lt;td&gt;enabled&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Explicit tags&lt;/td&gt;
              &lt;td&gt;enabled&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;This query only returns time series that have the &lt;code&gt;host&lt;/code&gt; tag defined, excluding any time series that are missing this tag.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/template-variables/&#34;&gt;Use template variables&lt;/a&gt; to create dynamic, reusable dashboards.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/alerting/&#34;&gt;Set up alerting&lt;/a&gt; to get notified when metrics cross thresholds.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/troubleshooting/&#34;&gt;Troubleshoot issues&lt;/a&gt; if you encounter problems with queries.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="opentsdb-query-editor">OpenTSDB query editor&lt;/h1>
&lt;p>The query editor allows you to build OpenTSDB queries visually. The available options depend on the OpenTSDB version you configured for the data source.&lt;/p></description></item><item><title>OpenTSDB template variables</title><link>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/template-variables/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/template-variables/</guid><content><![CDATA[&lt;h1 id=&#34;opentsdb-template-variables&#34;&gt;OpenTSDB template variables&lt;/h1&gt;
&lt;p&gt;Instead of hard-coding server, application, and sensor names in your metric queries, you can use template variables. Variables appear as drop-down menus at the top of the dashboard, making it easy to change the data being displayed without editing queries.&lt;/p&gt;
&lt;p&gt;For an introduction to template variables, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/variables/&#34;&gt;Variables&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h2 id=&#34;query-variable&#34;&gt;Query variable&lt;/h2&gt;
&lt;p&gt;The OpenTSDB data source supports query-type template variables that fetch values directly from OpenTSDB. These variables dynamically populate based on data in your OpenTSDB database.&lt;/p&gt;
&lt;h3 id=&#34;supported-query-functions&#34;&gt;Supported query functions&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Query&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;API used&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;metrics(prefix)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns metric names matching the prefix. Use empty parentheses for all metrics.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;/api/suggest?type=metrics&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tag_names(metric)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns tag keys (names) that exist for a specific metric.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;/api/search/lookup&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tag_values(metric, tagkey)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns tag values for a specific metric and tag key.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;/api/search/lookup&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;suggest_tagk(prefix)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns tag keys matching the prefix across all metrics.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;/api/suggest?type=tagk&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;suggest_tagv(prefix)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns tag values matching the prefix across all metrics.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;/api/suggest?type=tagv&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;

&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The &lt;code&gt;tag_names&lt;/code&gt; and &lt;code&gt;tag_values&lt;/code&gt; functions use the OpenTSDB lookup API, which requires metrics to exist in your database. The &lt;code&gt;suggest_tagk&lt;/code&gt; and &lt;code&gt;suggest_tagv&lt;/code&gt; functions use the suggest API, which searches across all metrics.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;create-a-query-variable&#34;&gt;Create a query variable&lt;/h3&gt;
&lt;p&gt;To create a query variable:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Dashboard settings&lt;/strong&gt; &amp;gt; &lt;strong&gt;Variables&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add variable&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter a &lt;strong&gt;Name&lt;/strong&gt; for your variable (for example, &lt;code&gt;host&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Query&lt;/strong&gt; as the variable type.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;OpenTSDB&lt;/strong&gt; data source.&lt;/li&gt;
&lt;li&gt;Enter your query using one of the supported query functions.&lt;/li&gt;
&lt;li&gt;Optionally configure &lt;strong&gt;Multi-value&lt;/strong&gt; to allow selecting multiple values.&lt;/li&gt;
&lt;li&gt;Optionally configure &lt;strong&gt;Include All option&lt;/strong&gt; to add an &amp;ldquo;All&amp;rdquo; option.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Apply&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;query-variable-examples&#34;&gt;Query variable examples&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;List all metrics:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;metrics()&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Returns all metric names in your OpenTSDB database. Useful for creating a metric selector.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List metrics with a prefix:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;metrics(sys.cpu)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Returns metrics starting with &lt;code&gt;sys.cpu&lt;/code&gt;, such as &lt;code&gt;sys.cpu.user&lt;/code&gt;, &lt;code&gt;sys.cpu.system&lt;/code&gt;, &lt;code&gt;sys.cpu.idle&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List tag keys for a metric:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;tag_names(sys.cpu.user)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Returns tag keys like &lt;code&gt;host&lt;/code&gt;, &lt;code&gt;env&lt;/code&gt;, &lt;code&gt;datacenter&lt;/code&gt; that exist on the &lt;code&gt;sys.cpu.user&lt;/code&gt; metric.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List tag values for a metric and tag key:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;tag_values(sys.cpu.user, host)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Returns all host values for the &lt;code&gt;sys.cpu.user&lt;/code&gt; metric, such as &lt;code&gt;webserver01&lt;/code&gt;, &lt;code&gt;webserver02&lt;/code&gt;, &lt;code&gt;dbserver01&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Search for tag keys by prefix:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;suggest_tagk(host)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Returns tag keys matching &lt;code&gt;host&lt;/code&gt; across all metrics, such as &lt;code&gt;host&lt;/code&gt;, &lt;code&gt;hostname&lt;/code&gt;, &lt;code&gt;host_id&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Search for tag values by prefix:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;suggest_tagv(web)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Returns tag values matching &lt;code&gt;web&lt;/code&gt; across all metrics, such as &lt;code&gt;webserver01&lt;/code&gt;, &lt;code&gt;webserver02&lt;/code&gt;, &lt;code&gt;web-prod-01&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If template variables aren&amp;rsquo;t populating in the &lt;strong&gt;Preview of values&lt;/strong&gt; section, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/troubleshooting/&#34;&gt;Troubleshooting&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;nested-template-variables&#34;&gt;Nested template variables&lt;/h2&gt;
&lt;p&gt;You can use one template variable to filter values for another. This creates cascading filters, such as selecting a data center first, then showing only hosts in that data center.&lt;/p&gt;
&lt;h3 id=&#34;filter-syntax&#34;&gt;Filter syntax&lt;/h3&gt;
&lt;p&gt;The &lt;code&gt;tag_values&lt;/code&gt; function accepts additional tag filters after the tag key:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;tag_values(metric, tagkey, tag1=value1, tag2=value2, ...)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Use template variables as filter values to create dynamic dependencies:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;tag_values(metric, tagkey, tag1=$variable1, tag2=$variable2)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;nested-variable-examples&#34;&gt;Nested variable examples&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Query&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tag_values(sys.cpu.user, host, env=$env)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns host values filtered by the selected &lt;code&gt;env&lt;/code&gt; value.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tag_values(sys.cpu.user, host, env=$env, datacenter=$dc)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns host values filtered by both &lt;code&gt;env&lt;/code&gt; and &lt;code&gt;datacenter&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tag_values(app.requests, endpoint, service=$service)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns endpoint values for the selected service.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;create-cascading-filters&#34;&gt;Create cascading filters&lt;/h3&gt;
&lt;p&gt;To create a hierarchy of dependent variables:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create the parent variable:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Name: &lt;code&gt;datacenter&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Query: &lt;code&gt;tag_values(sys.cpu.user, datacenter)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create the child variable:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Name: &lt;code&gt;host&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Query: &lt;code&gt;tag_values(sys.cpu.user, host, datacenter=$datacenter)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Create additional levels as needed:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Name: &lt;code&gt;cpu&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Query: &lt;code&gt;tag_values(sys.cpu.user, cpu, datacenter=$datacenter, host=$host)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When users change the data center selection, the host variable automatically refreshes to show only hosts in that data center.&lt;/p&gt;
&lt;h2 id=&#34;use-variables-in-queries&#34;&gt;Use variables in queries&lt;/h2&gt;
&lt;p&gt;Reference variables in your queries using the &lt;code&gt;$variablename&lt;/code&gt; or &lt;code&gt;${variablename}&lt;/code&gt; syntax. Grafana replaces the variable with its current value when the query executes.&lt;/p&gt;
&lt;h3 id=&#34;where-to-use-variables&#34;&gt;Where to use variables&lt;/h3&gt;
&lt;p&gt;Variables can be used in these query editor fields:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Example&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Metric&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;$metric&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Dynamically select which metric to query.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tag value&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;host=$host&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Filter by a variable-selected tag value.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter value&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;$host&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Use in filter value field for filtering.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Alias&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;$tag_host - $host&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Include variable values in legend labels.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Downsample interval&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;$interval&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Use a variable for the downsample interval.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;variable-syntax-options&#34;&gt;Variable syntax options&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Syntax&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$variablename&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Simple syntax for most cases.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;${variablename}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Use when the variable is adjacent to other text (for example, &lt;code&gt;${host}_suffix&lt;/code&gt;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;${variablename:format}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Apply a specific format to the variable value.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;multi-value-variables&#34;&gt;Multi-value variables&lt;/h2&gt;
&lt;p&gt;When you enable &lt;strong&gt;Multi-value&lt;/strong&gt; for a variable, users can select multiple values simultaneously. The OpenTSDB data source handles multi-value variables using pipe (&lt;code&gt;|&lt;/code&gt;) separation, which is compatible with OpenTSDB&amp;rsquo;s literal_or filter type.&lt;/p&gt;
&lt;h3 id=&#34;configure-multi-value-variables&#34;&gt;Configure multi-value variables&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;When creating the variable, enable &lt;strong&gt;Multi-value&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Optionally enable &lt;strong&gt;Include All option&lt;/strong&gt; to add an &amp;ldquo;All&amp;rdquo; selection.&lt;/li&gt;
&lt;li&gt;Use the variable in a filter with the &lt;code&gt;literal_or&lt;/code&gt; filter type.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;multi-value-example&#34;&gt;Multi-value example&lt;/h3&gt;
&lt;p&gt;With a &lt;code&gt;host&lt;/code&gt; variable configured as multi-value:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Key&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;host&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Type&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;literal_or&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Value&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;$host&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;If the user selects &lt;code&gt;webserver01&lt;/code&gt;, &lt;code&gt;webserver02&lt;/code&gt;, and &lt;code&gt;webserver03&lt;/code&gt;, the filter value becomes &lt;code&gt;webserver01|webserver02|webserver03&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;all-value-behavior&#34;&gt;All value behavior&lt;/h3&gt;
&lt;p&gt;When the user selects &amp;ldquo;All&amp;rdquo;, Grafana sends all available values pipe-separated. For large value sets, consider using a wildcard filter instead:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Key&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;host&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Type&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;wildcard&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Filter Value&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;*&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;interval-and-auto-interval-variables&#34;&gt;Interval and auto-interval variables&lt;/h2&gt;
&lt;p&gt;Grafana provides built-in interval variables that are useful with OpenTSDB downsampling:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Variable&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__interval&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Automatically calculated interval based on time range and panel width.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__interval_ms&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Same as &lt;code&gt;$__interval&lt;/code&gt; but in milliseconds.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Use these in the downsample interval field for automatic interval adjustment:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Downsample Interval&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;$__interval&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/query-editor/&#34;&gt;Build queries&lt;/a&gt; using your template variables.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/alerting/&#34;&gt;Set up alerting&lt;/a&gt; with templated queries.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/troubleshooting/&#34;&gt;Troubleshoot issues&lt;/a&gt; if variables aren&amp;rsquo;t populating.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="opentsdb-template-variables">OpenTSDB template variables&lt;/h1>
&lt;p>Instead of hard-coding server, application, and sensor names in your metric queries, you can use template variables. Variables appear as drop-down menus at the top of the dashboard, making it easy to change the data being displayed without editing queries.&lt;/p></description></item><item><title>OpenTSDB alerting</title><link>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/alerting/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/alerting/</guid><content><![CDATA[&lt;h1 id=&#34;opentsdb-alerting&#34;&gt;OpenTSDB alerting&lt;/h1&gt;
&lt;p&gt;You can use Grafana Alerting with OpenTSDB to create alerts based on your time series data. This allows you to monitor metrics, detect anomalies, and receive notifications when specific conditions are met.&lt;/p&gt;
&lt;p&gt;For general information about Grafana Alerting, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/&#34;&gt;Grafana Alerting&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;p&gt;Before creating alerts with OpenTSDB, ensure you have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An OpenTSDB data source configured in Grafana. Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/configure/&#34;&gt;Configure the OpenTSDB data source&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Appropriate permissions to create alert rules.&lt;/li&gt;
&lt;li&gt;Understanding of the metrics you want to monitor.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;supported-features&#34;&gt;Supported features&lt;/h2&gt;
&lt;p&gt;OpenTSDB alerting works with standard metric queries that return time series data. The following table summarizes alerting compatibility:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Query type&lt;/th&gt;
              &lt;th&gt;Alerting support&lt;/th&gt;
              &lt;th&gt;Notes&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metrics with aggregation&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Recommended for alerting&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Metrics with downsampling&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Use appropriate intervals&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Metrics with rate calculation&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Useful for counter metrics&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Metrics with filters/tags&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Filter to specific hosts or services&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;create-an-alert-rule&#34;&gt;Create an alert rule&lt;/h2&gt;
&lt;p&gt;To create an alert rule using OpenTSDB:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Alerting&lt;/strong&gt; &amp;gt; &lt;strong&gt;Alert rules&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;New alert rule&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter a name for the alert rule.&lt;/li&gt;
&lt;li&gt;Select your &lt;strong&gt;OpenTSDB&lt;/strong&gt; data source.&lt;/li&gt;
&lt;li&gt;Build your query:
&lt;ul&gt;
&lt;li&gt;Select the metric to monitor.&lt;/li&gt;
&lt;li&gt;Choose an appropriate aggregator (for example, &lt;code&gt;avg&lt;/code&gt;, &lt;code&gt;sum&lt;/code&gt;, &lt;code&gt;max&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Add tag filters to target specific resources.&lt;/li&gt;
&lt;li&gt;Enable downsampling with an interval matching your evaluation frequency.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Configure the alert condition (for example, when the value is above a threshold).&lt;/li&gt;
&lt;li&gt;Set the evaluation interval and pending period.&lt;/li&gt;
&lt;li&gt;Configure notifications and labels.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Save rule&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For detailed instructions, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/create-grafana-managed-rule/&#34;&gt;Create a Grafana-managed alert rule&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;example-alert-queries&#34;&gt;Example alert queries&lt;/h2&gt;
&lt;p&gt;The following examples show common alerting scenarios with OpenTSDB.&lt;/p&gt;
&lt;h3 id=&#34;alert-on-high-cpu-usage&#34;&gt;Alert on high CPU usage&lt;/h3&gt;
&lt;p&gt;Monitor CPU usage and alert when it exceeds 90%:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sys.cpu.user&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;avg&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Tags&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;host=*&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Downsample Interval&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;1m&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Downsample Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;avg&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;&lt;strong&gt;Condition:&lt;/strong&gt; When average is above &lt;code&gt;90&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;alert-on-low-disk-space&#34;&gt;Alert on low disk space&lt;/h3&gt;
&lt;p&gt;Monitor available disk space and alert when it drops below a threshold:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sys.disk.free&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;min&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Tags&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;host=*&lt;/code&gt;, &lt;code&gt;mount=/&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Downsample Interval&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;5m&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Downsample Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;min&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;&lt;strong&gt;Condition:&lt;/strong&gt; When minimum is below &lt;code&gt;10737418240&lt;/code&gt; (10 GB in bytes)&lt;/p&gt;
&lt;h3 id=&#34;alert-on-high-network-traffic-rate&#34;&gt;Alert on high network traffic rate&lt;/h3&gt;
&lt;p&gt;Monitor network bytes received and alert on high traffic:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;net.bytes.received&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sum&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Tags&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;host=webserver01&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Rate&lt;/td&gt;
              &lt;td&gt;enabled&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Counter&lt;/td&gt;
              &lt;td&gt;enabled&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Downsample Interval&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;1m&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Downsample Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;avg&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;&lt;strong&gt;Condition:&lt;/strong&gt; When sum is above &lt;code&gt;104857600&lt;/code&gt; (100 MB/s in bytes)&lt;/p&gt;
&lt;h3 id=&#34;alert-on-error-count-spike&#34;&gt;Alert on error count spike&lt;/h3&gt;
&lt;p&gt;Monitor application error counts:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Metric&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;app.errors.count&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sum&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Tags&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;service=api&lt;/code&gt;, &lt;code&gt;env=production&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Downsample Interval&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;5m&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Downsample Aggregator&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;sum&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;&lt;strong&gt;Condition:&lt;/strong&gt; When sum is above &lt;code&gt;100&lt;/code&gt;&lt;/p&gt;
&lt;h2 id=&#34;limitations&#34;&gt;Limitations&lt;/h2&gt;
&lt;p&gt;When using OpenTSDB with Grafana Alerting, be aware of the following limitations.&lt;/p&gt;
&lt;h3 id=&#34;template-variables-not-supported&#34;&gt;Template variables not supported&lt;/h3&gt;
&lt;p&gt;Alert queries can&amp;rsquo;t contain template variables. Grafana evaluates alert rules on the backend without dashboard context, so variables like &lt;code&gt;$hostname&lt;/code&gt; or &lt;code&gt;$environment&lt;/code&gt; aren&amp;rsquo;t resolved.&lt;/p&gt;
&lt;p&gt;If your dashboard query uses template variables, create a separate query for alerting with hard-coded values.&lt;/p&gt;
&lt;h3 id=&#34;query-complexity&#34;&gt;Query complexity&lt;/h3&gt;
&lt;p&gt;Complex queries with many tags or long time ranges may timeout or fail to evaluate. Simplify queries for alerting by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using specific tag filters instead of wildcards where possible.&lt;/li&gt;
&lt;li&gt;Enabling downsampling with appropriate intervals.&lt;/li&gt;
&lt;li&gt;Reducing the evaluation time range.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;opentsdb-24-behavior&#34;&gt;OpenTSDB 2.4 behavior&lt;/h3&gt;
&lt;p&gt;When using OpenTSDB 2.4 with alerting, Grafana executes queries with the parameter &lt;code&gt;arrays=true&lt;/code&gt;. This causes OpenTSDB to return data points as an array of arrays instead of a map of key-value pairs. Grafana automatically converts this data to the appropriate format.&lt;/p&gt;
&lt;h2 id=&#34;best-practices&#34;&gt;Best practices&lt;/h2&gt;
&lt;p&gt;Follow these best practices when creating OpenTSDB alerts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Use specific tag filters:&lt;/strong&gt; Add tag filters to focus on relevant resources and improve query performance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Match downsample interval to evaluation:&lt;/strong&gt; Set the downsample interval to match or be slightly smaller than your alert evaluation interval.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test queries first:&lt;/strong&gt; Verify your query returns expected results in 
    &lt;a href=&#34;/docs/grafana/v12.4/explore/&#34;&gt;Explore&lt;/a&gt; before creating an alert.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Set realistic thresholds:&lt;/strong&gt; Base alert thresholds on historical data patterns to avoid false positives.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use meaningful names:&lt;/strong&gt; Give alert rules descriptive names that indicate what they monitor.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enable downsampling:&lt;/strong&gt; Always enable downsampling for alerting queries to reduce data volume and improve reliability.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Consider counter resets:&lt;/strong&gt; For counter metrics, enable the Counter option and set appropriate max values to handle resets correctly.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/query-editor/&#34;&gt;Build queries&lt;/a&gt; to explore your metrics before creating alerts.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/troubleshooting/&#34;&gt;Troubleshoot issues&lt;/a&gt; if alerts aren&amp;rsquo;t firing as expected.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="opentsdb-alerting">OpenTSDB alerting&lt;/h1>
&lt;p>You can use Grafana Alerting with OpenTSDB to create alerts based on your time series data. This allows you to monitor metrics, detect anomalies, and receive notifications when specific conditions are met.&lt;/p></description></item><item><title>OpenTSDB annotations</title><link>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/annotations/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/annotations/</guid><content><![CDATA[&lt;h1 id=&#34;opentsdb-annotations&#34;&gt;OpenTSDB annotations&lt;/h1&gt;
&lt;p&gt;Annotations allow you to overlay event information on graphs, providing context for metric changes. The OpenTSDB data source supports both metric-specific annotations and global annotations stored in OpenTSDB.&lt;/p&gt;
&lt;p&gt;For general information about annotations in Grafana, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/build-dashboards/annotate-visualizations/&#34;&gt;Annotate visualizations&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;annotation-types&#34;&gt;Annotation types&lt;/h2&gt;
&lt;p&gt;OpenTSDB supports two types of annotations:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Type&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Use case&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Metric annotations&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Annotations attached to a specific time series (TSUID). Retrieved by querying the associated metric.&lt;/td&gt;
              &lt;td&gt;Track events affecting a specific host or service.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Global annotations&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Annotations not tied to any time series. Apply system-wide.&lt;/td&gt;
              &lt;td&gt;Track deployments, maintenance windows, or infrastructure-wide events.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;how-grafana-retrieves-annotations&#34;&gt;How Grafana retrieves annotations&lt;/h2&gt;
&lt;p&gt;When you configure an annotation query, Grafana queries OpenTSDB for the specified metric and retrieves any annotations associated with that metric&amp;rsquo;s time series. The query includes the &lt;code&gt;globalAnnotations=true&lt;/code&gt; parameter, which allows Grafana to also retrieve global annotations when enabled.&lt;/p&gt;
&lt;p&gt;Grafana displays the &lt;code&gt;description&lt;/code&gt; field from each annotation as the annotation text.&lt;/p&gt;
&lt;h2 id=&#34;configure-an-annotation-query&#34;&gt;Configure an annotation query&lt;/h2&gt;
&lt;p&gt;To add OpenTSDB annotations to a dashboard:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click the dashboard settings icon (gear) in the top navigation.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Annotations&lt;/strong&gt; in the left menu.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add annotation query&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;OpenTSDB&lt;/strong&gt; data source.&lt;/li&gt;
&lt;li&gt;Configure the annotation query fields as described in the following table.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Save dashboard&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;annotation-query-fields&#34;&gt;Annotation query fields&lt;/h2&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;A descriptive name for this annotation query. Appears in the annotation legend.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Data source&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Select the OpenTSDB data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Enabled&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggle to enable or disable this annotation query.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;OpenTSDB metrics query&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The metric name to query for annotations (for example, &lt;code&gt;events.deployment&lt;/code&gt;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Show Global Annotations&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggle to include global annotations that aren&amp;rsquo;t tied to a specific time series.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;example-annotation-queries&#34;&gt;Example annotation queries&lt;/h2&gt;
&lt;p&gt;The following examples demonstrate common annotation use cases.&lt;/p&gt;
&lt;h3 id=&#34;track-application-deployments&#34;&gt;Track application deployments&lt;/h3&gt;
&lt;p&gt;Monitor when deployments occur for a specific application:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Name&lt;/td&gt;
              &lt;td&gt;App Deployments&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;OpenTSDB metrics query&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;deploy.myapp&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Show Global Annotations&lt;/td&gt;
              &lt;td&gt;disabled&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;This query retrieves annotations attached to the &lt;code&gt;deploy.myapp&lt;/code&gt; metric, showing deployment events for that specific application.&lt;/p&gt;
&lt;h3 id=&#34;monitor-infrastructure-wide-events&#34;&gt;Monitor infrastructure-wide events&lt;/h3&gt;
&lt;p&gt;Capture system-wide events such as network changes or datacenter maintenance:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Name&lt;/td&gt;
              &lt;td&gt;Infrastructure Events&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;OpenTSDB metrics query&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;events.infrastructure&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Show Global Annotations&lt;/td&gt;
              &lt;td&gt;enabled&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;This query retrieves both metric-specific and global annotations, providing a complete picture of infrastructure events.&lt;/p&gt;
&lt;h3 id=&#34;track-incidents-and-outages&#34;&gt;Track incidents and outages&lt;/h3&gt;
&lt;p&gt;Mark incident start and resolution times:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Name&lt;/td&gt;
              &lt;td&gt;Incidents&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;OpenTSDB metrics query&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;events.incident&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Show Global Annotations&lt;/td&gt;
              &lt;td&gt;enabled&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;monitor-configuration-changes&#34;&gt;Monitor configuration changes&lt;/h3&gt;
&lt;p&gt;Track when configuration changes are applied:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Name&lt;/td&gt;
              &lt;td&gt;Config Changes&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;OpenTSDB metrics query&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;events.config&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Show Global Annotations&lt;/td&gt;
              &lt;td&gt;disabled&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;correlate-multiple-event-types&#34;&gt;Correlate multiple event types&lt;/h3&gt;
&lt;p&gt;You can add multiple annotation queries to a single dashboard to correlate different event types. For example:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add a &amp;ldquo;Deployments&amp;rdquo; annotation query for &lt;code&gt;deploy.*&lt;/code&gt; metrics.&lt;/li&gt;
&lt;li&gt;Add an &amp;ldquo;Incidents&amp;rdquo; annotation query for &lt;code&gt;events.incident&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Add a &amp;ldquo;Maintenance&amp;rdquo; annotation query with global annotations enabled.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This allows you to see how deployments, incidents, and maintenance windows relate to your metric data.&lt;/p&gt;
&lt;h2 id=&#34;how-annotations-appear&#34;&gt;How annotations appear&lt;/h2&gt;
&lt;p&gt;Annotations appear as vertical lines on time series panels at the timestamps where events occurred. Hover over an annotation marker to view:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The annotation name (from your query configuration)&lt;/li&gt;
&lt;li&gt;The event description (from the OpenTSDB annotation&amp;rsquo;s &lt;code&gt;description&lt;/code&gt; field)&lt;/li&gt;
&lt;li&gt;The timestamp&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Different annotation queries can be assigned different colors in the dashboard settings to distinguish between event types.&lt;/p&gt;
&lt;h2 id=&#34;create-annotations-in-opentsdb&#34;&gt;Create annotations in OpenTSDB&lt;/h2&gt;
&lt;p&gt;To display annotations in Grafana, you must first create them in OpenTSDB. OpenTSDB provides an HTTP API for managing annotations.&lt;/p&gt;
&lt;h3 id=&#34;annotation-data-structure&#34;&gt;Annotation data structure&lt;/h3&gt;
&lt;p&gt;OpenTSDB annotations have the following fields:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Field&lt;/th&gt;
              &lt;th&gt;Required&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;startTime&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Yes&lt;/td&gt;
              &lt;td&gt;Unix epoch timestamp in seconds when the event started.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;endTime&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Unix epoch timestamp in seconds when the event ended. Useful for duration-based events.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tsuid&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;The time series UID to associate this annotation with. If empty, the annotation is global.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;description&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Brief description of the event. This text displays in Grafana.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;notes&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;Detailed notes about the event.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;custom&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;No&lt;/td&gt;
              &lt;td&gt;A map of custom key-value pairs for additional metadata.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;create-a-global-annotation&#34;&gt;Create a global annotation&lt;/h3&gt;
&lt;p&gt;Use the OpenTSDB API to create a global annotation:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;curl -X POST http://&amp;lt;OPENTSDB_HOST&amp;gt;:4242/api/annotation \
  -H &amp;#34;Content-Type: application/json&amp;#34; \
  -d &amp;#39;{
    &amp;#34;startTime&amp;#34;: 1609459200,
    &amp;#34;description&amp;#34;: &amp;#34;Production deployment v2.5.0&amp;#34;,
    &amp;#34;notes&amp;#34;: &amp;#34;Deployed new feature flags and performance improvements&amp;#34;,
    &amp;#34;custom&amp;#34;: {
      &amp;#34;version&amp;#34;: &amp;#34;2.5.0&amp;#34;,
      &amp;#34;environment&amp;#34;: &amp;#34;production&amp;#34;,
      &amp;#34;deployer&amp;#34;: &amp;#34;jenkins&amp;#34;
    }
  }&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;create-a-metric-specific-annotation&#34;&gt;Create a metric-specific annotation&lt;/h3&gt;
&lt;p&gt;To attach an annotation to a specific time series, include the &lt;code&gt;tsuid&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;curl -X POST http://&amp;lt;OPENTSDB_HOST&amp;gt;:4242/api/annotation \
  -H &amp;#34;Content-Type: application/json&amp;#34; \
  -d &amp;#39;{
    &amp;#34;startTime&amp;#34;: 1609459200,
    &amp;#34;endTime&amp;#34;: 1609462800,
    &amp;#34;tsuid&amp;#34;: &amp;#34;000001000001000001&amp;#34;,
    &amp;#34;description&amp;#34;: &amp;#34;Server maintenance&amp;#34;,
    &amp;#34;notes&amp;#34;: &amp;#34;Scheduled maintenance window for hardware upgrade&amp;#34;
  }&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To find the TSUID for a metric, use the OpenTSDB &lt;code&gt;/api/uid/tsmeta&lt;/code&gt; endpoint.&lt;/p&gt;
&lt;h3 id=&#34;create-annotations-programmatically&#34;&gt;Create annotations programmatically&lt;/h3&gt;
&lt;p&gt;Integrate annotation creation into your deployment pipelines or monitoring systems:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Deployment script example:&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;#!/bin/bash
VERSION=$1
TIMESTAMP=$(date &amp;#43;%s)

curl -X POST http://opentsdb.example.com:4242/api/annotation \
  -H &amp;#34;Content-Type: application/json&amp;#34; \
  -d &amp;#34;{
    \&amp;#34;startTime\&amp;#34;: $TIMESTAMP,
    \&amp;#34;description\&amp;#34;: \&amp;#34;Deployed version $VERSION\&amp;#34;,
    \&amp;#34;custom\&amp;#34;: {
      \&amp;#34;version\&amp;#34;: \&amp;#34;$VERSION\&amp;#34;,
      \&amp;#34;environment\&amp;#34;: \&amp;#34;production\&amp;#34;
    }
  }&amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;For more details on the annotation API, refer to the &lt;a href=&#34;http://opentsdb.net/docs/build/html/api_http/annotation/index.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTSDB annotation API documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;troubleshoot-annotation-issues&#34;&gt;Troubleshoot annotation issues&lt;/h2&gt;
&lt;p&gt;The following section addresses common issues you may encounter when using OpenTSDB annotations.&lt;/p&gt;
&lt;h3 id=&#34;annotations-dont-appear&#34;&gt;Annotations don&amp;rsquo;t appear&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Possible causes and solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Cause&lt;/th&gt;
              &lt;th&gt;Solution&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Time range doesn&amp;rsquo;t include annotations&lt;/td&gt;
              &lt;td&gt;Expand the dashboard time range to include the annotation timestamps.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Wrong metric name&lt;/td&gt;
              &lt;td&gt;Verify the metric name in your annotation query matches the metric associated with the annotations in OpenTSDB.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Annotations are global but toggle is off&lt;/td&gt;
              &lt;td&gt;Enable &lt;strong&gt;Show Global Annotations&lt;/strong&gt; if your annotations don&amp;rsquo;t have a TSUID.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;No annotations exist&lt;/td&gt;
              &lt;td&gt;Verify annotations exist in OpenTSDB using the API: &lt;code&gt;curl http://&amp;lt;OPENTSDB_HOST&amp;gt;:4242/api/annotation?startTime=&amp;lt;START&amp;gt;&amp;amp;endTime=&amp;lt;END&amp;gt;&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;annotation-text-is-empty&#34;&gt;Annotation text is empty&lt;/h3&gt;
&lt;p&gt;The annotation displays but has no description text.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Ensure the &lt;code&gt;description&lt;/code&gt; field is populated when creating annotations in OpenTSDB. Grafana displays the &lt;code&gt;description&lt;/code&gt; field as the annotation text.&lt;/p&gt;
&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/query-editor/&#34;&gt;Build queries&lt;/a&gt; to visualize metrics alongside annotations.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/template-variables/&#34;&gt;Use template variables&lt;/a&gt; to create dynamic dashboards.&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/alerting/&#34;&gt;Set up alerting&lt;/a&gt; to get notified when metrics cross thresholds.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="opentsdb-annotations">OpenTSDB annotations&lt;/h1>
&lt;p>Annotations allow you to overlay event information on graphs, providing context for metric changes. The OpenTSDB data source supports both metric-specific annotations and global annotations stored in OpenTSDB.&lt;/p></description></item><item><title>Troubleshoot OpenTSDB data source issues</title><link>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/troubleshooting/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/opentsdb/troubleshooting/</guid><content><![CDATA[&lt;h1 id=&#34;troubleshoot-opentsdb-data-source-issues&#34;&gt;Troubleshoot OpenTSDB data source issues&lt;/h1&gt;
&lt;p&gt;This document provides solutions to common issues you may encounter when configuring or using the OpenTSDB data source. For configuration instructions, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/configure/&#34;&gt;Configure the OpenTSDB data source&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;connection-errors&#34;&gt;Connection errors&lt;/h2&gt;
&lt;p&gt;These errors occur when Grafana can&amp;rsquo;t connect to the OpenTSDB server.&lt;/p&gt;
&lt;h3 id=&#34;connection-refused-or-timeout-errors&#34;&gt;&amp;ldquo;Connection refused&amp;rdquo; or timeout errors&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Save &amp;amp; test fails&lt;/li&gt;
&lt;li&gt;Queries return connection errors&lt;/li&gt;
&lt;li&gt;Intermittent timeouts&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Possible causes and solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Cause&lt;/th&gt;
              &lt;th&gt;Solution&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Wrong URL or port&lt;/td&gt;
              &lt;td&gt;Verify the URL includes the correct protocol, IP address, and port. The default port is &lt;code&gt;4242&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;OpenTSDB not running&lt;/td&gt;
              &lt;td&gt;Check that the OpenTSDB server is running and accessible.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Firewall blocking connection&lt;/td&gt;
              &lt;td&gt;Ensure firewall rules allow outbound connections from Grafana to the OpenTSDB server on the configured port.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Network issues&lt;/td&gt;
              &lt;td&gt;Verify network connectivity between Grafana and OpenTSDB. Try pinging the server or using &lt;code&gt;curl&lt;/code&gt; to test the API.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;To test connectivity manually, run:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;sh&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-sh&#34;&gt;curl http://&amp;lt;OPENTSDB_HOST&amp;gt;:4242/api/version&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;authentication-errors&#34;&gt;Authentication errors&lt;/h2&gt;
&lt;p&gt;These errors occur when credentials are invalid or misconfigured.&lt;/p&gt;
&lt;h3 id=&#34;401-unauthorized-or-403-forbidden&#34;&gt;&amp;ldquo;401 Unauthorized&amp;rdquo; or &amp;ldquo;403 Forbidden&amp;rdquo;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Save &amp;amp; test fails with authentication error&lt;/li&gt;
&lt;li&gt;Queries return authorization errors&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify that basic authentication credentials are correct in the data source configuration.&lt;/li&gt;
&lt;li&gt;Check that the OpenTSDB server is configured to accept the provided credentials.&lt;/li&gt;
&lt;li&gt;If using cookies for authentication, ensure the required cookies are listed in &lt;strong&gt;Allowed cookies&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;query-errors&#34;&gt;Query errors&lt;/h2&gt;
&lt;p&gt;These errors occur when executing queries against OpenTSDB.&lt;/p&gt;
&lt;h3 id=&#34;no-data-returned&#34;&gt;No data returned&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Query executes without error but returns no data&lt;/li&gt;
&lt;li&gt;Panels show &amp;ldquo;No data&amp;rdquo; message&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Possible causes and solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Cause&lt;/th&gt;
              &lt;th&gt;Solution&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;Time range doesn&amp;rsquo;t contain data&lt;/td&gt;
              &lt;td&gt;Expand the dashboard time range. Verify data exists in OpenTSDB for the selected period.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Wrong metric name&lt;/td&gt;
              &lt;td&gt;Verify the metric name is correct. Use autocomplete to discover available metrics.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Incorrect tag filters&lt;/td&gt;
              &lt;td&gt;Remove or adjust tag filters. Use &lt;code&gt;*&lt;/code&gt; as a wildcard to match all values.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Version mismatch&lt;/td&gt;
              &lt;td&gt;Ensure the configured OpenTSDB version matches your server. Filters are only available in version 2.2&#43;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Using both Filters and Tags&lt;/td&gt;
              &lt;td&gt;Use either Filters or Tags, not both. They&amp;rsquo;re mutually exclusive in OpenTSDB 2.2&#43;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;query-timeout&#34;&gt;Query timeout&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Queries take a long time and then fail&lt;/li&gt;
&lt;li&gt;Error message mentions timeout&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reduce the time range of your query.&lt;/li&gt;
&lt;li&gt;Add more specific tag filters to reduce the data volume.&lt;/li&gt;
&lt;li&gt;Increase the &lt;strong&gt;Timeout&lt;/strong&gt; setting in the data source configuration.&lt;/li&gt;
&lt;li&gt;Enable downsampling to reduce the number of data points returned.&lt;/li&gt;
&lt;li&gt;Check OpenTSDB server performance and HBase health.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;autocomplete-doesnt-work&#34;&gt;Autocomplete doesn&amp;rsquo;t work&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No suggestions appear when typing metric names, tag names, or tag values&lt;/li&gt;
&lt;li&gt;Drop-down menus are empty&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify that the OpenTSDB &lt;code&gt;/api/suggest&lt;/code&gt; endpoint is accessible. Test it manually with &lt;code&gt;curl http://&amp;lt;OPENTSDB_HOST&amp;gt;:4242/api/suggest?type=metrics&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Increase the &lt;strong&gt;Lookup limit&lt;/strong&gt; setting if you have many metrics or tags.&lt;/li&gt;
&lt;li&gt;Verify that the data source connection is working by clicking &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Check that metrics exist in OpenTSDB. The suggest API only returns metrics that have been written to the database.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;template-variables-dont-populate&#34;&gt;Template variables don&amp;rsquo;t populate&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Template variable drop-down menus are empty&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Preview of values&lt;/strong&gt; shows no results&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enable real-time metadata tracking in OpenTSDB by setting &lt;code&gt;tsd.core.meta.enable_realtime_ts&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; in your OpenTSDB configuration.&lt;/li&gt;
&lt;li&gt;Sync existing metadata by running &lt;code&gt;tsdb uid metasync&lt;/code&gt; on the OpenTSDB server.&lt;/li&gt;
&lt;li&gt;Verify the variable query syntax is correct. Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/opentsdb/template-variables/&#34;&gt;Template variables&lt;/a&gt; for the correct syntax.&lt;/li&gt;
&lt;li&gt;Check that the data source connection is working.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;performance-issues&#34;&gt;Performance issues&lt;/h2&gt;
&lt;p&gt;These issues relate to slow queries or high resource usage.&lt;/p&gt;
&lt;h3 id=&#34;slow-queries&#34;&gt;Slow queries&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptoms:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Dashboards take a long time to load&lt;/li&gt;
&lt;li&gt;Queries are slow even for small time ranges&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Enable downsampling in the query editor to reduce data volume.&lt;/li&gt;
&lt;li&gt;Use more specific tag filters to limit the time series returned.&lt;/li&gt;
&lt;li&gt;Reduce the time range.&lt;/li&gt;
&lt;li&gt;Check OpenTSDB and HBase performance metrics.&lt;/li&gt;
&lt;li&gt;Consider increasing OpenTSDB heap size if memory is constrained.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;hbase-performance-issues&#34;&gt;HBase performance issues&lt;/h3&gt;
&lt;p&gt;OpenTSDB relies on HBase for data storage. Performance problems in HBase directly affect OpenTSDB query performance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solutions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Monitor HBase region server health and compaction status.&lt;/li&gt;
&lt;li&gt;Ensure sufficient heap memory is allocated to HBase region servers.&lt;/li&gt;
&lt;li&gt;Check for region hotspots and rebalance if necessary.&lt;/li&gt;
&lt;li&gt;Refer to the &lt;a href=&#34;http://opentsdb.net/docs/build/html/user_guide/troubleshooting.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTSDB troubleshooting guide&lt;/a&gt; for HBase-specific issues.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;enable-debug-logging&#34;&gt;Enable debug logging&lt;/h2&gt;
&lt;p&gt;To capture detailed error information for troubleshooting:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Set the Grafana log level to &lt;code&gt;debug&lt;/code&gt; in the configuration file:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;ini&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-ini&#34;&gt;[log]
level = debug&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Review logs in &lt;code&gt;/var/log/grafana/grafana.log&lt;/code&gt; (or your configured log location).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Look for OpenTSDB-specific entries that include request and response details.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Reset the log level to &lt;code&gt;info&lt;/code&gt; after troubleshooting to avoid excessive log volume.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;get-additional-help&#34;&gt;Get additional help&lt;/h2&gt;
&lt;p&gt;If you&amp;rsquo;ve tried the solutions in this document and still encounter issues:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check the &lt;a href=&#34;https://community.grafana.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana community forums&lt;/a&gt; for similar issues.&lt;/li&gt;
&lt;li&gt;Review &lt;a href=&#34;https://github.com/grafana/grafana/issues?q=opentsdb&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTSDB issues on GitHub&lt;/a&gt; for known bugs.&lt;/li&gt;
&lt;li&gt;Consult the &lt;a href=&#34;http://opentsdb.net/docs/build/html/index.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTSDB documentation&lt;/a&gt; for server-specific guidance.&lt;/li&gt;
&lt;li&gt;Contact Grafana Support if you&amp;rsquo;re a Grafana Enterprise, Cloud Pro, or Cloud Contracted user.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When reporting issues, include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Grafana version&lt;/li&gt;
&lt;li&gt;OpenTSDB version&lt;/li&gt;
&lt;li&gt;Error messages (redact sensitive information)&lt;/li&gt;
&lt;li&gt;Steps to reproduce&lt;/li&gt;
&lt;li&gt;Data source configuration (redact credentials)&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="troubleshoot-opentsdb-data-source-issues">Troubleshoot OpenTSDB data source issues&lt;/h1>
&lt;p>This document provides solutions to common issues you may encounter when configuring or using the OpenTSDB data source. For configuration instructions, refer to
&lt;a href="/docs/grafana/v12.4/datasources/opentsdb/configure/">Configure the OpenTSDB data source&lt;/a>.&lt;/p></description></item></channel></rss>