<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Data sources on Grafana Labs</title><link>https://grafana.com/docs/grafana/v9.4/datasources/</link><description>Recent content in Data sources on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v9.4/datasources/index.xml" rel="self" type="application/rss+xml"/><item><title>Alertmanager data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/alertmanager/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/alertmanager/</guid><content><![CDATA[&lt;h1 id=&#34;alertmanager-data-source&#34;&gt;Alertmanager data source&lt;/h1&gt;
&lt;p&gt;Grafana includes built-in support for Alertmanager implementations in Prometheus and Mimir.
Once you add it as a data source, you can use the &lt;a href=&#34;/docs/grafana/latest/alerting/&#34;&gt;Grafana Alerting UI&lt;/a&gt; to manage silences, contact points, and notification policies.
To switch between Grafana and any configured Alertmanager data sources, you can select your preference from a drop-down option in those databases&amp;rsquo; data source settings pages.&lt;/p&gt;
&lt;h2 id=&#34;alertmanager-implementations&#34;&gt;Alertmanager implementations&lt;/h2&gt;
&lt;p&gt;The data source supports &lt;a href=&#34;https://prometheus.io/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus&lt;/a&gt; and &lt;a href=&#34;/docs/mimir/latest/&#34;&gt;Grafana Mimir&lt;/a&gt; (default) implementations of Alertmanager.
You can specify the implementation in the data source&amp;rsquo;s Settings page.
When using Prometheus, contact points and notification policies are read-only in the Grafana Alerting UI, because it doesn&amp;rsquo;t support updates to the configuration using HTTP API.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the &lt;strong&gt;Data sources&lt;/strong&gt; section from the &lt;strong&gt;Administration&lt;/strong&gt; menu&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Alertmanager&lt;/strong&gt; data source&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options carefully:&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;Name&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;Sets the name you use to refer to the data source&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;Sets whether the data source is pre-selected for new panels and queries&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Alertmanager&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Implementation&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Alertmanager implementation. &lt;strong&gt;Mimir&lt;/strong&gt;, &lt;strong&gt;Cortex,&lt;/strong&gt; and &lt;strong&gt;Prometheus&lt;/strong&gt; are supported&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Receive Grafana Alerts&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;When enabled the Alertmanager receives alert instances from Grafana-managed alert rules. &lt;strong&gt;Important:&lt;/strong&gt; It works only if Grafana alerting is configured to send its alert instances to external Alertmanagers&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;HTTP&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&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;Sets the HTTP protocol, IP, and port of your Alertmanager instance, such as &lt;code&gt;https://alertmanager.example.org:9093&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Access&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Only &lt;strong&gt;Server&lt;/strong&gt; access mode is functional&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;provision-the-alertmanager-data-source&#34;&gt;Provision the Alertmanager data source&lt;/h2&gt;
&lt;p&gt;You can provision Alertmanager data sources by updating Grafana&amp;rsquo;s configuration files.
For more information on provisioning, and common settings available, refer to the &lt;a href=&#34;../../administration/provisioning/#datasources&#34;&gt;provisioning docs page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here is an example for provisioning the Alertmanager 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: Alertmanager
    type: alertmanager
    url: http://localhost:9093
    access: proxy
    jsonData:
      # Valid options for implementation include mimir, cortex and prometheus
      implementation: prometheus
      # Whether or not Grafana should send alert instances to this Alertmanager
      handleGrafanaManagedAlerts: false
    # optionally
    basicAuth: true
    basicAuthUser: my_user
    secureJsonData:
      basicAuthPassword: test_password&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="alertmanager-data-source">Alertmanager data source&lt;/h1>
&lt;p>Grafana includes built-in support for Alertmanager implementations in Prometheus and Mimir.
Once you add it as a data source, you can use the &lt;a href="/docs/grafana/latest/alerting/">Grafana Alerting UI&lt;/a> to manage silences, contact points, and notification policies.
To switch between Grafana and any configured Alertmanager data sources, you can select your preference from a drop-down option in those databases&amp;rsquo; data source settings pages.&lt;/p></description></item><item><title>Amazon CloudWatch data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/aws-cloudwatch/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/aws-cloudwatch/</guid><content><![CDATA[&lt;h1 id=&#34;amazon-cloudwatch-data-source&#34;&gt;Amazon CloudWatch data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with built-in support for Amazon CloudWatch.
This topic describes queries, templates, variables, and other configuration specific to the CloudWatch data source.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;provision the data source&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system, and should &lt;a href=&#34;#control-pricing&#34;&gt;control pricing&lt;/a&gt; and &lt;a href=&#34;#manage-service-quotas&#34;&gt;manage service quotas&lt;/a&gt; accordingly.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the data source, you can &lt;a href=&#34;#configure-the-data-source&#34;&gt;configure it&lt;/a&gt; so that your Grafana instance&amp;rsquo;s users can create queries in its &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt; when they &lt;a href=&#34;../../dashboards/build-dashboards/&#34;&gt;build dashboards&lt;/a&gt; and use &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; To troubleshoot issues while setting up the CloudWatch data source, check the &lt;code&gt;/var/log/grafana/grafana.log&lt;/code&gt; file.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the CloudWatch data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-aws-authentication&#34;&gt;Configure AWS authentication&lt;/h3&gt;
&lt;p&gt;A Grafana plugin&amp;rsquo;s requests to AWS are made on behalf of an AWS Identity and Access Management (IAM) role or IAM user.
The IAM user or IAM role must have the associated policies to perform certain API actions.&lt;/p&gt;
&lt;p&gt;For authentication options and configuration details, refer to &lt;a href=&#34;aws-authentication/&#34;&gt;AWS authentication&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;iam-policy-examples&#34;&gt;IAM policy examples&lt;/h4&gt;
&lt;p&gt;To read CloudWatch metrics and EC2 tags, instances, regions, and alarms, you must grant Grafana permissions via IAM.
You can attach these permissions to the IAM role or IAM user you configured in &lt;a href=&#34;aws-authentication/&#34;&gt;AWS authentication&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Metrics-only:&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;JSON&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-json&#34;&gt;{
  &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;,
  &amp;#34;Statement&amp;#34;: [
    {
      &amp;#34;Sid&amp;#34;: &amp;#34;AllowReadingMetricsFromCloudWatch&amp;#34;,
      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,
      &amp;#34;Action&amp;#34;: [
        &amp;#34;cloudwatch:DescribeAlarmsForMetric&amp;#34;,
        &amp;#34;cloudwatch:DescribeAlarmHistory&amp;#34;,
        &amp;#34;cloudwatch:DescribeAlarms&amp;#34;,
        &amp;#34;cloudwatch:ListMetrics&amp;#34;,
        &amp;#34;cloudwatch:GetMetricData&amp;#34;,
        &amp;#34;cloudwatch:GetInsightRuleReport&amp;#34;
      ],
      &amp;#34;Resource&amp;#34;: &amp;#34;*&amp;#34;
    },
    {
      &amp;#34;Sid&amp;#34;: &amp;#34;AllowReadingTagsInstancesRegionsFromEC2&amp;#34;,
      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,
      &amp;#34;Action&amp;#34;: [&amp;#34;ec2:DescribeTags&amp;#34;, &amp;#34;ec2:DescribeInstances&amp;#34;, &amp;#34;ec2:DescribeRegions&amp;#34;],
      &amp;#34;Resource&amp;#34;: &amp;#34;*&amp;#34;
    },
    {
      &amp;#34;Sid&amp;#34;: &amp;#34;AllowReadingResourcesForTags&amp;#34;,
      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,
      &amp;#34;Action&amp;#34;: &amp;#34;tag:GetResources&amp;#34;,
      &amp;#34;Resource&amp;#34;: &amp;#34;*&amp;#34;
    }
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Logs-only:&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;JSON&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-json&#34;&gt;{
  &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;,
  &amp;#34;Statement&amp;#34;: [
    {
      &amp;#34;Sid&amp;#34;: &amp;#34;AllowReadingLogsFromCloudWatch&amp;#34;,
      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,
      &amp;#34;Action&amp;#34;: [
        &amp;#34;logs:DescribeLogGroups&amp;#34;,
        &amp;#34;logs:GetLogGroupFields&amp;#34;,
        &amp;#34;logs:StartQuery&amp;#34;,
        &amp;#34;logs:StopQuery&amp;#34;,
        &amp;#34;logs:GetQueryResults&amp;#34;,
        &amp;#34;logs:GetLogEvents&amp;#34;
      ],
      &amp;#34;Resource&amp;#34;: &amp;#34;*&amp;#34;
    },
    {
      &amp;#34;Sid&amp;#34;: &amp;#34;AllowReadingTagsInstancesRegionsFromEC2&amp;#34;,
      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,
      &amp;#34;Action&amp;#34;: [&amp;#34;ec2:DescribeTags&amp;#34;, &amp;#34;ec2:DescribeInstances&amp;#34;, &amp;#34;ec2:DescribeRegions&amp;#34;],
      &amp;#34;Resource&amp;#34;: &amp;#34;*&amp;#34;
    },
    {
      &amp;#34;Sid&amp;#34;: &amp;#34;AllowReadingResourcesForTags&amp;#34;,
      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,
      &amp;#34;Action&amp;#34;: &amp;#34;tag:GetResources&amp;#34;,
      &amp;#34;Resource&amp;#34;: &amp;#34;*&amp;#34;
    }
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Metrics and Logs:&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;JSON&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-json&#34;&gt;{
  &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;,
  &amp;#34;Statement&amp;#34;: [
    {
      &amp;#34;Sid&amp;#34;: &amp;#34;AllowReadingMetricsFromCloudWatch&amp;#34;,
      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,
      &amp;#34;Action&amp;#34;: [
        &amp;#34;cloudwatch:DescribeAlarmsForMetric&amp;#34;,
        &amp;#34;cloudwatch:DescribeAlarmHistory&amp;#34;,
        &amp;#34;cloudwatch:DescribeAlarms&amp;#34;,
        &amp;#34;cloudwatch:ListMetrics&amp;#34;,
        &amp;#34;cloudwatch:GetMetricData&amp;#34;,
        &amp;#34;cloudwatch:GetInsightRuleReport&amp;#34;
      ],
      &amp;#34;Resource&amp;#34;: &amp;#34;*&amp;#34;
    },
    {
      &amp;#34;Sid&amp;#34;: &amp;#34;AllowReadingLogsFromCloudWatch&amp;#34;,
      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,
      &amp;#34;Action&amp;#34;: [
        &amp;#34;logs:DescribeLogGroups&amp;#34;,
        &amp;#34;logs:GetLogGroupFields&amp;#34;,
        &amp;#34;logs:StartQuery&amp;#34;,
        &amp;#34;logs:StopQuery&amp;#34;,
        &amp;#34;logs:GetQueryResults&amp;#34;,
        &amp;#34;logs:GetLogEvents&amp;#34;
      ],
      &amp;#34;Resource&amp;#34;: &amp;#34;*&amp;#34;
    },
    {
      &amp;#34;Sid&amp;#34;: &amp;#34;AllowReadingTagsInstancesRegionsFromEC2&amp;#34;,
      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,
      &amp;#34;Action&amp;#34;: [&amp;#34;ec2:DescribeTags&amp;#34;, &amp;#34;ec2:DescribeInstances&amp;#34;, &amp;#34;ec2:DescribeRegions&amp;#34;],
      &amp;#34;Resource&amp;#34;: &amp;#34;*&amp;#34;
    },
    {
      &amp;#34;Sid&amp;#34;: &amp;#34;AllowReadingResourcesForTags&amp;#34;,
      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,
      &amp;#34;Action&amp;#34;: &amp;#34;tag:GetResources&amp;#34;,
      &amp;#34;Resource&amp;#34;: &amp;#34;*&amp;#34;
    }
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;**Cross-account observability: (see below) **&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;JSON&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-json&#34;&gt;{
  &amp;#34;Version&amp;#34;: &amp;#34;2012-10-17&amp;#34;,
  &amp;#34;Statement&amp;#34;: [
    {
      &amp;#34;Action&amp;#34;: [&amp;#34;oam:ListSinks&amp;#34;, &amp;#34;oam:ListAttachedLinks&amp;#34;],
      &amp;#34;Effect&amp;#34;: &amp;#34;Allow&amp;#34;,
      &amp;#34;Resource&amp;#34;: &amp;#34;*&amp;#34;
    }
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;configure-cloudwatch-settings&#34;&gt;Configure CloudWatch settings&lt;/h3&gt;
&lt;h4 id=&#34;namespaces-of-custom-metrics&#34;&gt;Namespaces of Custom Metrics&lt;/h4&gt;
&lt;p&gt;Grafana can&amp;rsquo;t load custom namespaces through the CloudWatch &lt;a href=&#34;https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;GetMetricData API&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To make custom metrics appear in the data source&amp;rsquo;s query editor fields, specify the names of the namespaces containing the custom metrics in the data source configuration&amp;rsquo;s &lt;em&gt;Namespaces of Custom Metrics&lt;/em&gt; field.
The field accepts multiple namespaces separated by commas.&lt;/p&gt;
&lt;h4 id=&#34;timeout&#34;&gt;Timeout&lt;/h4&gt;
&lt;p&gt;Configure the timeout specifically for CloudWatch Logs queries.&lt;/p&gt;
&lt;p&gt;Log queries don&amp;rsquo;t keep a single request open, and instead periodically poll for results.
Therefore, they don&amp;rsquo;t recognize the standard Grafana query timeout.
Because of limits on concurrently running queries in CloudWatch, they can also take longer to finish.&lt;/p&gt;
&lt;h4 id=&#34;x-ray-trace-links&#34;&gt;X-Ray trace links&lt;/h4&gt;
&lt;p&gt;To automatically add links in your logs when the log contains the &lt;code&gt;@xrayTraceId&lt;/code&gt; field, link an X-Ray data source in the &amp;ldquo;X-Ray trace link&amp;rdquo; section of the data source configuration.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 800px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/cloudwatch/xray-trace-link-configuration-8-2.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/cloudwatch/xray-trace-link-configuration-8-2.png&#34;data-srcset=&#34;/static/img/docs/cloudwatch/xray-trace-link-configuration-8-2.png?w=320 320w, /static/img/docs/cloudwatch/xray-trace-link-configuration-8-2.png?w=550 550w, /static/img/docs/cloudwatch/xray-trace-link-configuration-8-2.png?w=750 750w, /static/img/docs/cloudwatch/xray-trace-link-configuration-8-2.png?w=900 900w, /static/img/docs/cloudwatch/xray-trace-link-configuration-8-2.png?w=1040 1040w, /static/img/docs/cloudwatch/xray-trace-link-configuration-8-2.png?w=1240 1240w, /static/img/docs/cloudwatch/xray-trace-link-configuration-8-2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Trace link configuration&#34;width=&#34;1336&#34;height=&#34;256&#34;title=&#34;Trace link configuration&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/cloudwatch/xray-trace-link-configuration-8-2.png&#34;
            alt=&#34;Trace link configuration&#34;width=&#34;1336&#34;height=&#34;256&#34;title=&#34;Trace link configuration&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Trace link configuration&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;The data source select contains only existing data source instances of type X-Ray.
To use this feature, you must already have an X-Ray data source configured.
For details, see the &lt;a href=&#34;/grafana/plugins/grafana-x-ray-datasource/&#34;&gt;X-Ray data source docs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To view the X-Ray link, select the log row in either the Explore view or dashboard &lt;a href=&#34;../../panels-visualizations/visualizations/logs/&#34;&gt;Logs panel&lt;/a&gt; to view the log details section.&lt;/p&gt;
&lt;p&gt;To log the &lt;code&gt;@xrayTraceId&lt;/code&gt;, see the &lt;a href=&#34;https://docs.amazonaws.cn/en_us/xray/latest/devguide/xray-services.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;AWS X-Ray documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To provide the field to Grafana, your log queries must also contain the &lt;code&gt;@xrayTraceId&lt;/code&gt; field, for example by using the query &lt;code&gt;fields @message, @xrayTraceId&lt;/code&gt;.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 800px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/cloudwatch/xray-link-log-details-8-2.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/cloudwatch/xray-link-log-details-8-2.png&#34;data-srcset=&#34;/static/img/docs/cloudwatch/xray-link-log-details-8-2.png?w=320 320w, /static/img/docs/cloudwatch/xray-link-log-details-8-2.png?w=550 550w, /static/img/docs/cloudwatch/xray-link-log-details-8-2.png?w=750 750w, /static/img/docs/cloudwatch/xray-link-log-details-8-2.png?w=900 900w, /static/img/docs/cloudwatch/xray-link-log-details-8-2.png?w=1040 1040w, /static/img/docs/cloudwatch/xray-link-log-details-8-2.png?w=1240 1240w, /static/img/docs/cloudwatch/xray-link-log-details-8-2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Trace link in log details&#34;width=&#34;1562&#34;height=&#34;532&#34;title=&#34;Trace link in log details&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/cloudwatch/xray-link-log-details-8-2.png&#34;
            alt=&#34;Trace link in log details&#34;width=&#34;1562&#34;height=&#34;532&#34;title=&#34;Trace link in log details&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Trace link in log details&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;configure-the-data-source-with-grafanaini&#34;&gt;Configure the data source with grafana.ini&lt;/h3&gt;
&lt;p&gt;The Grafana &lt;a href=&#34;../../setup-grafana/configure-grafana/#aws&#34;&gt;configuration file&lt;/a&gt; includes an &lt;code&gt;AWS&lt;/code&gt; section where you can configure data source 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;Configuration option&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;allowed_auth_providers&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Specifies which authentication providers are allowed for the CloudWatch data source. The following providers are enabled by default in open-source Grafana: &lt;code&gt;default&lt;/code&gt; (AWS SDK default), keys (Access and secret key), credentials (Credentials file), ec2_IAM_role (EC2 IAM role).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;assume_role_enabled&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Allows you to disable &lt;code&gt;assume role (ARN)&lt;/code&gt; in the CloudWatch data source. The assume role (ARN) is enabled by default in open-source Grafana.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;list_metrics_page_limit&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Sets the limit of List Metrics API pages. When a custom namespace is specified in the query editor, the &lt;a href=&#34;https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;List Metrics API&lt;/a&gt; populates the &lt;em&gt;Metrics&lt;/em&gt; field and &lt;em&gt;Dimension&lt;/em&gt; fields. The API is paginated and returns up to 500 results per page, and the data source also limits the number of pages to 500 by default. This setting customizes that limit.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-examples&#34;&gt;Provisioning examples&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Using AWS SDK (default):&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;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: CloudWatch
    type: cloudwatch
    jsonData:
      authType: default
      defaultRegion: eu-west-2&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Using credentials&amp;rsquo; profile name (non-default):&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;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: CloudWatch
    type: cloudwatch
    jsonData:
      authType: credentials
      defaultRegion: eu-west-2
      customMetricsNamespaces: &amp;#39;CWAgent,CustomNameSpace&amp;#39;
      profile: secondary&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Using accessKey and secretKey:&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;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: CloudWatch
    type: cloudwatch
    jsonData:
      authType: keys
      defaultRegion: eu-west-2
    secureJsonData:
      accessKey: &amp;#39;&amp;lt;your access key&amp;gt;&amp;#39;
      secretKey: &amp;#39;&amp;lt;your secret key&amp;gt;&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Using AWS SDK Default and ARN of IAM Role to Assume:&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;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: CloudWatch
    type: cloudwatch
    jsonData:
      authType: default
      assumeRoleArn: arn:aws:iam::123456789012:root
      defaultRegion: eu-west-2&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-the-data-source&#34;&gt;Query the data source&lt;/h2&gt;
&lt;p&gt;The CloudWatch data source can query data from both CloudWatch metrics and CloudWatch Logs APIs, each with its own specialized query editor.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;query-editor/&#34;&gt;query editor documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-template-variables&#34;&gt;Use template variables&lt;/h2&gt;
&lt;p&gt;Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables.
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
Grafana refers to such variables as template variables.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;template-variables/&#34;&gt;template variables documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;import-pre-configured-dashboards&#34;&gt;Import pre-configured dashboards&lt;/h2&gt;
&lt;p&gt;The CloudWatch data source ships with curated and pre-configured dashboards for five of the most popular AWS services:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Amazon Elastic Compute Cloud:&lt;/strong&gt; &lt;code&gt;Amazon EC2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Amazon Elastic Block Store:&lt;/strong&gt; &lt;code&gt;Amazon EBS&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AWS Lambda:&lt;/strong&gt; &lt;code&gt;AWS Lambda&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Amazon CloudWatch Logs:&lt;/strong&gt; &lt;code&gt;Amazon CloudWatch Logs&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Amazon Relational Database Service:&lt;/strong&gt; &lt;code&gt;Amazon RDS&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;To import curated dashboards:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the data source&amp;rsquo;s &lt;a href=&#34;#configure-the-data-source&#34;&gt;configuration page&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the &lt;strong&gt;Dashboards&lt;/strong&gt; tab.&lt;/p&gt;
&lt;p&gt;This displays the curated selection of importable dashboards.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Import&lt;/strong&gt; for the dashboard to import.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 1020px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/v65/cloudwatch-dashboard-import.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/v65/cloudwatch-dashboard-import.png&#34;data-srcset=&#34;/static/img/docs/v65/cloudwatch-dashboard-import.png?w=320 320w, /static/img/docs/v65/cloudwatch-dashboard-import.png?w=550 550w, /static/img/docs/v65/cloudwatch-dashboard-import.png?w=750 750w, /static/img/docs/v65/cloudwatch-dashboard-import.png?w=900 900w, /static/img/docs/v65/cloudwatch-dashboard-import.png?w=1040 1040w, /static/img/docs/v65/cloudwatch-dashboard-import.png?w=1240 1240w, /static/img/docs/v65/cloudwatch-dashboard-import.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;CloudWatch dashboard import&#34;width=&#34;1020&#34;height=&#34;470&#34;title=&#34;CloudWatch dashboard import&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v65/cloudwatch-dashboard-import.png&#34;
            alt=&#34;CloudWatch dashboard import&#34;width=&#34;1020&#34;height=&#34;470&#34;title=&#34;CloudWatch dashboard import&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;CloudWatch dashboard import&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;To customize an imported dashboard:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To customize one of these dashboards, we recommend that you save it under a different name.
If you don&amp;rsquo;t, upgrading Grafana can overwrite the customized dashboard with the new version.&lt;/p&gt;
&lt;h2 id=&#34;create-queries-for-alerting&#34;&gt;Create queries for alerting&lt;/h2&gt;
&lt;p&gt;Alerting requires queries that return numeric data, which CloudWatch Logs support.
For example, you can enable alerts through the use of the &lt;code&gt;stats&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;This is also a valid query for alerting on messages that include the text &amp;ldquo;Exception&amp;rdquo;:&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;filter @message like /Exception/
    | stats count(*) as exceptionCount by bin(1h)
    | sort exceptionCount desc&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you receive an error like &lt;code&gt;input data must be a wide series but got ...&lt;/code&gt; when trying to alert on a query, make sure that your query returns valid numeric data that can be output to a Time series panel.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;For more information on Grafana alerts, refer to &lt;a href=&#34;../../alerting/&#34;&gt;Alerting&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;control-pricing&#34;&gt;Control pricing&lt;/h2&gt;
&lt;p&gt;The Amazon CloudWatch data source for Grafana uses &lt;a href=&#34;https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;ListMetrics&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&lt;code&gt;GetMetricData&lt;/code&gt;&lt;/a&gt; CloudWatch API calls to list and retrieve metrics.
Pricing for CloudWatch Logs is based on the amount of data ingested, archived, and analyzed via CloudWatch Logs Insights queries.
Each time you select a dimension in the query editor, Grafana issues a &lt;code&gt;ListMetrics&lt;/code&gt; API request.
Each time you change queries in the query editor, Grafana issues a new request to the &lt;code&gt;GetMetricData&lt;/code&gt; API.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Grafana v6.5 and higher replaced all &lt;code&gt;GetMetricStatistics&lt;/code&gt; API requests with calls to GetMetricData to provide better support for CloudWatch metric math, and enables the automatic generation of search expressions when using wildcards or disabling the &lt;code&gt;Match Exact&lt;/code&gt; option.
The &lt;code&gt;GetMetricStatistics&lt;/code&gt; API qualified for the CloudWatch API free tier, but &lt;code&gt;GetMetricData&lt;/code&gt; calls don&amp;rsquo;t.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;For more information, refer to the &lt;a href=&#34;https://aws.amazon.com/cloudwatch/pricing/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;CloudWatch pricing page&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;manage-service-quotas&#34;&gt;Manage service quotas&lt;/h2&gt;
&lt;p&gt;AWS defines quotas, or limits, for resources, actions, and items in your AWS account.
Depending on the number of queries in your dashboard and the number of users accessing the dashboard, you might reach the usage limits for various CloudWatch and CloudWatch Logs resources.
Quotas are defined per account and per region.&lt;/p&gt;
&lt;p&gt;If you use multiple regions or configured more than one CloudWatch data source to query against multiple accounts, you must request a quota increase for each account and region in which you reach the limit.&lt;/p&gt;
&lt;p&gt;To request a quota increase, visit the &lt;a href=&#34;https://console.aws.amazon.com/servicequotas/home?r#!/services/monitoring/quotas/L-5E141212&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;AWS Service Quotas console&lt;/a&gt;.
For more information, refer to the AWS documentation for &lt;a href=&#34;https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Service Quotas&lt;/a&gt; and &lt;a href=&#34;https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_limits.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;CloudWatch limits&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;cross-account-observability&#34;&gt;Cross-account observability&lt;/h2&gt;
&lt;p&gt;The CloudWatch plugin enables you to monitor and troubleshoot applications across multiple regional accounts. Using cross-account observability, you can seamlessly search, visualize and analyze metrics and logs without worrying about account boundaries.&lt;/p&gt;
&lt;p&gt;To use this feature, configure in the &lt;a href=&#34;https://aws.amazon.com/blogs/aws/new-amazon-cloudwatch-cross-account-observability/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;AWS console under Cloudwatch Settings&lt;/a&gt;, a monitoring and source account, and then add the necessary IAM permissions as described above.&lt;/p&gt;
]]></content><description>&lt;h1 id="amazon-cloudwatch-data-source">Amazon CloudWatch data source&lt;/h1>
&lt;p>Grafana ships with built-in support for Amazon CloudWatch.
This topic describes queries, templates, variables, and other configuration specific to the CloudWatch data source.&lt;/p></description></item><item><title>Azure Monitor data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/azure-monitor/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/azure-monitor/</guid><content><![CDATA[&lt;h1 id=&#34;azure-monitor-data-source&#34;&gt;Azure Monitor data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with built-in support for Azure Monitor, the Azure service to maximize the availability and performance of applications and services in the Azure Cloud.
This topic explains configuring and querying specific to the Azure Monitor data source.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the Azure Monitor data source, you can &lt;a href=&#34;#configure-the-data-source&#34;&gt;configure it&lt;/a&gt; so that your Grafana instance&amp;rsquo;s users can create queries in its &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt; when they &lt;a href=&#34;../../dashboards/build-dashboards/&#34;&gt;build dashboards&lt;/a&gt; and use &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Azure Monitor data source supports visualizing data from three Azure services:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Azure Monitor Metrics:&lt;/strong&gt; Collect numeric data from resources in your Azure account.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Azure Monitor Logs:&lt;/strong&gt; Collect log and performance data from your Azure account, and query using the Kusto Query Language (KQL).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Azure Resource Graph:&lt;/strong&gt; Query your Azure resources across subscriptions.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the Azure Monitor data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;configure-azure-active-directory-ad-authentication&#34;&gt;Configure Azure Active Directory (AD) authentication&lt;/h3&gt;
&lt;p&gt;You must create an app registration and service principal in Azure AD to authenticate the data source.
For configuration details, refer to the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#get-tenant-and-app-id-values-for-signing-in&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure documentation for service principals&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The app registration you create must have the &lt;code&gt;Reader&lt;/code&gt; role assigned on the subscription.
For more information, refer to &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal?tabs=current&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure documentation for role assignments&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you host Grafana in Azure, such as in App Service or Azure Virtual Machines, you can configure the Azure Monitor data source to use Managed Identity for secure authentication without entering credentials into Grafana.
For details, refer to &lt;a href=&#34;#configuring-using-managed-identity&#34;&gt;Configuring using Managed Identity&lt;/a&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;Name&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;Authentication&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enables Managed Identity. Selecting Managed Identity hides many of the other fields. For details, see &lt;a href=&#34;#configuring-using-managed-identity&#34;&gt;Configuring using Managed Identity&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Azure Cloud&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the national cloud for your Azure account. For most users, this is the default &amp;ldquo;Azure&amp;rdquo;. For details, see the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/active-directory/develop/authentication-national-cloud&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure documentation&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Directory (tenant) ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the directory/tenant ID for the Azure AD app registration to use for authentication. For details, see the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#get-tenant-and-app-id-values-for-signing-in&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure tenant and app ID docs&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Application (client) ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the application/client ID for the Azure AD app registration to use for authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Client secret&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the application client secret for the Azure AD app registration to use for authentication. For details, see the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal#option-2-create-a-new-application-secret&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure application secret docs&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Default subscription&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Optional)&lt;/em&gt; Sets a default subscription for template variables to use.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-examples&#34;&gt;Provisioning examples&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Azure AD App Registration (client secret):&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;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 # config file version

datasources:
  - name: Azure Monitor
    type: grafana-azure-monitor-datasource
    access: proxy
    jsonData:
      azureAuthType: clientsecret
      cloudName: azuremonitor # See table below
      tenantId: &amp;lt;tenant-id&amp;gt;
      clientId: &amp;lt;client-id&amp;gt;
      subscriptionId: &amp;lt;subscription-id&amp;gt; # Optional, default subscription
    secureJsonData:
      clientSecret: &amp;lt;client-secret&amp;gt;
    version: 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Managed Identity:&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;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 # config file version

datasources:
  - name: Azure Monitor
    type: grafana-azure-monitor-datasource
    access: proxy
    jsonData:
      azureAuthType: msi
      subscriptionId: &amp;lt;subscription-id&amp;gt; # Optional, default subscription
    version: 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;supported-cloud-names&#34;&gt;Supported cloud names&lt;/h4&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;Azure Cloud&lt;/th&gt;
              &lt;th&gt;&lt;code&gt;cloudName&lt;/code&gt; Value&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Microsoft Azure public cloud&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;azuremonitor&lt;/code&gt; (&lt;em&gt;Default&lt;/em&gt;)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Microsoft Chinese national cloud&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;chinaazuremonitor&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;US Government cloud&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;govazuremonitor&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;configure-managed-identity&#34;&gt;Configure Managed Identity&lt;/h3&gt;
&lt;p&gt;If you host Grafana in Azure, such as an App Service or with Azure Virtual Machines, and have managed identity enabled on your VM, you can use managed identity to configure Azure Monitor in Grafana.
This lets you securely authenticate data sources without manually configuring credentials via Azure AD App Registrations for each.
For details on Azure managed identities, refer to the &lt;a href=&#34;https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Azure documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To enable managed identity for Grafana:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Set the &lt;code&gt;managed_identity_enabled&lt;/code&gt; flag in the &lt;code&gt;[azure]&lt;/code&gt; section of the &lt;a href=&#34;../../setup-grafana/configure-grafana/#azure&#34;&gt;Grafana server configuration&lt;/a&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;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;[azure]
managed_identity_enabled = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the Azure Monitor data source configuration, set &lt;strong&gt;Authentication&lt;/strong&gt; to &lt;strong&gt;Managed Identity&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This hides the directory ID, application ID, and client secret fields, and the data source uses managed identity to authenticate to Azure Monitor Metrics and Logs, and Azure Resource Graph.&lt;/p&gt;
&lt;figure
       class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
       style=&#34;max-width: 800px;&#34;
       itemprop=&#34;associatedMedia&#34;
       itemscope=&#34;&#34;
       itemtype=&#34;http://schema.org/ImageObject&#34;
     &gt;&lt;a
           class=&#34;lightbox-link captioned&#34;
           href=&#34;/static/img/docs/azure-monitor/managed-identity.png&#34;
           itemprop=&#34;contentUrl&#34;
         &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
             class=&#34;lazyload mb-0&#34;
             data-src=&#34;/static/img/docs/azure-monitor/managed-identity.png&#34;data-srcset=&#34;/static/img/docs/azure-monitor/managed-identity.png?w=320 320w, /static/img/docs/azure-monitor/managed-identity.png?w=550 550w, /static/img/docs/azure-monitor/managed-identity.png?w=750 750w, /static/img/docs/azure-monitor/managed-identity.png?w=900 900w, /static/img/docs/azure-monitor/managed-identity.png?w=1040 1040w, /static/img/docs/azure-monitor/managed-identity.png?w=1240 1240w, /static/img/docs/azure-monitor/managed-identity.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Azure Monitor Metrics screenshot showing Dimensions&#34;width=&#34;930&#34;height=&#34;713&#34;title=&#34;Azure Monitor Metrics screenshot showing Dimensions&#34;/&gt;
           &lt;noscript&gt;
             &lt;img
               src=&#34;/static/img/docs/azure-monitor/managed-identity.png&#34;
               alt=&#34;Azure Monitor Metrics screenshot showing Dimensions&#34;width=&#34;930&#34;height=&#34;713&#34;title=&#34;Azure Monitor Metrics screenshot showing Dimensions&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
           &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Azure Monitor Metrics screenshot showing Dimensions&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;query-the-data-source&#34;&gt;Query the data source&lt;/h2&gt;
&lt;p&gt;The Azure Monitor data source can query data from Azure Monitor Metrics and Logs, and the Azure Resource Graph, each with its own specialized query editor.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;query-editor/&#34;&gt;query editor documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-template-variables&#34;&gt;Use template variables&lt;/h2&gt;
&lt;p&gt;Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables.
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
Grafana refers to such variables as template variables.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;template-variables/&#34;&gt;template variables documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;application-insights-and-insights-analytics-removed&#34;&gt;Application Insights and Insights Analytics (removed))&lt;/h2&gt;
&lt;p&gt;Until Grafana v8.0, you could query the same Azure Application Insights data using Application Insights and Insights Analytics.&lt;/p&gt;
&lt;p&gt;These queries were deprecated in Grafana v7.5. In Grafana v8.0, Application Insights and Insights Analytics were made read-only in favor of querying this data through Metrics and Logs. These query methods were completely removed in Grafana v9.0.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re upgrading from a Grafana version prior to v9.0 and relied on Application Insights and Analytics queries, refer to the &lt;a href=&#34;/docs/grafana/v9.0/datasources/azuremonitor/deprecated-application-insights/&#34;&gt;Grafana v9.0 documentation&lt;/a&gt; for help migrating these queries to Metrics and Logs queries.&lt;/p&gt;
]]></content><description>&lt;h1 id="azure-monitor-data-source">Azure Monitor data source&lt;/h1>
&lt;p>Grafana ships with built-in support for Azure Monitor, the Azure service to maximize the availability and performance of applications and services in the Azure Cloud.
This topic explains configuring and querying specific to the Azure Monitor data source.&lt;/p></description></item><item><title>Elasticsearch data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/elasticsearch/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/elasticsearch/</guid><content><![CDATA[&lt;h1 id=&#34;elasticsearch-data-source&#34;&gt;Elasticsearch data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with built-in support for Elasticsearch.
You can make many types of queries to visualize logs or metrics stored in Elasticsearch, and annotate graphs with log events stored in Elasticsearch.&lt;/p&gt;
&lt;p&gt;This topic explains configuring and querying specific to the Elasticsearch data source.
For general documentation on querying data sources in Grafana, see &lt;a href=&#34;../../panels-visualizations/query-transform-data/&#34;&gt;Query and transform data&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the Elasticsearch data source, you can &lt;a href=&#34;#configure-the-data-source&#34;&gt;configure it&lt;/a&gt; so that your Grafana instance&amp;rsquo;s users can create queries in its &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt; when they &lt;a href=&#34;../../dashboards/build-dashboards/&#34;&gt;build dashboards&lt;/a&gt; and use &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;supported-elasticsearch-versions&#34;&gt;Supported Elasticsearch versions&lt;/h2&gt;
&lt;p&gt;This data source supports these versions of Elasticsearch:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;v7.10&#43;&lt;/li&gt;
&lt;li&gt;v8.x&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the Elasticsearch data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options carefully:&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;Name&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;Sets the name you use to 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;Sets the data source that&amp;rsquo;s pre-selected 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;Sets the HTTP protocol, IP, and port of your Elasticsearch server.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Access&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Don&amp;rsquo;t modify Access. Use &amp;ldquo;Server (default)&amp;rdquo; or the data source won&amp;rsquo;t work.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;You must also configure settings specific to the Elasticsearch data source.&lt;/p&gt;
&lt;h3 id=&#34;index-settings&#34;&gt;Index settings&lt;/h3&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--right&#34;
    style=&#34;max-width: 500px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/elasticsearch/elasticsearch-ds-details-7-4.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/elasticsearch/elasticsearch-ds-details-7-4.png&#34;data-srcset=&#34;/static/img/docs/elasticsearch/elasticsearch-ds-details-7-4.png?w=320 320w, /static/img/docs/elasticsearch/elasticsearch-ds-details-7-4.png?w=550 550w, /static/img/docs/elasticsearch/elasticsearch-ds-details-7-4.png?w=750 750w, /static/img/docs/elasticsearch/elasticsearch-ds-details-7-4.png?w=900 900w, /static/img/docs/elasticsearch/elasticsearch-ds-details-7-4.png?w=1040 1040w, /static/img/docs/elasticsearch/elasticsearch-ds-details-7-4.png?w=1240 1240w, /static/img/docs/elasticsearch/elasticsearch-ds-details-7-4.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Elasticsearch data source details&#34;width=&#34;663&#34;height=&#34;118&#34;title=&#34;Elasticsearch data source details&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/elasticsearch/elasticsearch-ds-details-7-4.png&#34;
            alt=&#34;Elasticsearch data source details&#34;width=&#34;663&#34;height=&#34;118&#34;title=&#34;Elasticsearch data source details&#34;class=&#34;docs-image--right&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Elasticsearch data source details&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Use the index settings to specify a default for the &lt;code&gt;time field&lt;/code&gt; and your Elasticsearch index&amp;rsquo;s name.
You can use a time pattern, such as &lt;code&gt;YYYY.MM.DD&lt;/code&gt;, or a wildcard for the index name.&lt;/p&gt;
&lt;h3 id=&#34;elasticsearch-version&#34;&gt;Elasticsearch version&lt;/h3&gt;
&lt;p&gt;Select the version of your Elasticsearch data source from the version selection dropdown.
Different versions provide different query compositions and functionalities in the &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt;.
Available Elasticsearch versions are &lt;code&gt;2.x&lt;/code&gt;, &lt;code&gt;5.x&lt;/code&gt;, &lt;code&gt;5.6&#43;&lt;/code&gt;, &lt;code&gt;6.0&#43;&lt;/code&gt;, &lt;code&gt;7.0&#43;&lt;/code&gt;, &lt;code&gt;7.7&#43;&lt;/code&gt;, and &lt;code&gt;7.10&#43;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Grafana assumes you&amp;rsquo;re running the lowest possible version for a specified range.
This ensures that new features or breaking changes in a future Elasticsearch release don&amp;rsquo;t affect your configuration.&lt;/p&gt;
&lt;p&gt;For example, if you run Elasticsearch &lt;code&gt;7.6.1&lt;/code&gt; and select &lt;code&gt;7.0&#43;&lt;/code&gt;, and a new feature is made available for Elasticsearch &lt;code&gt;7.5.0&lt;/code&gt; or newer releases, then a &lt;code&gt;7.5&#43;&lt;/code&gt; option will be available.
However, your configuration won&amp;rsquo;t be affected until you explicitly select the new &lt;code&gt;7.5&#43;&lt;/code&gt; option in your settings.&lt;/p&gt;
&lt;h3 id=&#34;configure-min-time-interval&#34;&gt;Configure Min time interval&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Min time interval&lt;/strong&gt; setting defines a lower limit for the auto group-by time interval.&lt;/p&gt;
&lt;p&gt;This value &lt;em&gt;must&lt;/em&gt; be formatted as a number followed by a valid time identifier:&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;Identifier&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;y&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;year&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;month&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;week&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;day&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;hour&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;minute&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;s&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;second&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;ms&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;millisecond&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;We recommend setting this value to match your Elasticsearch write frequency.
For example, set this to &lt;code&gt;1m&lt;/code&gt; if Elasticsearch writes data every minute.&lt;/p&gt;
&lt;p&gt;You can also override this setting in a dashboard panel under its data source options.&lt;/p&gt;
&lt;h3 id=&#34;x-pack-enabled&#34;&gt;X-Pack enabled&lt;/h3&gt;
&lt;p&gt;Toggle this to enable &lt;code&gt;X-Pack&lt;/code&gt;-specific features and options, which provide the &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt; with additional aggregations, such as &lt;code&gt;Rate&lt;/code&gt; and &lt;code&gt;Top Metrics&lt;/code&gt;.&lt;/p&gt;
&lt;h4 id=&#34;include-frozen-indices&#34;&gt;Include frozen indices&lt;/h4&gt;
&lt;p&gt;When the &amp;ldquo;X-Pack enabled&amp;rdquo; setting is active and the configured Elasticsearch version is higher than &lt;code&gt;6.6.0&lt;/code&gt;, you can configure Grafana to not ignore &lt;a href=&#34;https://www.elastic.co/guide/en/elasticsearch/reference/7.13/frozen-indices.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;frozen indices&lt;/a&gt; when performing search requests.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Frozen indices are &lt;a href=&#34;https://www.elastic.co/guide/en/elasticsearch/reference/7.17/frozen-indices.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;deprecated in Elasticsearch&lt;/a&gt; since v7.14.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h3 id=&#34;logs&#34;&gt;Logs&lt;/h3&gt;
&lt;p&gt;You can optionally configure the two Logs parameters &lt;strong&gt;Message field name&lt;/strong&gt; and &lt;strong&gt;Level field name&lt;/strong&gt; to determine which fields the data source uses for log messages and log levels when visualizing logs in &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For example, if you&amp;rsquo;re using a default setup of Filebeat for shipping logs to Elasticsearch, set:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Message field name:&lt;/strong&gt; &lt;code&gt;message&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Level field name:&lt;/strong&gt; &lt;code&gt;fields.level&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;data-links&#34;&gt;Data links&lt;/h3&gt;
&lt;p&gt;Data links create a link from a specified field that can be accessed in Explore&amp;rsquo;s logs view.&lt;/p&gt;
&lt;p&gt;Each data link configuration consists of:&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;Parameter&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;Field&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the name of the field used by the data link.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;URL/query&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the full link URL if the link is external. If the link is internal, this input serves as a query for the target data source.&lt;br/&gt;In both cases, you can interpolate the value from the field with the &lt;code&gt;${__value.raw }&lt;/code&gt; macro.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;URL Label&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;(Optional) Sets a custom display label for the link. The link label defaults to the full external URL or name of the linked internal data source and is overridden by this setting.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Internal link&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets whether the link is internal or external. For an internal link, you can select the target data source with a data source selector. This supports only tracing data sources.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;configure-amazon-elasticsearch-service&#34;&gt;Configure Amazon Elasticsearch Service&lt;/h3&gt;
&lt;p&gt;If you use Amazon Elasticsearch Service, you can use Grafana&amp;rsquo;s Elasticsearch data source to visualize data from it.&lt;/p&gt;
&lt;p&gt;If you use an AWS Identity and Access Management (IAM) policy to control access to your Amazon Elasticsearch Service domain, you must use AWS Signature Version 4 (AWS SigV4) to sign all requests to that domain.&lt;/p&gt;
&lt;p&gt;For details on AWS SigV4, refer to the &lt;a href=&#34;https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;AWS documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;aws-signature-version-4-authentication&#34;&gt;AWS Signature Version 4 authentication&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Available in Grafana v7.3 and higher.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;To sign requests to your Amazon Elasticsearch Service domain, you can enable SigV4 in Grafana&amp;rsquo;s &lt;a href=&#34;../../setup-grafana/configure-grafana/#sigv4_auth_enabled&#34;&gt;configuration&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once AWS SigV4 is enabled, you can configure it on the Elasticsearch data source configuration page.
For more information about AWS authentication options, refer to &lt;a href=&#34;../aws-cloudwatch/aws-authentication/&#34;&gt;AWS authentication&lt;/a&gt;.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 500px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/v73/elasticsearch-sigv4-config-editor.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/v73/elasticsearch-sigv4-config-editor.png&#34;data-srcset=&#34;/static/img/docs/v73/elasticsearch-sigv4-config-editor.png?w=320 320w, /static/img/docs/v73/elasticsearch-sigv4-config-editor.png?w=550 550w, /static/img/docs/v73/elasticsearch-sigv4-config-editor.png?w=750 750w, /static/img/docs/v73/elasticsearch-sigv4-config-editor.png?w=900 900w, /static/img/docs/v73/elasticsearch-sigv4-config-editor.png?w=1040 1040w, /static/img/docs/v73/elasticsearch-sigv4-config-editor.png?w=1240 1240w, /static/img/docs/v73/elasticsearch-sigv4-config-editor.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;SigV4 configuration for AWS Elasticsearch Service&#34;width=&#34;759&#34;height=&#34;886&#34;title=&#34;SigV4 configuration for AWS Elasticsearch Service&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v73/elasticsearch-sigv4-config-editor.png&#34;
            alt=&#34;SigV4 configuration for AWS Elasticsearch Service&#34;width=&#34;759&#34;height=&#34;886&#34;title=&#34;SigV4 configuration for AWS Elasticsearch Service&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;SigV4 configuration for AWS Elasticsearch Service&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-examples&#34;&gt;Provisioning examples&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Basic provisioning:&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;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: Elastic
    type: elasticsearch
    access: proxy
    database: &amp;#39;[metrics-]YYYY.MM.DD&amp;#39;
    url: http://localhost:9200
    jsonData:
      interval: Daily
      timeField: &amp;#39;@timestamp&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Provision for logs:&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;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: elasticsearch-v7-filebeat
    type: elasticsearch
    access: proxy
    database: &amp;#39;[filebeat-]YYYY.MM.DD&amp;#39;
    url: http://localhost:9200
    jsonData:
      interval: Daily
      timeField: &amp;#39;@timestamp&amp;#39;
      esVersion: &amp;#39;7.0.0&amp;#39;
      logMessageField: message
      logLevelField: fields.level
      dataLinks:
        - datasourceUid: my_jaeger_uid # Target UID needs to be known
          field: traceID
          url: &amp;#39;$${__value.raw}&amp;#39; # Careful about the double &amp;#34;$$&amp;#34; because of env var expansion&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-the-data-source&#34;&gt;Query the data source&lt;/h2&gt;
&lt;p&gt;You can select multiple metrics and group by multiple terms or filters when using the Elasticsearch query editor.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;query-editor/&#34;&gt;query editor documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-template-variables&#34;&gt;Use template variables&lt;/h2&gt;
&lt;p&gt;Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables.
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
Grafana refers to such variables as template variables.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;template-variables/&#34;&gt;template variables documentation&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="elasticsearch-data-source">Elasticsearch data source&lt;/h1>
&lt;p>Grafana ships with built-in support for Elasticsearch.
You can make many types of queries to visualize logs or metrics stored in Elasticsearch, and annotate graphs with log events stored in Elasticsearch.&lt;/p></description></item><item><title>Google Cloud Monitoring data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/google-cloud-monitoring/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/google-cloud-monitoring/</guid><content><![CDATA[&lt;h1 id=&#34;google-cloud-monitoring-data-source&#34;&gt;Google Cloud Monitoring data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with built-in support for Google Cloud Monitoring.
This topic describes queries, templates, variables, and other configuration specific to the Google Cloud Monitoring data source.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Before Grafana v7.1, Google Cloud Monitoring was referred to as Google Stackdriver.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the Google Cloud Monitoring data source, you can &lt;a href=&#34;#configure-the-data-source&#34;&gt;configure it&lt;/a&gt; so that your Grafana instance&amp;rsquo;s users can create queries in its &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt; and apply &lt;a href=&#34;#annotations&#34;&gt;annotations&lt;/a&gt; when they &lt;a href=&#34;../../dashboards/build-dashboards/&#34;&gt;build dashboards&lt;/a&gt; and use &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Google Cloud Monitoring&lt;/strong&gt; data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options carefully:&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;Name&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;Sets the name you use to 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;Sets whether the data source is pre-selected for new panels.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;configure-google-authentication&#34;&gt;Configure Google authentication&lt;/h3&gt;
&lt;p&gt;Before you can request data from Google Cloud Monitoring, you must configure authentication.
All requests to Google APIs are performed on the server-side by the Grafana backend.&lt;/p&gt;
&lt;p&gt;For authentication options and configuration details, refer to &lt;a href=&#34;google-authentication/&#34;&gt;Google authentication&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When configuring Google authentication, note these additional Google Cloud Monitoring-specific steps:&lt;/p&gt;
&lt;h4 id=&#34;configure-a-gcp-service-account&#34;&gt;Configure a GCP Service Account&lt;/h4&gt;
&lt;p&gt;When you &lt;a href=&#34;google-authentication/#create-a-gcp-service-account-and-key-file&#34;&gt;create a Google Cloud Platform (GCP) Service Account and key file&lt;/a&gt;, the Service Account must have the &lt;strong&gt;Monitoring Viewer&lt;/strong&gt; role (&lt;strong&gt;Role &amp;gt; Select a role &amp;gt; Monitoring &amp;gt; Monitoring Viewer&lt;/strong&gt;):&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 600px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/v71/cloudmonitoring_service_account_choose_role.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/v71/cloudmonitoring_service_account_choose_role.png&#34;data-srcset=&#34;/static/img/docs/v71/cloudmonitoring_service_account_choose_role.png?w=320 320w, /static/img/docs/v71/cloudmonitoring_service_account_choose_role.png?w=550 550w, /static/img/docs/v71/cloudmonitoring_service_account_choose_role.png?w=750 750w, /static/img/docs/v71/cloudmonitoring_service_account_choose_role.png?w=900 900w, /static/img/docs/v71/cloudmonitoring_service_account_choose_role.png?w=1040 1040w, /static/img/docs/v71/cloudmonitoring_service_account_choose_role.png?w=1240 1240w, /static/img/docs/v71/cloudmonitoring_service_account_choose_role.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Choose role&#34;width=&#34;1076&#34;height=&#34;743&#34;title=&#34;Choose role&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v71/cloudmonitoring_service_account_choose_role.png&#34;
            alt=&#34;Choose role&#34;width=&#34;1076&#34;height=&#34;743&#34;title=&#34;Choose role&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Choose role&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h4 id=&#34;grant-the-gce-default-service-account-scope&#34;&gt;Grant the GCE Default Service Account scope&lt;/h4&gt;
&lt;p&gt;If Grafana is running on a Google Compute Engine (GCE) virtual machine, then when you &lt;a href=&#34;google-authentication/#configure-a-gce-default-service-account&#34;&gt;Configure a GCE Default Service Account&lt;/a&gt;, you must also grant that Service Account access to the &amp;ldquo;Cloud Monitoring API&amp;rdquo; scope.&lt;/p&gt;
&lt;h3 id=&#34;enable-necessary-google-cloud-platform-apis&#34;&gt;Enable necessary Google Cloud Platform APIs&lt;/h3&gt;
&lt;p&gt;Before you can request data from Google Cloud Monitoring, you must first enable necessary APIs on the Google end.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open the Monitoring and Cloud Resource Manager API pages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://console.cloud.google.com/apis/library/monitoring.googleapis.com&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Monitoring API&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://console.cloud.google.com/apis/library/cloudresourcemanager.googleapis.com&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Cloud Resource Manager API&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On each page, click the &lt;code&gt;Enable&lt;/code&gt; button.&lt;/p&gt;
&lt;figure
       class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
       style=&#34;max-width: 450px;&#34;
       itemprop=&#34;associatedMedia&#34;
       itemscope=&#34;&#34;
       itemtype=&#34;http://schema.org/ImageObject&#34;
     &gt;&lt;a
           class=&#34;lightbox-link captioned&#34;
           href=&#34;/static/img/docs/v71/cloudmonitoring_enable_api.png&#34;
           itemprop=&#34;contentUrl&#34;
         &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
             class=&#34;lazyload mb-0&#34;
             data-src=&#34;/static/img/docs/v71/cloudmonitoring_enable_api.png&#34;data-srcset=&#34;/static/img/docs/v71/cloudmonitoring_enable_api.png?w=320 320w, /static/img/docs/v71/cloudmonitoring_enable_api.png?w=550 550w, /static/img/docs/v71/cloudmonitoring_enable_api.png?w=750 750w, /static/img/docs/v71/cloudmonitoring_enable_api.png?w=900 900w, /static/img/docs/v71/cloudmonitoring_enable_api.png?w=1040 1040w, /static/img/docs/v71/cloudmonitoring_enable_api.png?w=1240 1240w, /static/img/docs/v71/cloudmonitoring_enable_api.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Enable GCP APIs&#34;width=&#34;696&#34;height=&#34;373&#34;title=&#34;Enable GCP APIs&#34;/&gt;
           &lt;noscript&gt;
             &lt;img
               src=&#34;/static/img/docs/v71/cloudmonitoring_enable_api.png&#34;
               alt=&#34;Enable GCP APIs&#34;width=&#34;696&#34;height=&#34;373&#34;title=&#34;Enable GCP APIs&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
           &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Enable GCP APIs&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-examples&#34;&gt;Provisioning examples&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Using the JWT (Service Account key file) authentication type:&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;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: Google Cloud Monitoring
    type: stackdriver
    access: proxy
    jsonData:
      tokenUri: https://oauth2.googleapis.com/token
      clientEmail: stackdriver@myproject.iam.gserviceaccount.com
      authenticationType: jwt
      defaultProject: my-project-name
    secureJsonData:
      privateKey: |
        -----BEGIN PRIVATE KEY-----
        POSEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCb1u1Srw8ICYHS
        ...
        yA&amp;#43;23427282348234=
        -----END PRIVATE KEY-----&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Using GCE Default Service Account authentication:&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;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: Google Cloud Monitoring
    type: stackdriver
    access: proxy
    jsonData:
      authenticationType: gce&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;import-pre-configured-dashboards&#34;&gt;Import pre-configured dashboards&lt;/h2&gt;
&lt;p&gt;The Google Cloud Monitoring data source ships with pre-configured dashboards for some of the most popular GCP services.
These curated dashboards are based on similar dashboards in the GCP dashboard samples repository.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 650px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/google-cloud-monitoring/curated-dashboards-7-4.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/google-cloud-monitoring/curated-dashboards-7-4.png&#34;data-srcset=&#34;/static/img/docs/google-cloud-monitoring/curated-dashboards-7-4.png?w=320 320w, /static/img/docs/google-cloud-monitoring/curated-dashboards-7-4.png?w=550 550w, /static/img/docs/google-cloud-monitoring/curated-dashboards-7-4.png?w=750 750w, /static/img/docs/google-cloud-monitoring/curated-dashboards-7-4.png?w=900 900w, /static/img/docs/google-cloud-monitoring/curated-dashboards-7-4.png?w=1040 1040w, /static/img/docs/google-cloud-monitoring/curated-dashboards-7-4.png?w=1240 1240w, /static/img/docs/google-cloud-monitoring/curated-dashboards-7-4.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Curated dashboards for Google Cloud Monitoring&#34;width=&#34;932&#34;height=&#34;668&#34;title=&#34;Curated dashboards for Google Cloud Monitoring&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/google-cloud-monitoring/curated-dashboards-7-4.png&#34;
            alt=&#34;Curated dashboards for Google Cloud Monitoring&#34;width=&#34;932&#34;height=&#34;668&#34;title=&#34;Curated dashboards for Google Cloud Monitoring&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Curated dashboards for Google Cloud Monitoring&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;To import curated dashboards:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the data source&amp;rsquo;s &lt;a href=&#34;#configure-the-data-source&#34;&gt;configuration page&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the &lt;strong&gt;Dashboards&lt;/strong&gt; tab.&lt;/p&gt;
&lt;p&gt;This displays the curated selection of importable dashboards.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Import&lt;/strong&gt; for the dashboard to import.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The dashboards include a &lt;a href=&#34;template-variables/&#34;&gt;template variable&lt;/a&gt; populated with the projects accessible by the configured &lt;a href=&#34;google-authentication/&#34;&gt;Service Account&lt;/a&gt; each time you load the dashboard.
After Grafana loads the dashboard, you can select a project from the dropdown list.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To customize an imported dashboard:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To customize one of these dashboards, we recommend that you save it under a different name.
If you don&amp;rsquo;t, upgrading Grafana can overwrite the customized dashboard with the new version.&lt;/p&gt;
&lt;h2 id=&#34;query-the-data-source&#34;&gt;Query the data source&lt;/h2&gt;
&lt;p&gt;The Google Cloud Monitoring query editor helps you build two types of queries: &lt;strong&gt;Metric&lt;/strong&gt; and &lt;strong&gt;Service Level Objective (SLO)&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;For details, refer to the &lt;a href=&#34;query-editor/&#34;&gt;query editor documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-template-variables&#34;&gt;Use template variables&lt;/h2&gt;
&lt;p&gt;Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables.
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
Grafana refers to such variables as template variables.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;template-variables/&#34;&gt;template variables documentation&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="google-cloud-monitoring-data-source">Google Cloud Monitoring data source&lt;/h1>
&lt;p>Grafana ships with built-in support for Google Cloud Monitoring.
This topic describes queries, templates, variables, and other configuration specific to the Google Cloud Monitoring data source.&lt;/p></description></item><item><title>Graphite data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/graphite/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/graphite/</guid><content><![CDATA[&lt;h1 id=&#34;graphite-data-source&#34;&gt;Graphite data source&lt;/h1&gt;
&lt;p&gt;Grafana includes built-in support for Graphite.
This topic explains options, variables, querying, and other features specific to the Graphite data source, which include its feature-rich query editor.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the Graphite data source, you can &lt;a href=&#34;#configure-the-data-source&#34;&gt;configure it&lt;/a&gt; so that your Grafana instance&amp;rsquo;s users can create queries in its &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt; when they &lt;a href=&#34;../../dashboards/build-dashboards/&#34;&gt;build dashboards&lt;/a&gt; and use &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the Graphite data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options carefully:&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;Name&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;Sets the name you use to 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;Sets whether the data source is pre-selected for new panels. You can set only one default data source per organization.&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;Sets the HTTP protocol, IP, and port of your graphite-web or graphite-api installation.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Auth&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;For details, refer to &lt;a href=&#34;../../setup-grafana/configure-security/configure-authentication/&#34;&gt;Configure Authentication&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Basic Auth&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enables basic authentication to the data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;User&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the user name for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the password for basic authentication.&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;Click &lt;strong&gt;Add header&lt;/strong&gt; to add a custom HTTP header.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Header&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the custom header name.&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;Defines the custom header value.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;You can also configure settings specific to the Graphite data source:&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;Name&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 version of Graphite. If you are using Grafana Cloud Graphite, this should be set to &lt;code&gt;1.1.x&lt;/code&gt;.&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;Select your type of Graphite. If you are using Grafana Cloud Graphite, this should be set to &lt;code&gt;Default&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;integrate-with-loki&#34;&gt;Integrate with Loki&lt;/h3&gt;
&lt;p&gt;When you change the data source selection in &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;, Graphite queries are converted to Loki queries.
Grafana extracts Loki label names and values from the Graphite queries according to mappings provided in the Graphite data source configuration.
Queries using tags with &lt;code&gt;seriesByTags()&lt;/code&gt; are also transformed without any additional setup.&lt;/p&gt;
&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for lists of common configuration options and JSON data options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning data sources&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-example&#34;&gt;Provisioning example&lt;/h4&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: Graphite
    type: graphite
    access: proxy
    url: http://localhost:8080
    jsonData:
      graphiteVersion: &amp;#39;1.1&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-the-data-source&#34;&gt;Query the data source&lt;/h2&gt;
&lt;p&gt;Grafana includes a Graphite-specific query editor to help you build queries.
The query editor helps you quickly navigate the metric space, add functions, and change function parameters.
It can handle all types of Graphite queries, including complex nested queries through the use of query references.&lt;/p&gt;
&lt;p&gt;For details, refer to the &lt;a href=&#34;query-editor/&#34;&gt;query editor documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-template-variables&#34;&gt;Use template variables&lt;/h2&gt;
&lt;p&gt;Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables.
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
Grafana refers to such variables as template variables.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;template-variables/&#34;&gt;template variables documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;get-grafana-metrics-into-graphite&#34;&gt;Get Grafana metrics into Graphite&lt;/h2&gt;
&lt;p&gt;Grafana exposes metrics for Graphite on the &lt;code&gt;/metrics&lt;/code&gt; endpoint.
For detailed instructions, refer to &lt;a href=&#34;../../setup-grafana/set-up-grafana-monitoring/&#34;&gt;Internal Grafana metrics&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="graphite-data-source">Graphite data source&lt;/h1>
&lt;p>Grafana includes built-in support for Graphite.
This topic explains options, variables, querying, and other features specific to the Graphite data source, which include its feature-rich query editor.&lt;/p></description></item><item><title>InfluxDB data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/influxdb/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/influxdb/</guid><content><![CDATA[&lt;h1 id=&#34;influxdb-data-source&#34;&gt;InfluxDB data source&lt;/h1&gt;


&lt;div data-shared=&#34;influxdb/intro.md&#34;&gt;
            &lt;p&gt;&lt;a href=&#34;https://www.influxdata.com/products/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;InfluxDB&lt;/a&gt; is an open-source time series database (TSDB) developed by &lt;a href=&#34;https://www.influxdata.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;InfluxData&lt;/a&gt;. It is optimized for fast, high-availability storage and retrieval of time series data in fields such as operations monitoring, application metrics, IoT sensor data, and real-time analytics.&lt;/p&gt;
&lt;/div&gt;

        
&lt;p&gt;Grafana includes built-in support for InfluxDB.
This topic explains options, variables, querying, and other features specific to the InfluxDB data source, which include its &lt;a href=&#34;query-editor/&#34;&gt;feature-rich code editor for queries and visual query builder&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the InfluxDB data source, you can &lt;a href=&#34;#configure-the-data-source&#34;&gt;configure it&lt;/a&gt; so that your Grafana instance&amp;rsquo;s users can create queries in its &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt; when they &lt;a href=&#34;../../dashboards/build-dashboards/&#34;&gt;build dashboards&lt;/a&gt; and use &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the InfluxDB data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options carefully:&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;Name&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;Sets the name you use to refer to the data source in panels and queries. We recommend something like &lt;code&gt;InfluxDB-InfluxQL&lt;/code&gt;.&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;Sets whether the data source is pre-selected 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 InfluxDB API. InfluxDB&amp;rsquo;s default API port is 8086.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Min time interval&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Optional)&lt;/em&gt; Refer to &lt;a href=&#34;#configure-min-time-interval&#34;&gt;Min time interval&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Max series&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Optional)&lt;/em&gt; Limits the number of series and tables that Grafana processes. Lower this number to prevent abuse, and increase it if you have many small time series and not all are shown. Defaults to 1,000.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;You can also configure settings specific to the InfluxDB data source:&lt;/p&gt;
&lt;h3 id=&#34;min-time-interval&#34;&gt;Min time interval&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Min time interval&lt;/strong&gt; setting defines a lower limit for the auto group-by time interval.&lt;/p&gt;
&lt;p&gt;This value &lt;em&gt;must&lt;/em&gt; be formatted as a number followed by a valid time identifier:&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;Identifier&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;y&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;year&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;month&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;week&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;day&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;hour&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;minute&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;s&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;second&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;ms&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;millisecond&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;We recommend setting this value to match your InfluxDB write frequency.
For example, use &lt;code&gt;1m&lt;/code&gt; if InfluxDB writes data every minute.&lt;/p&gt;
&lt;p&gt;You can also override this setting in a dashboard panel under its data source options.&lt;/p&gt;
&lt;h3 id=&#34;select-a-query-language&#34;&gt;Select a query language&lt;/h3&gt;
&lt;p&gt;InfluxDB data source options differ depending on which query language you select:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.influxdata.com/influxdb/v1.8/query_language/explore-data/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;InfluxQL&lt;/a&gt;, a SQL-like language for querying InfluxDB, with statements such as SELECT, FROM, WHERE, and GROUP BY that are familiar to SQL users.
InfluxQL is available in InfluxDB 1.0 onwards.&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.influxdata.com/influxdb/v2.0/query-data/get-started/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Flux&lt;/a&gt;, which provides significantly broader functionality than InfluxQL. It supports not only queries but also built-in functions for data shaping, string manipulation, and joining to non-InfluxDB data sources, but also processing time-series data.
It&amp;rsquo;s similar to JavaScript with a functional style.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To help choose the best language for your needs, refer to a &lt;a href=&#34;https://docs.influxdata.com/influxdb/v1.8/flux/flux-vs-influxql/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;comparison of Flux vs InfluxQL&lt;/a&gt; and &lt;a href=&#34;https://www.influxdata.com/blog/why-were-building-flux-a-new-data-scripting-and-query-language/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;why InfluxData created Flux&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Though not required, we recommend that you append your query language choice to the data source&amp;rsquo;s &lt;strong&gt;Name&lt;/strong&gt; setting:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;InfluxDB-InfluxQL&lt;/li&gt;
&lt;li&gt;InfluxDB-Flux&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;
&lt;h3 id=&#34;configure-influxql&#34;&gt;Configure InfluxQL&lt;/h3&gt;
&lt;p&gt;Configure these options if you select the InfluxQL (classic InfluxDB) query language:&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;Name&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;Access&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Only Server access mode is functional. Direct browser access is deprecated.&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;Defines which cookies are forwarded to the data source. All other cookies are deleted.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Database&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the ID of the bucket to query. Copy this from the &lt;a href=&#34;https://docs.influxdata.com/influxdb/v2.0/organizations/buckets/view-buckets/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Buckets page&lt;/a&gt; of the InfluxDB UI.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;User&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the username to sign into InfluxDB.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the token you use to query the bucket defined in &lt;strong&gt;Database&lt;/strong&gt;. Copy this from the &lt;a href=&#34;https://docs.influxdata.com/influxdb/v2.0/security/tokens/view-tokens/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Tokens page&lt;/a&gt; of the InfluxDB UI.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;HTTP mode&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the HTTP method used to query your data source. The POST verb allows for larger queries that would return an error using the GET verb. Defaults to GET.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;configure-flux&#34;&gt;Configure Flux&lt;/h3&gt;
&lt;p&gt;Configure these options if you select the Flux query language:&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;Name&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;Organization&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The &lt;a href=&#34;https://v2.docs.influxdata.com/v2.0/organizations/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Influx organization&lt;/a&gt; that will be used for Flux queries. This is also used to for the &lt;code&gt;v.organization&lt;/code&gt; query macro.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Token&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The authentication token used for Flux queries. With Influx 2.0, use the &lt;a href=&#34;https://v2.docs.influxdata.com/v2.0/security/tokens/create-token/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;influx authentication token to function&lt;/a&gt;. For influx 1.8, the token is &lt;code&gt;username:password&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Default bucket&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Optional)&lt;/em&gt; The &lt;a href=&#34;https://v2.docs.influxdata.com/v2.0/organizations/buckets/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Influx bucket&lt;/a&gt; that will be used for the &lt;code&gt;v.defaultBucket&lt;/code&gt; macro in Flux queries.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-examples&#34;&gt;Provisioning examples&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;InfluxDB 1.x 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;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: InfluxDB_v1
    type: influxdb
    access: proxy
    database: site
    user: grafana
    url: http://localhost:8086
    jsonData:
      httpMode: GET
    secureJsonData:
      password: grafana&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;InfluxDB 2.x for Flux 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;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: InfluxDB_v2_Flux
    type: influxdb
    access: proxy
    url: http://localhost:8086
    jsonData:
      version: Flux
      organization: organization
      defaultBucket: bucket
      tlsSkipVerify: true
    secureJsonData:
      token: token&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;InfluxDB 2.x for InfluxQL 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;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: InfluxDB_v2_InfluxQL
    type: influxdb
    access: proxy
    url: http://localhost:8086
    # This database should be mapped to a bucket
    database: site
    jsonData:
      httpMode: GET
      httpHeaderName1: &amp;#39;Authorization&amp;#39;
    secureJsonData:
      httpHeaderValue1: &amp;#39;Token &amp;lt;token&amp;gt;&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-the-data-source&#34;&gt;Query the data source&lt;/h2&gt;
&lt;p&gt;The InfluxDB data source&amp;rsquo;s query editor has two modes, InfluxQL and Flux, depending on your choice of query language in the &lt;a href=&#34;#configure-the-data-source&#34;&gt;data source configuration&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;For details, refer to the &lt;a href=&#34;query-editor/&#34;&gt;query editor documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-template-variables&#34;&gt;Use template variables&lt;/h2&gt;
&lt;p&gt;Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables.
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
Grafana refers to such variables as template variables.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;template-variables/&#34;&gt;template variables documentation&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="influxdb-data-source">InfluxDB data source&lt;/h1>
&lt;div data-shared="influxdb/intro.md">
&lt;p>&lt;a href="https://www.influxdata.com/products/" target="_blank" rel="noopener noreferrer">InfluxDB&lt;/a> is an open-source time series database (TSDB) developed by &lt;a href="https://www.influxdata.com/" target="_blank" rel="noopener noreferrer">InfluxData&lt;/a>. It is optimized for fast, high-availability storage and retrieval of time series data in fields such as operations monitoring, application metrics, IoT sensor data, and real-time analytics.&lt;/p></description></item><item><title>Jaeger data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/jaeger/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/jaeger/</guid><content><![CDATA[&lt;h1 id=&#34;jaeger-data-source&#34;&gt;Jaeger data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with built-in support for Jaeger, which provides open source, end-to-end distributed tracing.
This topic explains configuration and queries specific to the Jaeger data source.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system.&lt;/p&gt;
&lt;p&gt;You can also &lt;a href=&#34;#upload-a-json-trace-file&#34;&gt;upload a JSON trace file&lt;/a&gt;, and &lt;a href=&#34;#link-a-trace-id-from-logs&#34;&gt;link a trace ID from logs&lt;/a&gt; in Loki.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the Jaeger data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options carefully:&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;Name&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;Sets the name you use to 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;Defines whether this data source is pre-selected 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;Sets the URL of the Jaeger instance, such as &lt;code&gt;http://localhost:16686&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Basic Auth&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enables basic authentication for the Jaeger data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;User&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the user name for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the password for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;You can also configure settings specific to the Jaeger data source:&lt;/p&gt;
&lt;h3 id=&#34;configure-trace-to-logs&#34;&gt;Configure trace to logs&lt;/h3&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 572px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/explore/traces-to-logs-settings-8-2.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/explore/traces-to-logs-settings-8-2.png&#34;data-srcset=&#34;/static/img/docs/explore/traces-to-logs-settings-8-2.png?w=320 320w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=550 550w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=750 750w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=900 900w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=1040 1040w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=1240 1240w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the trace to logs settings&#34;width=&#34;572&#34;height=&#34;342&#34;title=&#34;Screenshot of the trace to logs settings&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/explore/traces-to-logs-settings-8-2.png&#34;
            alt=&#34;Screenshot of the trace to logs settings&#34;width=&#34;572&#34;height=&#34;342&#34;title=&#34;Screenshot of the trace to logs settings&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the trace to logs settings&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Available in Grafana v7.4 and higher.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The &lt;strong&gt;Trace to logs&lt;/strong&gt; setting configures the &lt;a href=&#34;../../explore/trace-integration/&#34;&gt;trace to logs feature&lt;/a&gt; that is available when you integrate Grafana with Jaeger.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To configure trace to logs:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the target data source.&lt;/li&gt;
&lt;li&gt;Select which tags to use in the logs query. The tags you configure must be present in the spans attributes or resources for a trace to logs span link to appear.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Single tag&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Configuring &lt;code&gt;job&lt;/code&gt; as a tag and clicking on a span link will take you to your configured logs datasource with the query &lt;code&gt;{job=&#39;value from clicked span&#39;}&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiple tags&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;If multiple tags are used they will be concatenated so the logs query would look like &lt;code&gt;{job=&#39;value from clicked span&#39;, service=&#39;value from clicked span&#39;}&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mapped tags&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;For a mapped tag &lt;code&gt;service.name&lt;/code&gt; with value &lt;code&gt;service&lt;/code&gt;, clicking on a span link will take you to your configured logs datasource with the query &lt;code&gt;{service=&#39;value from clicked span&#39;}&lt;/code&gt; instead of &lt;code&gt;{service.name=&#39;value from clicked span&#39;}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;This is useful for instances where your tracing datasource tags and your logs datasource tags don&amp;rsquo;t match one-to-one.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following table describes the ways in which you can configure your trace to logs settings:&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;Name&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;Data source&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the target data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the tags to use in the logs query. Default is &lt;code&gt;&#39;cluster&#39;, &#39;hostname&#39;, &#39;namespace&#39;, &#39;pod&#39;&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Map tag names&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enables configuring how Jaeger tag names map to logs label names. For example, map &lt;code&gt;service.name&lt;/code&gt; to &lt;code&gt;service&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Span start time shift&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Shifts the start time for the logs query based on the span start time. To extend to the past, use a negative value. Use time interval units like &lt;code&gt;5s&lt;/code&gt;, &lt;code&gt;1m&lt;/code&gt;, &lt;code&gt;3h&lt;/code&gt;. Default is &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Span end time shift&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Shifts the end time for the logs query based on the span end time. Use time interval units. Default is &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter by Trace ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggles whether to append the trace ID to the logs query.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter by Span ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggles whether to append the span ID to the logs query.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;configure-trace-to-metrics&#34;&gt;Configure trace to metrics&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This feature is behind the &lt;code&gt;traceToMetrics&lt;/code&gt; &lt;a href=&#34;../../setup-grafana/configure-grafana/#feature_toggles&#34;&gt;feature toggle&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The &lt;strong&gt;Trace to metrics&lt;/strong&gt; section configures the &lt;a href=&#34;/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/&#34;&gt;trace to metrics feature&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Use the settings to select the target Prometheus data source, and create any desired linked queries.&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 name&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;Data source&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the target data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the tags used in linked queries. The key sets the span attribute name, and the optional value sets the corresponding metric label name. For example, you can map &lt;code&gt;k8s.pod&lt;/code&gt; to &lt;code&gt;pod&lt;/code&gt;. To interpolate these tags into queries, use the &lt;code&gt;$__tags&lt;/code&gt; keyword.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Each linked query consists of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Link Label:&lt;/strong&gt; &lt;em&gt;(Optional)&lt;/em&gt; Descriptive label for the linked query.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Query:&lt;/strong&gt; The query ran when navigating from a trace to the metrics data source.
Interpolate tags using the &lt;code&gt;$__tags&lt;/code&gt; keyword.
For example, when you configure the query &lt;code&gt;requests_total{$__tags}&lt;/code&gt;with the tags &lt;code&gt;k8s.pod=pod&lt;/code&gt; and &lt;code&gt;cluster&lt;/code&gt;, the result looks like &lt;code&gt;requests_total{pod=&amp;quot;nginx-554b9&amp;quot;, cluster=&amp;quot;us-east-1&amp;quot;}&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;enable-node-graph&#34;&gt;Enable Node Graph&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Node Graph&lt;/strong&gt; setting enables the &lt;a href=&#34;../../panels-visualizations/visualizations/node-graph/&#34;&gt;Node Graph visualization&lt;/a&gt;, which is disabled by default.&lt;/p&gt;
&lt;p&gt;Once enabled, Grafana displays the Node Graph after loading the trace view.&lt;/p&gt;
&lt;h3 id=&#34;configure-the-span-bar-label&#34;&gt;Configure the span bar label&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Span bar label&lt;/strong&gt; section helps you display additional information in the span bar row.&lt;/p&gt;
&lt;p&gt;You can choose one of three 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;Name&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;None&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Adds nothing to the span bar row.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Duration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Default)&lt;/em&gt; Displays the span duration on the span bar row.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tag&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Displays the span tag on the span bar row. You must also specify which tag key to use to get the tag value, such as &lt;code&gt;span.kind&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;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-examples&#34;&gt;Provisioning examples&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Using basic auth and the trace-to-logs field:&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;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: Jaeger
    type: jaeger
    uid: jaeger-spectra
    access: proxy
    url: http://localhost:16686/
    basicAuth: true
    basicAuthUser: my_user
    editable: true
    isDefault: false
    jsonData:
      tracesToLogs:
        # Field with internal link pointing to a logs data source in Grafana.
        # datasourceUid value must match the datasourceUid value of the logs data source.
        datasourceUid: &amp;#39;loki&amp;#39;
        tags: [&amp;#39;job&amp;#39;, &amp;#39;instance&amp;#39;, &amp;#39;pod&amp;#39;, &amp;#39;namespace&amp;#39;]
        mappedTags: [{ key: &amp;#39;service.name&amp;#39;, value: &amp;#39;service&amp;#39; }]
        mapTagNamesEnabled: false
        spanStartTimeShift: &amp;#39;1h&amp;#39;
        spanEndTimeShift: &amp;#39;1h&amp;#39;
        filterByTraceID: false
        filterBySpanID: false
      tracesToMetrics:
        datasourceUid: &amp;#39;prom&amp;#39;
        tags: [{ key: &amp;#39;service.name&amp;#39;, value: &amp;#39;service&amp;#39; }, { key: &amp;#39;job&amp;#39; }]
        queries:
          - name: &amp;#39;Sample query&amp;#39;
            query: &amp;#39;sum(rate(traces_spanmetrics_latency_bucket{$__tags}[5m]))&amp;#39;
    secureJsonData:
      basicAuthPassword: my_password&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-traces&#34;&gt;Query traces&lt;/h2&gt;
&lt;p&gt;You can query and display traces from Jaeger via &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 1857px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/explore/jaeger-search-form.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/explore/jaeger-search-form.png&#34;data-srcset=&#34;/static/img/docs/explore/jaeger-search-form.png?w=320 320w, /static/img/docs/explore/jaeger-search-form.png?w=550 550w, /static/img/docs/explore/jaeger-search-form.png?w=750 750w, /static/img/docs/explore/jaeger-search-form.png?w=900 900w, /static/img/docs/explore/jaeger-search-form.png?w=1040 1040w, /static/img/docs/explore/jaeger-search-form.png?w=1240 1240w, /static/img/docs/explore/jaeger-search-form.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Jaeger query editor&#34;width=&#34;1857&#34;height=&#34;733&#34;title=&#34;Screenshot of the Jaeger query editor&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/explore/jaeger-search-form.png&#34;
            alt=&#34;Screenshot of the Jaeger query editor&#34;width=&#34;1857&#34;height=&#34;733&#34;title=&#34;Screenshot of the Jaeger query editor&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Jaeger query editor&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;You can query by trace ID, or use the search form to find traces.&lt;/p&gt;
&lt;h3 id=&#34;query-by-trace-id&#34;&gt;Query by trace ID&lt;/h3&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 1855px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/explore/jaeger-trace-id.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/explore/jaeger-trace-id.png&#34;data-srcset=&#34;/static/img/docs/explore/jaeger-trace-id.png?w=320 320w, /static/img/docs/explore/jaeger-trace-id.png?w=550 550w, /static/img/docs/explore/jaeger-trace-id.png?w=750 750w, /static/img/docs/explore/jaeger-trace-id.png?w=900 900w, /static/img/docs/explore/jaeger-trace-id.png?w=1040 1040w, /static/img/docs/explore/jaeger-trace-id.png?w=1240 1240w, /static/img/docs/explore/jaeger-trace-id.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Jaeger query editor with trace ID selected&#34;width=&#34;1855&#34;height=&#34;778&#34;title=&#34;Screenshot of the Jaeger query editor with trace ID selected&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/explore/jaeger-trace-id.png&#34;
            alt=&#34;Screenshot of the Jaeger query editor with trace ID selected&#34;width=&#34;1855&#34;height=&#34;778&#34;title=&#34;Screenshot of the Jaeger query editor with trace ID selected&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Jaeger query editor with trace ID selected&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;To query by trace ID:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select &lt;strong&gt;TraceID&lt;/strong&gt; from the &lt;strong&gt;Query&lt;/strong&gt; type selector.&lt;/li&gt;
&lt;li&gt;Insert the ID into the text input.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;query-by-search&#34;&gt;Query by search&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;To search for traces:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select &lt;strong&gt;Search&lt;/strong&gt; from the &lt;strong&gt;Query&lt;/strong&gt; type selector.&lt;/li&gt;
&lt;li&gt;Fill out the search form:&lt;/li&gt;
&lt;/ol&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;Name&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;Service&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Returns a list of services.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Operation&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Populated when you select a service with related operations. Select &lt;code&gt;All&lt;/code&gt; to query all operations.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets tags with values in the &lt;a href=&#34;https://brandur.org/logfmt&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;logfmt&lt;/a&gt; format, such as &lt;code&gt;error=true db.statement=&amp;quot;select * from User&amp;quot;&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Min Duration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Filters all traces with a duration higher than the set value. Valid values are &lt;code&gt;1.2s, 100ms, 500us&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Max Duration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Filters all traces with a duration lower than the set value. Valid values are &lt;code&gt;1.2s, 100ms, 500us&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Limit&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Limits the number of traces returned.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;upload-a-json-trace-file&#34;&gt;Upload a JSON trace file&lt;/h2&gt;
&lt;p&gt;You can upload a JSON file that contains a single trace and visualize it.
If the file has multiple traces, Grafana visualizes its first trace.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 1849px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/explore/jaeger-upload-json.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/explore/jaeger-upload-json.png&#34;data-srcset=&#34;/static/img/docs/explore/jaeger-upload-json.png?w=320 320w, /static/img/docs/explore/jaeger-upload-json.png?w=550 550w, /static/img/docs/explore/jaeger-upload-json.png?w=750 750w, /static/img/docs/explore/jaeger-upload-json.png?w=900 900w, /static/img/docs/explore/jaeger-upload-json.png?w=1040 1040w, /static/img/docs/explore/jaeger-upload-json.png?w=1240 1240w, /static/img/docs/explore/jaeger-upload-json.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Jaeger data source in explore with upload selected&#34;width=&#34;1849&#34;height=&#34;548&#34;title=&#34;Screenshot of the Jaeger data source in explore with upload selected&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/explore/jaeger-upload-json.png&#34;
            alt=&#34;Screenshot of the Jaeger data source in explore with upload selected&#34;width=&#34;1849&#34;height=&#34;548&#34;title=&#34;Screenshot of the Jaeger data source in explore with upload selected&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Jaeger data source in explore with upload selected&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;trace-json-example&#34;&gt;Trace JSON example&lt;/h3&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;JSON&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-json&#34;&gt;{
  &amp;#34;data&amp;#34;: [
    {
      &amp;#34;traceID&amp;#34;: &amp;#34;2ee9739529395e31&amp;#34;,
      &amp;#34;spans&amp;#34;: [
        {
          &amp;#34;traceID&amp;#34;: &amp;#34;2ee9739529395e31&amp;#34;,
          &amp;#34;spanID&amp;#34;: &amp;#34;2ee9739529395e31&amp;#34;,
          &amp;#34;flags&amp;#34;: 1,
          &amp;#34;operationName&amp;#34;: &amp;#34;CAS&amp;#34;,
          &amp;#34;references&amp;#34;: [],
          &amp;#34;startTime&amp;#34;: 1616095319593196,
          &amp;#34;duration&amp;#34;: 1004,
          &amp;#34;tags&amp;#34;: [
            {
              &amp;#34;key&amp;#34;: &amp;#34;sampler.type&amp;#34;,
              &amp;#34;type&amp;#34;: &amp;#34;string&amp;#34;,
              &amp;#34;value&amp;#34;: &amp;#34;const&amp;#34;
            }
          ],
          &amp;#34;logs&amp;#34;: [],
          &amp;#34;processID&amp;#34;: &amp;#34;p1&amp;#34;,
          &amp;#34;warnings&amp;#34;: null
        }
      ],
      &amp;#34;processes&amp;#34;: {
        &amp;#34;p1&amp;#34;: {
          &amp;#34;serviceName&amp;#34;: &amp;#34;loki-all&amp;#34;,
          &amp;#34;tags&amp;#34;: [
            {
              &amp;#34;key&amp;#34;: &amp;#34;jaeger.version&amp;#34;,
              &amp;#34;type&amp;#34;: &amp;#34;string&amp;#34;,
              &amp;#34;value&amp;#34;: &amp;#34;Go-2.25.0&amp;#34;
            }
          ]
        }
      },
      &amp;#34;warnings&amp;#34;: null
    }
  ],
  &amp;#34;total&amp;#34;: 0,
  &amp;#34;limit&amp;#34;: 0,
  &amp;#34;offset&amp;#34;: 0,
  &amp;#34;errors&amp;#34;: null
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;link-a-trace-id-from-logs&#34;&gt;Link a trace ID from logs&lt;/h2&gt;
&lt;p&gt;You can link to a Jaeger trace from logs in &lt;a href=&#34;/docs/loki/latest/&#34;&gt;Loki&lt;/a&gt; by configuring a derived field with an internal link.&lt;/p&gt;
&lt;p&gt;For details, refer to &lt;a href=&#34;../loki/#configure-derived-fields&#34;&gt;Derived fields&lt;/a&gt; section of the &lt;a href=&#34;../loki/&#34;&gt;Loki data source&lt;/a&gt; documentation.&lt;/p&gt;
]]></content><description>&lt;h1 id="jaeger-data-source">Jaeger data source&lt;/h1>
&lt;p>Grafana ships with built-in support for Jaeger, which provides open source, end-to-end distributed tracing.
This topic explains configuration and queries specific to the Jaeger data source.&lt;/p></description></item><item><title>Loki data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/loki/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/loki/</guid><content><![CDATA[&lt;h1 id=&#34;loki-data-source&#34;&gt;Loki data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with built-in support for &lt;a href=&#34;/docs/loki/latest/&#34;&gt;Loki&lt;/a&gt;, an open-source log aggregation system by Grafana Labs.
This topic explains configuring and querying specific to the Loki data source.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the Loki data source, you can &lt;a href=&#34;#configure-the-data-source&#34;&gt;configure it&lt;/a&gt; so that your Grafana instance&amp;rsquo;s users can create queries in its &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt; when they &lt;a href=&#34;../../dashboards/build-dashboards/&#34;&gt;build dashboards&lt;/a&gt;, use &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;, and &lt;a href=&#34;query-editor/#apply-annotations&#34;&gt;annotate visualizations&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the Loki data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options carefully:&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;Name&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;Sets the name you use to 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;Sets the data source that&amp;rsquo;s pre-selected 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;Sets the HTTP protocol, IP, and port of your Loki instance, such as &lt;code&gt;http://localhost:3100&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;Defines which cookies are forwarded to the data source. Grafana Proxy deletes all other cookies.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Maximum lines&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the upper limit for the number of log lines returned by Loki. Defaults to 1,000. Lower this limit if your browser is sluggish when displaying logs in Explore.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; To troubleshoot configuration and other issues, check the log file located at &lt;code&gt;/var/log/grafana/grafana.log&lt;/code&gt; on Unix systems, or in &lt;code&gt;&amp;lt;grafana_install_dir&amp;gt;/data/log&lt;/code&gt; on other platforms and manual installations.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h3 id=&#34;configure-derived-fields&#34;&gt;Configure derived fields&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Derived Fields&lt;/strong&gt; configuration helps you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add fields parsed from the log message&lt;/li&gt;
&lt;li&gt;Add a link that uses the value of the field&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example, you can link to your tracing backend directly from your logs, or link to a user profile page if the log line contains a corresponding userId.
These links appear in the &lt;a href=&#34;../../explore/logs-integration/#labels-and-detected-fields&#34;&gt;log details&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you use Grafana Cloud, you can request modifications to this feature by &lt;a href=&#34;/profile/org#support&#34;&gt;opening a support ticket in the Cloud Portal&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Each derived field consists of:&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 name&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;Sets the field name. Displayed as a label in the log details.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Regex&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines a regular expression to evaluate on the log message and capture part of it as the value of the new field. Can contain only one capture group.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;URL/query&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the full link URL if the link is external, or a query for the target data source if the link is internal. You can interpolate the value from the field with the &lt;code&gt;${__value.raw}&lt;/code&gt; macro.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;URL Label&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Optional)&lt;/em&gt; Sets a custom display label for the link. This setting overrides the link label, which defaults to the full external URL or name of the linked internal data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Internal link&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines whether the link is internal or external. For internal links, you can select the target data source from a selector. This supports only tracing data sources.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h4 id=&#34;troubleshoot-interpolation&#34;&gt;Troubleshoot interpolation&lt;/h4&gt;
&lt;p&gt;You can use a debug section to see what your fields extract and how the URL is interpolated.
Select &lt;strong&gt;Show example log message&lt;/strong&gt; to display a text area where you can enter a log message.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 800px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/v75/loki_derived_fields_settings.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/v75/loki_derived_fields_settings.png&#34;data-srcset=&#34;/static/img/docs/v75/loki_derived_fields_settings.png?w=320 320w, /static/img/docs/v75/loki_derived_fields_settings.png?w=550 550w, /static/img/docs/v75/loki_derived_fields_settings.png?w=750 750w, /static/img/docs/v75/loki_derived_fields_settings.png?w=900 900w, /static/img/docs/v75/loki_derived_fields_settings.png?w=1040 1040w, /static/img/docs/v75/loki_derived_fields_settings.png?w=1240 1240w, /static/img/docs/v75/loki_derived_fields_settings.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the derived fields debugging&#34;width=&#34;2060&#34;height=&#34;866&#34;title=&#34;Screenshot of the derived fields debugging&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v75/loki_derived_fields_settings.png&#34;
            alt=&#34;Screenshot of the derived fields debugging&#34;width=&#34;2060&#34;height=&#34;866&#34;title=&#34;Screenshot of the derived fields debugging&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the derived fields debugging&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;The new field with the link shown in log details:&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 800px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/explore/data-link-9-4.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/explore/data-link-9-4.png&#34;data-srcset=&#34;/static/img/docs/explore/data-link-9-4.png?w=320 320w, /static/img/docs/explore/data-link-9-4.png?w=550 550w, /static/img/docs/explore/data-link-9-4.png?w=750 750w, /static/img/docs/explore/data-link-9-4.png?w=900 900w, /static/img/docs/explore/data-link-9-4.png?w=1040 1040w, /static/img/docs/explore/data-link-9-4.png?w=1240 1240w, /static/img/docs/explore/data-link-9-4.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Data link in Explore&#34;width=&#34;1838&#34;height=&#34;810&#34;title=&#34;Data link in Explore&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/explore/data-link-9-4.png&#34;
            alt=&#34;Data link in Explore&#34;width=&#34;1838&#34;height=&#34;810&#34;title=&#34;Data link in Explore&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Data link in Explore&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-examples&#34;&gt;Provisioning examples&lt;/h4&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: Loki
    type: loki
    access: proxy
    url: http://localhost:3100
    jsonData:
      maxLines: 1000&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Using basic authorization and a derived field:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You must escape the dollar (&lt;code&gt;$&lt;/code&gt;) character in YAML values because it can be used to interpolate environment variables:&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: Loki
    type: loki
    access: proxy
    url: http://localhost:3100
    basicAuth: true
    basicAuthUser: my_user
    jsonData:
      maxLines: 1000
      derivedFields:
        # Field with internal link pointing to data source in Grafana.
        # Right now, Grafana supports only Jaeger and Zipkin data sources as link targets.
        # datasourceUid value can be anything, but it should be unique across all defined data source uids.
        - datasourceUid: my_jaeger_uid
          matcherRegex: &amp;#34;traceID=(\\w&amp;#43;)&amp;#34;
          name: TraceID
          # url will be interpreted as query for the datasource
          url: &amp;#39;$${__value.raw}&amp;#39;

        # Field with external link.
        - matcherRegex: &amp;#34;traceID=(\\w&amp;#43;)&amp;#34;
          name: TraceID
          url: &amp;#39;http://localhost:16686/trace/$${__value.raw}&amp;#39;
    secureJsonData:
      basicAuthPassword: test_password&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Using a Jaeger data source:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In this example, the Jaeger data source&amp;rsquo;s &lt;code&gt;uid&lt;/code&gt; value should match the Loki data source&amp;rsquo;s &lt;code&gt;datasourceUid&lt;/code&gt; value.&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;datasources:
    - name: Jaeger
      type: jaeger
      url: http://jaeger-tracing-query:16686/
      access: proxy
      # UID should match the datasourceUid in derivedFields.
      uid: my_jaeger_uid&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-the-data-source&#34;&gt;Query the data source&lt;/h2&gt;
&lt;p&gt;The Loki data source&amp;rsquo;s query editor helps you create log and metric queries that use Loki&amp;rsquo;s query language, &lt;a href=&#34;/docs/loki/latest/logql/&#34;&gt;LogQL&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For details, refer to the &lt;a href=&#34;query-editor/&#34;&gt;query editor documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-template-variables&#34;&gt;Use template variables&lt;/h2&gt;
&lt;p&gt;Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables.
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
Grafana refers to such variables as template variables.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;template-variables/&#34;&gt;template variables documentation&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="loki-data-source">Loki data source&lt;/h1>
&lt;p>Grafana ships with built-in support for &lt;a href="/docs/loki/latest/">Loki&lt;/a>, an open-source log aggregation system by Grafana Labs.
This topic explains configuring and querying specific to the Loki data source.&lt;/p></description></item><item><title>Microsoft SQL Server data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/mssql/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/mssql/</guid><content><![CDATA[&lt;h1 id=&#34;microsoft-sql-server-data-source&#34;&gt;Microsoft SQL Server data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with built-in support for Microsoft SQL Server (MS SQL).
You can query and visualize data from any Microsoft SQL Server 2005 or newer, including Microsoft Azure SQL Database.&lt;/p&gt;
&lt;p&gt;This topic explains configuration specific to the Microsoft SQL Server data source.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the Microsoft SQL Server data source, you can &lt;a href=&#34;#configure-the-data-source&#34;&gt;configure it&lt;/a&gt; so that your Grafana instance&amp;rsquo;s users can create queries in its &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt; when they &lt;a href=&#34;../../dashboards/build-dashboards/&#34;&gt;build dashboards&lt;/a&gt; and use &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the Microsoft SQL Server data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options carefully:&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;Name&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;Sets the name you use to 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;Sets the data source that&amp;rsquo;s pre-selected for new panels.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Host&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the IP address/hostname and optional port of your MS SQL instance. Default port is 0, the driver default. You can specify multiple connection properties, such as &lt;code&gt;ApplicationIntent&lt;/code&gt;, by separating each property with a semicolon (&lt;code&gt;;&lt;/code&gt;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Database&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the name of your MS SQL database.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Authentication&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the authentication mode, either using SQL Server Authentication or Windows Authentication (single sign-on for Windows users).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;User&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the database user&amp;rsquo;s username.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the database user&amp;rsquo;s password.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Encrypt&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Determines whether to negotiate a secure SSL TCP/IP connection with the server, or to which extent. Default is &lt;code&gt;false&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Max open&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the maximum number of open connections to the database. Default is &lt;code&gt;unlimited&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Max idle&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the maximum number of connections in the idle connection pool. Default is &lt;code&gt;2&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Max lifetime&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the maximum number of seconds that the data source can reuse a connection. Default is &lt;code&gt;14400&lt;/code&gt; (4 hours).&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;You can also configure settings specific to the Microsoft SQL Server data source:&lt;/p&gt;
&lt;h3 id=&#34;min-time-interval&#34;&gt;Min time interval&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Min time interval&lt;/strong&gt; setting defines a lower limit for the &lt;a href=&#34;../../dashboards/variables/add-template-variables/#__interval&#34;&gt;&lt;code&gt;$__interval&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;../../dashboards/variables/add-template-variables/#__interval_ms&#34;&gt;&lt;code&gt;$__interval_ms&lt;/code&gt;&lt;/a&gt; variables.&lt;/p&gt;
&lt;p&gt;This value &lt;em&gt;must&lt;/em&gt; be formatted as a number followed by a valid time identifier:&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;Identifier&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;y&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;year&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;month&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;week&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;day&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;hour&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;minute&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;s&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;second&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;ms&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;millisecond&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;We recommend setting this value to match your Microsoft SQL Server write frequency.
For example, use &lt;code&gt;1m&lt;/code&gt; if Microsoft SQL Server writes data every minute.&lt;/p&gt;
&lt;p&gt;You can also override this setting in a dashboard panel under its data source options.&lt;/p&gt;
&lt;h3 id=&#34;connection-timeout&#34;&gt;Connection timeout&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Connection timeout&lt;/strong&gt; setting defines the maximum number of seconds to wait for a connection to the database before timing out. Default is 0 for no timeout.&lt;/p&gt;
&lt;h3 id=&#34;database-user-permissions&#34;&gt;Database user permissions&lt;/h3&gt;
&lt;p&gt;Grafana doesn&amp;rsquo;t validate that a query is safe, and could include any SQL statement.
For example, Microsoft SQL Server would execute destructive queries like &lt;code&gt;DELETE FROM user;&lt;/code&gt; and &lt;code&gt;DROP TABLE user;&lt;/code&gt; if the querying user has permission to do so.&lt;/p&gt;
&lt;p&gt;To protect against this, we strongly recommend that you create a specific MS SQL user with restricted permissions.&lt;/p&gt;
&lt;p&gt;Grant only &lt;code&gt;SELECT&lt;/code&gt; permissions on the specified database and tables that you want to query to the database user you specified when you added the 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;SQL&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-sql&#34;&gt;CREATE USER grafanareader WITH PASSWORD &amp;#39;password&amp;#39;
GRANT SELECT ON dbo.YourTable3 TO grafanareader&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Also, ensure that the user doesn&amp;rsquo;t have any unwanted privileges from the public role.&lt;/p&gt;
&lt;h3 id=&#34;diagnose-connection-issues&#34;&gt;Diagnose connection issues&lt;/h3&gt;
&lt;p&gt;If you use older versions of Microsoft SQL Server, such as 2008 and 2008R2, you might need to disable encryption before you can connect the data source.&lt;/p&gt;
&lt;p&gt;We recommend that you use the latest available service pack for optimal compatibility.&lt;/p&gt;
&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-example&#34;&gt;Provisioning example&lt;/h4&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: MSSQL
    type: mssql
    url: localhost:1433
    user: grafana
    jsonData:
      database: grafana
      maxOpenConns: 0 # Grafana v5.4&amp;#43;
      maxIdleConns: 2 # Grafana v5.4&amp;#43;
      connMaxLifetime: 14400 # Grafana v5.4&amp;#43;
      connectionTimeout: 0 # Grafana v9.3&amp;#43;
    secureJsonData:
      password: &amp;#39;Password!&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-the-data-source&#34;&gt;Query the data source&lt;/h2&gt;
&lt;p&gt;You can create queries with the Microsoft SQL Server data source&amp;rsquo;s query editor when editing a panel that uses a MS SQL data source.&lt;/p&gt;
&lt;p&gt;For details, refer to the &lt;a href=&#34;query-editor/&#34;&gt;query editor documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-template-variables&#34;&gt;Use template variables&lt;/h2&gt;
&lt;p&gt;Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables.
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
Grafana refers to such variables as template variables.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;template-variables/&#34;&gt;template variables documentation&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="microsoft-sql-server-data-source">Microsoft SQL Server data source&lt;/h1>
&lt;p>Grafana ships with built-in support for Microsoft SQL Server (MS SQL).
You can query and visualize data from any Microsoft SQL Server 2005 or newer, including Microsoft Azure SQL Database.&lt;/p></description></item><item><title>MySQL data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/mysql/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/mysql/</guid><content><![CDATA[&lt;h1 id=&#34;mysql-data-source&#34;&gt;MySQL data source&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;Starting from Grafana v5.1 you can name the time column &lt;em&gt;time&lt;/em&gt; in addition to earlier supported &lt;em&gt;time_sec&lt;/em&gt;. Usage of &lt;em&gt;time_sec&lt;/em&gt; will eventually be deprecated.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Grafana ships with a built-in MySQL data source plugin that allows you to query and visualize data from a MySQL compatible database.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;h3 id=&#34;data-source-options&#34;&gt;Data source 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;Name&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;Name&lt;/code&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;code&gt;Default&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Default data source means that it will be pre-selected for new panels.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Host&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The IP address/hostname and optional port of your MySQL instance.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Database&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Name of your MySQL database.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;User&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Database user&amp;rsquo;s login/username&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Password&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Database user&amp;rsquo;s password&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Session Timezone&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Specify the time zone used in the database session, such as &lt;code&gt;Europe/Berlin&lt;/code&gt; or &lt;code&gt;&#43;02:00&lt;/code&gt;. This is necessary, if the timezone of the database (or the host of the database) is set to something other than UTC. Set the value used in the session with &lt;code&gt;SET time_zone=&#39;...&#39;&lt;/code&gt;. If you leave this field empty, then the time zone is not updated. For more information, refer to the &lt;a href=&#34;https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;MySQL documentation&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Max open&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The maximum number of open connections to the database, default &lt;code&gt;unlimited&lt;/code&gt; (Grafana v5.4&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Max idle&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The maximum number of connections in the idle connection pool, default &lt;code&gt;2&lt;/code&gt; (Grafana v5.4&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Max lifetime&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The maximum amount of time in seconds a connection may be reused, default &lt;code&gt;14400&lt;/code&gt;/4 hours. This should always be lower than configured &lt;a href=&#34;https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;wait_timeout&lt;/a&gt; in MySQL (Grafana v5.4&#43;).&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;min-time-interval&#34;&gt;Min time interval&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Min time interval&lt;/strong&gt; setting defines a lower limit for the &lt;a href=&#34;../../dashboards/variables/add-template-variables/#__interval&#34;&gt;&lt;code&gt;$__interval&lt;/code&gt;&lt;/a&gt; and &lt;a href=&#34;../../dashboards/variables/add-template-variables/#__interval_ms&#34;&gt;&lt;code&gt;$__interval_ms&lt;/code&gt;&lt;/a&gt; variables.&lt;/p&gt;
&lt;p&gt;This value &lt;em&gt;must&lt;/em&gt; be formatted as a number followed by a valid time identifier:&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;Identifier&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;y&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;year&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;month&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;week&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;day&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;hour&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;minute&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;s&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;second&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;ms&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;millisecond&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;We recommend setting this value to match your MySQL write frequency.
For example, use &lt;code&gt;1m&lt;/code&gt; if MySQL writes data every minute.&lt;/p&gt;
&lt;p&gt;You can also override this setting in a dashboard panel under its data source options.&lt;/p&gt;
&lt;h3 id=&#34;database-user-permissions-important&#34;&gt;Database User Permissions (Important!)&lt;/h3&gt;
&lt;p&gt;The database user you specify when you add the data source should only be granted SELECT permissions on
the specified database and tables you want to query. Grafana does not validate that the query is safe. The query
could include any SQL statement. For example, statements like &lt;code&gt;USE otherdb;&lt;/code&gt; and &lt;code&gt;DROP TABLE user;&lt;/code&gt; would be
executed. To protect against this we &lt;strong&gt;Highly&lt;/strong&gt; recommend you create a specific mysql user with restricted permissions.&lt;/p&gt;
&lt;p&gt;Example:&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;SQL&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-sql&#34;&gt; CREATE USER &amp;#39;grafanaReader&amp;#39; IDENTIFIED BY &amp;#39;password&amp;#39;;
 GRANT SELECT ON mydatabase.mytable TO &amp;#39;grafanaReader&amp;#39;;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can use wildcards (&lt;code&gt;*&lt;/code&gt;) in place of database or table if you want to grant access to more databases and tables.&lt;/p&gt;
&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-example&#34;&gt;Provisioning example&lt;/h4&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: MySQL
    type: mysql
    url: localhost:3306
    user: grafana
    jsonData:
      database: grafana
      maxOpenConns: 0 # Grafana v5.4&amp;#43;
      maxIdleConns: 2 # Grafana v5.4&amp;#43;
      connMaxLifetime: 14400 # Grafana v5.4&amp;#43;
    secureJsonData:
      password: ${GRAFANA_MYSQL_PASSWORD}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-builder&#34;&gt;Query builder&lt;/h2&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 928px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/static/img/docs/v92/mysql_query_builder.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/static/img/docs/v92/mysql_query_builder.png&#34;data-srcset=&#34;/static/img/docs/v92/mysql_query_builder.png?w=320 320w, /static/img/docs/v92/mysql_query_builder.png?w=550 550w, /static/img/docs/v92/mysql_query_builder.png?w=750 750w, /static/img/docs/v92/mysql_query_builder.png?w=900 900w, /static/img/docs/v92/mysql_query_builder.png?w=1040 1040w, /static/img/docs/v92/mysql_query_builder.png?w=1240 1240w, /static/img/docs/v92/mysql_query_builder.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;&#34;width=&#34;928&#34;height=&#34;501&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v92/mysql_query_builder.png&#34;
            alt=&#34;&#34;width=&#34;928&#34;height=&#34;501&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;The MySQL query builder is available when editing a panel using a MySQL data source.&lt;/p&gt;
&lt;p&gt;This topic explains querying specific to the MySQL data source.
For general documentation on querying data sources in Grafana, see &lt;a href=&#34;../../panels-visualizations/query-transform-data/&#34;&gt;Query and transform data&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can run the built query by pressing the &lt;code&gt;Run query&lt;/code&gt; button in the top right corner of the editor.&lt;/p&gt;
&lt;h3 id=&#34;format&#34;&gt;Format&lt;/h3&gt;
&lt;p&gt;The response from MySQL can be formatted as either a table or as a time series. To use the time series format one of the columns must be named &lt;code&gt;time&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;dataset-and-table-selection&#34;&gt;Dataset and Table selection&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If your table or database name contains a reserved word or a &lt;a href=&#34;https://dev.mysql.com/doc/refman/8.0/en/identifiers.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;not permitted character&lt;/a&gt; the editor will put quotes around them. For example a table name like &lt;code&gt;table-name&lt;/code&gt; will be quoted with backticks &lt;code&gt;`table-name`&lt;/code&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;In the dataset dropdown, choose the MySQL database to query. The dropdown is be populated with the databases that the user has access to.
When the dataset is selected, the table dropdown is populated with the tables that are available.&lt;/p&gt;
&lt;h3 id=&#34;columns-and-aggregation-functions-select&#34;&gt;Columns and Aggregation functions (SELECT)&lt;/h3&gt;
&lt;p&gt;Using the dropdown, select a column to include in the data. You can also specify an optional aggregation function.&lt;/p&gt;
&lt;p&gt;Add further value columns by clicking the plus button and another column dropdown appears.&lt;/p&gt;
&lt;h3 id=&#34;filter-data-where&#34;&gt;Filter data (WHERE)&lt;/h3&gt;
&lt;p&gt;To add a filter, flip the switch at the top of the editor.
Using the first dropdown, select if all the filters need to match (AND) or if only one of the filters needs to match (OR).&lt;/p&gt;
&lt;p&gt;To add more columns to filter on use the plus button.&lt;/p&gt;
&lt;h3 id=&#34;group-by&#34;&gt;Group By&lt;/h3&gt;
&lt;p&gt;To group the results by column, flip the group switch at the top of the editor. You can then choose which column to group the results by. The group by clause can be removed by pressing the X button.&lt;/p&gt;
&lt;h3 id=&#34;preview&#34;&gt;Preview&lt;/h3&gt;
&lt;p&gt;By flipping the preview switch at the top of the editor, you can get a preview of the SQL query generated by the query builder.&lt;/p&gt;
&lt;h2 id=&#34;code-editor&#34;&gt;Code editor&lt;/h2&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 963px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/static/img/docs/v92/sql_code_editor.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/static/img/docs/v92/sql_code_editor.png&#34;data-srcset=&#34;/static/img/docs/v92/sql_code_editor.png?w=320 320w, /static/img/docs/v92/sql_code_editor.png?w=550 550w, /static/img/docs/v92/sql_code_editor.png?w=750 750w, /static/img/docs/v92/sql_code_editor.png?w=900 900w, /static/img/docs/v92/sql_code_editor.png?w=1040 1040w, /static/img/docs/v92/sql_code_editor.png?w=1240 1240w, /static/img/docs/v92/sql_code_editor.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;&#34;width=&#34;963&#34;height=&#34;326&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v92/sql_code_editor.png&#34;
            alt=&#34;&#34;width=&#34;963&#34;height=&#34;326&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;To make advanced queries, switch to the code editor by clicking &lt;code&gt;code&lt;/code&gt; in the top right corner of the editor. The code editor support autocompletion of tables, columns, SQL keywords, standard sql functions, Grafana template variables and Grafana macros. Columns cannot be completed before a table has been specified.&lt;/p&gt;
&lt;p&gt;You can expand the code editor by pressing the &lt;code&gt;chevron&lt;/code&gt; pointing downwards in the lower right corner of the code editor.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;CTRL/CMD &#43; Return&lt;/code&gt; works as a keyboard shortcut to run the query.&lt;/p&gt;
&lt;h2 id=&#34;macros&#34;&gt;Macros&lt;/h2&gt;
&lt;p&gt;To simplify syntax and to allow for dynamic parts, like date range filters, the query can contain macros.&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;Macro 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;code&gt;$__time(dateColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by an expression to convert to a UNIX timestamp and rename the column to &lt;code&gt;time_sec&lt;/code&gt;. For example, &lt;em&gt;UNIX_TIMESTAMP(dateColumn) as time_sec&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeEpoch(dateColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by an expression to convert to a UNIX timestamp and rename the column to &lt;code&gt;time_sec&lt;/code&gt;. For example, &lt;em&gt;UNIX_TIMESTAMP(dateColumn) as time_sec&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeFilter(dateColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by a time range filter using the specified column name. For example, &lt;em&gt;dateColumn BETWEEN FROM_UNIXTIME(1494410783) AND FROM_UNIXTIME(1494410983)&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeFrom()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the start of the currently active time selection. For example, &lt;em&gt;FROM_UNIXTIME(1494410783)&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeTo()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the end of the currently active time selection. For example, &lt;em&gt;FROM_UNIXTIME(1494410983)&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeGroup(dateColumn,&#39;5m&#39;)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by an expression usable in GROUP BY clause. For example, *cast(cast(UNIX_TIMESTAMP(dateColumn)/(300) as signed)*300 as signed),*&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeGroup(dateColumn,&#39;5m&#39;, 0)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Same as above but with a fill parameter so missing points in that series will be added by grafana and 0 will be used as value.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeGroup(dateColumn,&#39;5m&#39;, NULL)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Same as above but NULL will be used as value for missing points.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeGroup(dateColumn,&#39;5m&#39;, previous)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Same as above but the previous value in that series will be used as fill value if no value has been seen yet NULL will be used (only available in Grafana 5.3&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeGroupAlias(dateColumn,&#39;5m&#39;)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced identical to $__timeGroup but with an added column alias (only available in Grafana 5.3&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochFilter(dateColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by a time range filter using the specified column name with times represented as Unix timestamp. For example, &lt;em&gt;dateColumn &amp;gt; 1494410783 AND dateColumn &amp;lt; 1494497183&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochFrom()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the start of the currently active time selection as Unix timestamp. For example, &lt;em&gt;1494410783&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochTo()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the end of the currently active time selection as Unix timestamp. For example, &lt;em&gt;1494497183&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochNanoFilter(dateColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by a time range filter using the specified column name with times represented as nanosecond timestamp. For example, &lt;em&gt;dateColumn &amp;gt; 1494410783152415214 AND dateColumn &amp;lt; 1494497183142514872&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochNanoFrom()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the start of the currently active time selection as nanosecond timestamp. For example, &lt;em&gt;1494410783152415214&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochNanoTo()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the end of the currently active time selection as nanosecond timestamp. For example, &lt;em&gt;1494497183142514872&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochGroup(dateColumn,&#39;5m&#39;, [fillmode])&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Same as $__timeGroup but for times stored as Unix timestamp (only available in Grafana 5.3&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochGroupAlias(dateColumn,&#39;5m&#39;, [fillmode])&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Same as above but also adds a column alias (only available in Grafana 5.3&#43;).&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;We plan to add many more macros. If you have suggestions for what macros you would like to see, please &lt;a href=&#34;https://github.com/grafana/grafana&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;open an issue&lt;/a&gt; in our GitHub repo.&lt;/p&gt;
&lt;p&gt;The query editor has a link named &lt;code&gt;Generated SQL&lt;/code&gt; that shows up after a query has been executed, while in panel edit mode. Click on it and it will expand and show the raw interpolated SQL string that was executed.&lt;/p&gt;
&lt;h2 id=&#34;table-queries&#34;&gt;Table queries&lt;/h2&gt;
&lt;p&gt;If the &lt;code&gt;Format as&lt;/code&gt; query option is set to &lt;code&gt;Table&lt;/code&gt; then you can basically do any type of SQL query. The table panel will automatically show the results of whatever columns and rows your query returns.&lt;/p&gt;
&lt;p&gt;Query editor with example query:&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 1770px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/static/img/docs/v45/mysql_table_query.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/static/img/docs/v45/mysql_table_query.png&#34;data-srcset=&#34;/static/img/docs/v45/mysql_table_query.png?w=320 320w, /static/img/docs/v45/mysql_table_query.png?w=550 550w, /static/img/docs/v45/mysql_table_query.png?w=750 750w, /static/img/docs/v45/mysql_table_query.png?w=900 900w, /static/img/docs/v45/mysql_table_query.png?w=1040 1040w, /static/img/docs/v45/mysql_table_query.png?w=1240 1240w, /static/img/docs/v45/mysql_table_query.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;&#34;width=&#34;1770&#34;height=&#34;470&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v45/mysql_table_query.png&#34;
            alt=&#34;&#34;width=&#34;1770&#34;height=&#34;470&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;The query:&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;SQL&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-sql&#34;&gt;SELECT
  title as &amp;#39;Title&amp;#39;,
  user.login as &amp;#39;Created By&amp;#39; ,
  dashboard.created as &amp;#39;Created On&amp;#39;
 FROM dashboard
INNER JOIN user on user.id = dashboard.created_by
WHERE $__timeFilter(dashboard.created)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can control the name of the Table panel columns by using regular &lt;code&gt;as &lt;/code&gt; SQL column selection syntax.&lt;/p&gt;
&lt;p&gt;The resulting table panel:&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload&#34;
  data-src=&#34;/static/img/docs/v43/mysql_table.png&#34;
  alt=&#34;&#34; width=&#34;562&#34;
     height=&#34;250&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;time-series-queries&#34;&gt;Time series queries&lt;/h2&gt;
&lt;p&gt;If you set Format as to &lt;em&gt;Time series&lt;/em&gt;, then the query must have a column named time that returns either a SQL datetime or any numeric datatype representing Unix epoch in seconds. In addition, result sets of time series queries must be sorted by time for panels to properly visualize the result.&lt;/p&gt;
&lt;p&gt;A time series query result is returned in a &lt;a href=&#34;/developers/plugin-tools/introduction/data-frames#wide-format&#34;&gt;wide data frame format&lt;/a&gt;. Any column except time or of type string transforms into value fields in the data frame query result. Any string column transforms into field labels in the data frame query result.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For backward compatibility, there&amp;rsquo;s an exception to the above rule for queries that return three columns including a string column named metric. Instead of transforming the metric column into field labels, it becomes the field name, and then the series name is formatted as the value of the metric column. See the example with the metric column below.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;To optionally customize the default series name formatting, refer to &lt;a href=&#34;../../panels-visualizations/configure-standard-options/#display-name&#34;&gt;Standard options definitions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example with &lt;code&gt;metric&lt;/code&gt; column:&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;SQL&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-sql&#34;&gt;SELECT
  $__timeGroup(time_date_time,&amp;#39;5m&amp;#39;),
  min(value_double),
  &amp;#39;min&amp;#39; as metric
FROM test_data
WHERE $__timeFilter(time_date_time)
GROUP BY time
ORDER BY time&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Data frame result:&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;text&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-text&#34;&gt;&amp;#43;---------------------&amp;#43;-----------------&amp;#43;
| Name: time          | Name: min       |
| Labels:             | Labels:         |
| Type: []time.Time   | Type: []float64 |
&amp;#43;---------------------&amp;#43;-----------------&amp;#43;
| 2020-01-02 03:05:00 | 3               |
| 2020-01-02 03:10:00 | 6               |
&amp;#43;---------------------&amp;#43;-----------------&amp;#43;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Example using the fill parameter in the $__timeGroup macro to convert null values to be zero instead:&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;SQL&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-sql&#34;&gt;SELECT
  $__timeGroup(createdAt,&amp;#39;5m&amp;#39;,0),
  sum(value_double) as value,
  hostname
FROM test_data
WHERE
  $__timeFilter(createdAt)
GROUP BY time, hostname
ORDER BY time&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Given the data frame result in the following example and using the graph panel, you will get two series named &lt;em&gt;value 10.0.1.1&lt;/em&gt; and &lt;em&gt;value 10.0.1.2&lt;/em&gt;. To render the series with a name of &lt;em&gt;10.0.1.1&lt;/em&gt; and &lt;em&gt;10.0.1.2&lt;/em&gt; , use a [&lt;a href=&#34;../../panels-visualizations/configure-standard-options/#display-name&#34;&gt;Standard options definitions&lt;/a&gt; display value of &lt;code&gt;${__field.labels.hostname}&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Data frame result:&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;text&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-text&#34;&gt;&amp;#43;---------------------&amp;#43;---------------------------&amp;#43;---------------------------&amp;#43;
| Name: time          | Name: value               | Name: value               |
| Labels:             | Labels: hostname=10.0.1.1 | Labels: hostname=10.0.1.2 |
| Type: []time.Time   | Type: []float64           | Type: []float64           |
&amp;#43;---------------------&amp;#43;---------------------------&amp;#43;---------------------------&amp;#43;
| 2020-01-02 03:05:00 | 3                         | 4                         |
| 2020-01-02 03:10:00 | 6                         | 7                         |
&amp;#43;---------------------&amp;#43;---------------------------&amp;#43;---------------------------&amp;#43;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Example with multiple columns:&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;SQL&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-sql&#34;&gt;SELECT
  $__timeGroup(time_date_time,&amp;#39;5m&amp;#39;),
  min(value_double) as min_value,
  max(value_double) as max_value
FROM test_data
WHERE $__timeFilter(time_date_time)
GROUP BY time
ORDER BY time&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Data frame result:&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;text&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-text&#34;&gt;&amp;#43;---------------------&amp;#43;-----------------&amp;#43;-----------------&amp;#43;
| Name: time          | Name: min_value | Name: max_value |
| Labels:             | Labels:         | Labels:         |
| Type: []time.Time   | Type: []float64 | Type: []float64 |
&amp;#43;---------------------&amp;#43;-----------------&amp;#43;-----------------&amp;#43;
| 2020-01-02 03:04:00 | 3               | 4               |
| 2020-01-02 03:05:00 | 6               | 7               |
&amp;#43;---------------------&amp;#43;-----------------&amp;#43;-----------------&amp;#43;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Currently, there is no support for a dynamic group by time based on time range and panel width.
This is something we plan to add.&lt;/p&gt;
&lt;h2 id=&#34;templating&#34;&gt;Templating&lt;/h2&gt;
&lt;p&gt;This feature is currently available in the nightly builds and will be included in the 5.0.0 release.&lt;/p&gt;
&lt;p&gt;Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.&lt;/p&gt;
&lt;p&gt;Check out the &lt;a href=&#34;../../dashboards/variables/&#34;&gt;Templating&lt;/a&gt; documentation for an introduction to the templating feature and the different types of template variables.&lt;/p&gt;
&lt;h3 id=&#34;query-variable&#34;&gt;Query Variable&lt;/h3&gt;
&lt;p&gt;If you add a template variable of the type &lt;code&gt;Query&lt;/code&gt;, you can write a MySQL query that can
return things like measurement names, key names or key values that are shown as a dropdown select box.&lt;/p&gt;
&lt;p&gt;For example, you can have a variable that contains all values for the &lt;code&gt;hostname&lt;/code&gt; column in a table if you specify a query like this in the templating variable &lt;em&gt;Query&lt;/em&gt; setting.&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;SQL&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-sql&#34;&gt;SELECT hostname FROM my_host&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A query can return multiple columns and Grafana will automatically create a list from them. For example, the query below will return a list with values from &lt;code&gt;hostname&lt;/code&gt; and &lt;code&gt;hostname2&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;SQL&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-sql&#34;&gt;SELECT my_host.hostname, my_other_host.hostname2 FROM my_host JOIN my_other_host ON my_host.city = my_other_host.city&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To use time range dependent macros like &lt;code&gt;$__timeFilter(column)&lt;/code&gt; in your query the refresh mode of the template variable needs to be set to &lt;em&gt;On Time Range Change&lt;/em&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;SQL&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-sql&#34;&gt;SELECT event_name FROM event_log WHERE $__timeFilter(time_column)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Another option is a query that can create a key/value variable. The query should return two columns that are named &lt;code&gt;__text&lt;/code&gt; and &lt;code&gt;__value&lt;/code&gt;. The &lt;code&gt;__text&lt;/code&gt; column value should be unique (if it is not unique then the first value is used). The options in the dropdown will have a text and value that allows you to have a friendly name as text and an id as the value. An example query with &lt;code&gt;hostname&lt;/code&gt; as the text and &lt;code&gt;id&lt;/code&gt; as the value:&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;SQL&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-sql&#34;&gt;SELECT hostname AS __text, id AS __value FROM my_host&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can also create nested variables. For example if you had another variable named &lt;code&gt;region&lt;/code&gt;. Then you could have
the hosts variable only show hosts from the current selected region with a query like this (if &lt;code&gt;region&lt;/code&gt; is a multi-value variable then use the &lt;code&gt;IN&lt;/code&gt; comparison operator rather than &lt;code&gt;=&lt;/code&gt; to match against multiple values):&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;SQL&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-sql&#34;&gt;SELECT hostname FROM my_host  WHERE region IN($region)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;using-__searchfilter-to-filter-results-in-query-variable&#34;&gt;Using &lt;code&gt;__searchFilter&lt;/code&gt; to filter results in Query Variable&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Available from Grafana 6.5 and above&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Using &lt;code&gt;__searchFilter&lt;/code&gt; in the query field will filter the query result based on what the user types in the dropdown select box.
When nothing has been entered by the user the default value for &lt;code&gt;__searchFilter&lt;/code&gt; is &lt;code&gt;%&lt;/code&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Important that you surround the &lt;code&gt;__searchFilter&lt;/code&gt; expression with quotes as Grafana does not do this for you.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The example below shows how to use &lt;code&gt;__searchFilter&lt;/code&gt; as part of the query field to enable searching for &lt;code&gt;hostname&lt;/code&gt; while the user types in the dropdown select box.&lt;/p&gt;
&lt;p&gt;Query&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;SQL&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-sql&#34;&gt;SELECT hostname FROM my_host  WHERE hostname LIKE &amp;#39;$__searchFilter&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;using-variables-in-queries&#34;&gt;Using Variables in Queries&lt;/h3&gt;
&lt;p&gt;From Grafana 4.3.0 to 4.6.0, template variables are always quoted automatically so if it is a string value do not wrap them in quotes in where clauses.&lt;/p&gt;
&lt;p&gt;From Grafana 4.7.0, template variable values are only quoted when the template variable is a &lt;code&gt;multi-value&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If the variable is a multi-value variable then use the &lt;code&gt;IN&lt;/code&gt; comparison operator rather than &lt;code&gt;=&lt;/code&gt; to match against multiple values.&lt;/p&gt;
&lt;p&gt;There are two syntaxes:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$&amp;lt;varname&amp;gt;&lt;/code&gt; Example with a template variable named &lt;code&gt;hostname&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;SQL&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-sql&#34;&gt;SELECT
  UNIX_TIMESTAMP(atimestamp) as time,
  aint as value,
  avarchar as metric
FROM my_table
WHERE $__timeFilter(atimestamp) and hostname in($hostname)
ORDER BY atimestamp ASC&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;[[varname]]&lt;/code&gt; Example with a template variable named &lt;code&gt;hostname&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;SQL&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-sql&#34;&gt;SELECT
  UNIX_TIMESTAMP(atimestamp) as time,
  aint as value,
  avarchar as metric
FROM my_table
WHERE $__timeFilter(atimestamp) and hostname in([[hostname]])
ORDER BY atimestamp ASC&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;disabling-quoting-for-multi-value-variables&#34;&gt;Disabling Quoting for Multi-value Variables&lt;/h4&gt;
&lt;p&gt;Grafana automatically creates a quoted, comma-separated string for multi-value variables. For example: if &lt;code&gt;server01&lt;/code&gt; and &lt;code&gt;server02&lt;/code&gt; are selected then it will be formatted as: &lt;code&gt;&#39;server01&#39;, &#39;server02&#39;&lt;/code&gt;. Do disable quoting, use the csv formatting option for variables:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;${servers:csv}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Read more about variable formatting options in the &lt;a href=&#34;../../dashboards/variables/variable-syntax/#advanced-variable-format-options&#34;&gt;Variables&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h2 id=&#34;annotations&#34;&gt;Annotations&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;../../dashboards/build-dashboards/annotate-visualizations/&#34;&gt;Annotations&lt;/a&gt; allow you to overlay rich event information on top of graphs. You add annotation queries via the Dashboard menu / Annotations view.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example query using time column with epoch values:&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;SQL&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-sql&#34;&gt;SELECT
  epoch_time as time,
  metric1 as text,
  CONCAT(tag1, &amp;#39;,&amp;#39;, tag2) as tags
FROM
  public.test_data
WHERE
  $__unixEpochFilter(epoch_time)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Example region query using time and timeend columns with epoch values:&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Only available in Grafana v6.6&#43;.&lt;/p&gt;&lt;/blockquote&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;SQL&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-sql&#34;&gt;SELECT
  epoch_time as time,
  epoch_timeend as timeend,
  metric1 as text,
  CONCAT(tag1, &amp;#39;,&amp;#39;, tag2) as tags
FROM
  public.test_data
WHERE
  $__unixEpochFilter(epoch_time)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Example query using time column of native SQL date/time data type:&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;SQL&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-sql&#34;&gt;SELECT
  native_date_time as time,
  metric1 as text,
  CONCAT(tag1, &amp;#39;,&amp;#39;, tag2) as tags
FROM
  public.test_data
WHERE
  $__timeFilter(native_date_time)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&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;Name&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;time&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The name of the date/time field. Could be a column with a native SQL date/time data type or epoch value.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;timeend&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Optional name of the end date/time field. Could be a column with a native SQL date/time data type or epoch value. (Grafana v6.6&#43;)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;text&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Event description field.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tags&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Optional field name to use for event tags as a comma separated string.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;alerting&#34;&gt;Alerting&lt;/h2&gt;
&lt;p&gt;Time series queries should work in alerting conditions. Table formatted queries are not yet supported in alert rule conditions.&lt;/p&gt;
]]></content><description>&lt;h1 id="mysql-data-source">MySQL data source&lt;/h1>
&lt;blockquote>
&lt;p>Starting from Grafana v5.1 you can name the time column &lt;em>time&lt;/em> in addition to earlier supported &lt;em>time_sec&lt;/em>. Usage of &lt;em>time_sec&lt;/em> will eventually be deprecated.&lt;/p></description></item><item><title>OpenTSDB data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/opentsdb/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/opentsdb/</guid><content><![CDATA[&lt;h1 id=&#34;opentsdb-data-source&#34;&gt;OpenTSDB data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with advanced support for OpenTSDB.
This topic explains configuration, variables, querying, and other features specific to the OpenTSDB data source.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system.&lt;/p&gt;
&lt;h2 id=&#34;opentsdb-settings&#34;&gt;OpenTSDB settings&lt;/h2&gt;
&lt;p&gt;To configure basic settings for the data source, complete the following steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Connections&lt;/strong&gt; in the left-side menu.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Under Your connections, click &lt;strong&gt;Data sources&lt;/strong&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter &lt;code&gt;OpenTSDB&lt;/code&gt; in the search bar.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;OpenTSDB&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Settings&lt;/strong&gt; tab of the data source is displayed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options:&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&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;Name&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;Default data source that will be be pre-selected 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, and port of your OpenTSDB server (default port is usually 4242).&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;Listing of cookies to forward to the data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Version&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The OpenTSDB version.&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;Metrics from OpenTSDB may have data points with either second or millisecond resolution.&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;Default is 1000.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-example&#34;&gt;Provisioning example&lt;/h4&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:
      tsdbResolution: 1
      tsdbVersion: 1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-editor&#34;&gt;Query editor&lt;/h2&gt;
&lt;p&gt;Open a graph in edit mode by click the title. Query editor will differ if the data source has version &amp;lt;=2.1 or = 2.2.
In the former version, only tags can be used to query OpenTSDB. But in the latter version, filters as well as tags
can be used to query OpenTSDB. Fill Policy is also introduced in OpenTSDB 2.2.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload&#34;
  data-src=&#34;/static/img/docs/v43/opentsdb_query_editor.png&#34;
  alt=&#34;&#34; width=&#34;1171&#34;
     height=&#34;239&#34;/&gt;&lt;/p&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;While using OpenTSDB 2.2 data source, make sure you use either Filters or Tags as they are mutually exclusive. If used together, might give you weird results.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;auto-complete-suggestions&#34;&gt;Auto complete suggestions&lt;/h3&gt;
&lt;p&gt;As soon as you start typing metric names, tag names and tag values , you should see highlighted auto complete suggestions for them.
The autocomplete only works if the OpenTSDB suggest API is enabled.&lt;/p&gt;
&lt;h2 id=&#34;templating-queries&#34;&gt;Templating queries&lt;/h2&gt;
&lt;p&gt;Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place.
Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data
being displayed in your dashboard.&lt;/p&gt;
&lt;p&gt;Check out the &lt;a href=&#34;../../dashboards/variables/&#34;&gt;Templating&lt;/a&gt; documentation for an introduction to the templating feature and the different
types of template variables.&lt;/p&gt;
&lt;h3 id=&#34;query-variable&#34;&gt;Query variable&lt;/h3&gt;
&lt;p&gt;Grafana&amp;rsquo;s OpenTSDB data source supports template variable queries. This means you can create template variables
that fetch the values from OpenTSDB. For example, metric names, tag names, or tag values.&lt;/p&gt;
&lt;p&gt;When using OpenTSDB with a template variable of &lt;code&gt;query&lt;/code&gt; type you can use following syntax for lookup.&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&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;metrics(prefix)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns metric names with specific prefix (can be empty)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tag_names(cpu)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns tag names (i.e. keys) for a specific cpu metric&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tag_values(cpu, hostname)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns tag values for metric cpu and tag key hostname&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 names (i.e. keys) for all metrics with specific prefix (can be empty)&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 for all metrics with specific prefix (can be empty)&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;If you do not see template variables being populated in &lt;code&gt;Preview of values&lt;/code&gt; section, you need to enable
&lt;code&gt;tsd.core.meta.enable_realtime_ts&lt;/code&gt; in the OpenTSDB server settings. Also, to populate metadata of
the existing time series data in OpenTSDB, you need to run &lt;code&gt;tsdb uid metasync&lt;/code&gt; on the OpenTSDB server.&lt;/p&gt;
&lt;h3 id=&#34;nested-templating&#34;&gt;Nested templating&lt;/h3&gt;
&lt;p&gt;One template variable can be used to filter tag values for another template variable. First parameter is the metric name,
second parameter is the tag key for which you need to find tag values, and after that all other dependent template variables.
Some examples are mentioned below to make nested template queries work successfully.&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&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(cpu, hostname, env=$env)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Return tag values for cpu metric, selected env tag value and tag key hostname&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tag_values(cpu, hostname, env=$env, region=$region)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Return tag values for cpu metric, selected env tag value, selected region tag value and tag key hostname&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;For details on OpenTSDB metric queries, check out the official &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;&lt;/p&gt;
]]></content><description>&lt;h1 id="opentsdb-data-source">OpenTSDB data source&lt;/h1>
&lt;p>Grafana ships with advanced support for OpenTSDB.
This topic explains configuration, variables, querying, and other features specific to the OpenTSDB data source.&lt;/p></description></item><item><title>Parca</title><link>https://grafana.com/docs/grafana/v9.4/datasources/parca/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/parca/</guid><content><![CDATA[&lt;h1 id=&#34;parca-data-source&#34;&gt;Parca data source&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This feature is behind the &lt;code&gt;flameGraph&lt;/code&gt; feature toggle.
You can enable feature toggles through configuration file or environment variables. See configuration &lt;a href=&#34;../../setup-grafana/configure-grafana/#feature_toggles&#34;&gt;docs&lt;/a&gt; for details.
Grafana Cloud users can access this feature by &lt;a href=&#34;/profile/org#support&#34;&gt;opening a support ticket in the Cloud Portal&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Grafana ships with built-in support for Parca, a continuous profiling OSS database for analysis of CPU and memory usage, down to the line number and throughout time. Add it as a data source, and you are ready to query your profiles in &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-parca-data-source&#34;&gt;Configure the Parca data source&lt;/h2&gt;
&lt;p&gt;To access Parca settings, click the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon, then click &lt;strong&gt;Data Sources&lt;/strong&gt; &amp;gt; &lt;strong&gt;Parca&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;Name&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;Name&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A name to specify the data source in panels, queries, and Explore.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Default&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The default data source will be pre-selected for new panels.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;URL&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The URL of the Tempo instance, e.g., &lt;code&gt;http://localhost:4100&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Basic Auth&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Enable basic authentication to the Tempo data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;User&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;User name for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Password&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Password for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;querying&#34;&gt;Querying&lt;/h2&gt;
&lt;h3 id=&#34;query-editor&#34;&gt;Query Editor&lt;/h3&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/parca/query-editor.png&#34;
  alt=&#34;Query editor&#34; width=&#34;1912&#34;
     height=&#34;286&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Query editor gives you access to a profile type selector, a label selector, and collapsible options.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/parca/select-profile.png&#34;
  alt=&#34;Profile selector&#34; width=&#34;942&#34;
     height=&#34;374&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Select a profile type from the drop-down menu. While the label selector can be left empty to query all profiles without filtering by labels, the profile type must be selected for the query to be valid. Grafana does not show any data if the profile type isn’t selected when a query is run.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/parca/labels-selector.png&#34;
  alt=&#34;Labels selector&#34; width=&#34;1914&#34;
     height=&#34;376&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Use the labels selector input to filter by labels. Parca uses similar syntax to Prometheus to filter labels. Refer to &lt;a href=&#34;https://www.parca.dev/docs&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Parca documentation&lt;/a&gt; for available operators and syntax.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/parca/options-section.png&#34;
  alt=&#34;Options section&#34; width=&#34;1878&#34;
     height=&#34;374&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Select a query type to return the profile data which can be shown in the &lt;a href=&#34;../../panels-visualizations/visualizations/flame-graph/&#34;&gt;Flame Graph&lt;/a&gt;, metric data visualized in a graph, or both. You can only select both options in a dashboard, because panels allow only one visualization.&lt;/p&gt;
&lt;h3 id=&#34;profiles-query-results&#34;&gt;Profiles query results&lt;/h3&gt;
&lt;p&gt;Profiles can be visualized in a flame graph. See the &lt;a href=&#34;../../panels-visualizations/visualizations/flame-graph/&#34;&gt;Flame Graph documentation&lt;/a&gt; to learn about the visualization and its features.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/parca/flame-graph.png&#34;
  alt=&#34;Flame graph&#34; width=&#34;1958&#34;
     height=&#34;1204&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Parca returns profiles aggregated over a selected time range, and the absolute values in the flame graph grow as the time range gets bigger while keeping the relative values meaningful. You can zoom in on the time range to get a higher granularity profile up to the point of a single Parca scrape interval.&lt;/p&gt;
&lt;h3 id=&#34;metrics-query-results&#34;&gt;Metrics query results&lt;/h3&gt;
&lt;p&gt;Metrics results represent the aggregated value, over time, of the selected profile type. Parca returns ungrouped data with a series for each label combination.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/parca/metric-graph.png&#34;
  alt=&#34;Metrics graph&#34; width=&#34;1942&#34;
     height=&#34;610&#34;/&gt;&lt;/p&gt;
&lt;p&gt;This allows you to quickly see any spikes in the value of the scraped profiles and zoom in to a particular time range.&lt;/p&gt;
&lt;h2 id=&#34;provision-the-parca-data-source&#34;&gt;Provision the Parca data source&lt;/h2&gt;
&lt;p&gt;You can modify the Grafana configuration files to provision the Parca data source. To learn more, and to view the available provisioning settings, see &lt;a href=&#34;../../administration/provisioning/#datasources&#34;&gt;provisioning documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here is an example config:&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: Parca
    type: parca
    url: http://localhost:3100&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="parca-data-source">Parca data source&lt;/h1>
&lt;blockquote>
&lt;p>&lt;strong>Note:&lt;/strong> This feature is behind the &lt;code>flameGraph&lt;/code> feature toggle.
You can enable feature toggles through configuration file or environment variables. See configuration &lt;a href="../../setup-grafana/configure-grafana/#feature_toggles">docs&lt;/a> for details.
Grafana Cloud users can access this feature by &lt;a href="/profile/org#support">opening a support ticket in the Cloud Portal&lt;/a>.&lt;/p></description></item><item><title>Phlare</title><link>https://grafana.com/docs/grafana/v9.4/datasources/phlare/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/phlare/</guid><content><![CDATA[&lt;h1 id=&#34;phlare-data-source&#34;&gt;Phlare data source&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This feature is behind the &lt;code&gt;flameGraph&lt;/code&gt; feature toggle.
You can enable feature toggles through configuration file or environment variables. See configuration &lt;a href=&#34;../../setup-grafana/configure-grafana/#feature_toggles&#34;&gt;docs&lt;/a&gt; for details.
Grafana Cloud users can access this feature by &lt;a href=&#34;/profile/org#support&#34;&gt;opening a support ticket in the Cloud Portal&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Grafana ships with built-in support for Phlare, a horizontally scalable, highly-available, multi-tenant, OSS, continuous profiling aggregation system from Grafana Labs. Add it as a data source, and you are ready to query your profiles in &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-phlare-data-source&#34;&gt;Configure the Phlare data source&lt;/h2&gt;
&lt;p&gt;To access Phlare settings, click the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon, then click &lt;strong&gt;Data Sources&lt;/strong&gt; &amp;gt; &lt;strong&gt;Phlare&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;Name&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;Name&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;A name to specify the data source in panels, queries, and Explore.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Default&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The default data source will be pre-selected for new panels.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;URL&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The URL of the Tempo instance, e.g., &lt;code&gt;http://localhost:4100&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Basic Auth&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Enable basic authentication to the Tempo data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;User&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;User name for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Password&lt;/code&gt;&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;Minimal step&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Similar to Prometheus, Phlare scrapes profiles at certain intervals. To prevent querying at smaller interval use Minimal step same or higher than your Phlare scrape interval.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;querying&#34;&gt;Querying&lt;/h2&gt;
&lt;h3 id=&#34;query-editor&#34;&gt;Query Editor&lt;/h3&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/phlare/query-editor.png&#34;
  alt=&#34;Query editor&#34; width=&#34;1902&#34;
     height=&#34;278&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Query editor gives you access to a profile type selector, a label selector, and collapsible options.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/phlare/select-profile.png&#34;
  alt=&#34;Profile selector&#34; width=&#34;886&#34;
     height=&#34;550&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Select a profile type from the drop-down menu. While the label selector can be left empty to query all profiles without filtering by labels, the profile type must be selected for the query to be valid. Grafana does not show any data if the profile type isn’t selected when a query is run.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/phlare/labels-selector.png&#34;
  alt=&#34;Labels selector&#34; width=&#34;1900&#34;
     height=&#34;282&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Use the labels selector input to filter by labels. Phlare uses similar syntax to Prometheus to filter labels. Refer to &lt;a href=&#34;/docs/phlare/latest/&#34;&gt;Phlare documentation&lt;/a&gt; for available operators and syntax.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/phlare/options-section.png&#34;
  alt=&#34;Options section&#34; width=&#34;1906&#34;
     height=&#34;416&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Options section contains a switch for Query Type and Group by.&lt;/p&gt;
&lt;p&gt;Select a query type to return the profile data which can be shown in the &lt;a href=&#34;../../panels-visualizations/visualizations/flame-graph/&#34;&gt;Flame Graph&lt;/a&gt;, metric data visualized in a graph, or both. You can only select both options in a dashboard, because panels allow only one visualization.&lt;/p&gt;
&lt;p&gt;Group by allows you to group metric data by a specified label. Without any Group by label, metric data is aggregated over all the labels into single time series. You can use multiple labels to group by. Group by has only an effect on the metric data and does not change the profile data results.&lt;/p&gt;
&lt;h3 id=&#34;profiles-query-results&#34;&gt;Profiles query results&lt;/h3&gt;
&lt;p&gt;Profiles can be visualized in a flame graph. See the &lt;a href=&#34;../../panels-visualizations/visualizations/flame-graph/&#34;&gt;Flame Graph documentation&lt;/a&gt; to learn about the visualization and its features.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/phlare/flame-graph.png&#34;
  alt=&#34;Flame graph&#34; width=&#34;1958&#34;
     height=&#34;1204&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Phlare returns profiles aggregated over a selected time range, and the absolute values in the flame graph grow as the time range gets bigger while keeping the relative values meaningful. You can zoom in on the time range to get a higher granularity profile up to the point of a single Phlare scrape interval.&lt;/p&gt;
&lt;h3 id=&#34;metrics-query-results&#34;&gt;Metrics query results&lt;/h3&gt;
&lt;p&gt;Metrics results represent the aggregated sum value over time of the selected profile type.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/phlare/metric-graph.png&#34;
  alt=&#34;Metrics graph&#34; width=&#34;1942&#34;
     height=&#34;492&#34;/&gt;&lt;/p&gt;
&lt;p&gt;This allows you to quickly see any spikes in the value of the scraped profiles and zoom in to a particular time range.&lt;/p&gt;
&lt;h2 id=&#34;provision-the-phlare-data-source&#34;&gt;Provision the Phlare data source&lt;/h2&gt;
&lt;p&gt;You can modify the Grafana configuration files to provision the Phlare data source. To learn more, and to view the available provisioning settings, see &lt;a href=&#34;../../administration/provisioning/#datasources&#34;&gt;provisioning documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here is an example config:&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: Phlare
    type: phlare
    url: http://localhost:4100
    jsonData:
      minStep: &amp;#39;15s&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="phlare-data-source">Phlare data source&lt;/h1>
&lt;blockquote>
&lt;p>&lt;strong>Note:&lt;/strong> This feature is behind the &lt;code>flameGraph&lt;/code> feature toggle.
You can enable feature toggles through configuration file or environment variables. See configuration &lt;a href="../../setup-grafana/configure-grafana/#feature_toggles">docs&lt;/a> for details.
Grafana Cloud users can access this feature by &lt;a href="/profile/org#support">opening a support ticket in the Cloud Portal&lt;/a>.&lt;/p></description></item><item><title>PostgreSQL data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/postgres/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/postgres/</guid><content><![CDATA[&lt;h1 id=&#34;postgresql-data-source&#34;&gt;PostgreSQL data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with a built-in PostgreSQL data source plugin that allows you to query and visualize data from a PostgreSQL compatible database.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system.&lt;/p&gt;
&lt;h2 id=&#34;postgresql-settings&#34;&gt;PostgreSQL settings&lt;/h2&gt;
&lt;p&gt;To access PostgreSQL settings, hover your mouse over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon, then click &lt;strong&gt;Data Sources&lt;/strong&gt;, and then click the PostgreSQL data source.&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;Name&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;Default data source means that it will be pre-selected for new panels.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Host&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The IP address/hostname and optional port of your PostgreSQL instance. &lt;em&gt;Do not&lt;/em&gt; include the database name. The connection string for connecting to Postgres will not be correct and it may cause errors.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Database&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Name of your PostgreSQL database.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;User&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Database user&amp;rsquo;s login/username&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Database user&amp;rsquo;s password&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;SSL Mode&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the server. When SSL Mode is disabled, SSL Method and Auth Details would not be visible.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;SSL Auth Details Method&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Determines whether the SSL Auth details will be configured as a file path or file content. Grafana v7.5&#43;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;SSL Auth Details Value&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;File path or file content of SSL root certificate, client certificate and client key&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Max open&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The maximum number of open connections to the database, default &lt;code&gt;unlimited&lt;/code&gt; (Grafana v5.4&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Max idle&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The maximum number of connections in the idle connection pool, default &lt;code&gt;2&lt;/code&gt; (Grafana v5.4&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Max lifetime&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;The maximum amount of time in seconds a connection may be reused, default &lt;code&gt;14400&lt;/code&gt;/4 hours (Grafana v5.4&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Version&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Determines which functions are available in the query builder (only available in Grafana 5.3&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;TimescaleDB&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;A time-series database built as a PostgreSQL extension. When enabled, Grafana uses &lt;code&gt;time_bucket&lt;/code&gt; in the &lt;code&gt;$__timeGroup&lt;/code&gt; macro to display TimescaleDB specific aggregate functions in the query builder (only available in Grafana 5.3&#43;). For more information, see &lt;a href=&#34;https://docs.timescale.com/timescaledb/latest/tutorials/grafana/grafana-timescalecloud/#connect-timescaledb-and-grafana&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;TimescaleDB documentation&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;min-time-interval&#34;&gt;Min time interval&lt;/h3&gt;
&lt;p&gt;A lower limit for the &lt;a href=&#34;../../dashboards/variables/add-template-variables/#__interval&#34;&gt;$__interval&lt;/a&gt; and &lt;a href=&#34;../../dashboards/variables/add-template-variables/#__interval_ms&#34;&gt;$__interval_ms&lt;/a&gt; variables.
Recommended to be set to write frequency, for example &lt;code&gt;1m&lt;/code&gt; if your data is written every minute.
This option can also be overridden/configured in a dashboard panel under data source options. It&amp;rsquo;s important to note that this value &lt;strong&gt;needs&lt;/strong&gt; to be formatted as a
number followed by a valid time identifier, e.g. &lt;code&gt;1m&lt;/code&gt; (1 minute) or &lt;code&gt;30s&lt;/code&gt; (30 seconds). The following time identifiers are supported:&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;Identifier&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;y&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;year&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;month&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;week&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;day&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;hour&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;minute&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;s&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;second&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;ms&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;millisecond&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;database-user-permissions-important&#34;&gt;Database user permissions (Important!)&lt;/h3&gt;
&lt;p&gt;The database user you specify when you add the data source should only be granted SELECT permissions on
the specified database and tables you want to query. Grafana does not validate that the query is safe. The query
could include any SQL statement. For example, statements like &lt;code&gt;DELETE FROM user;&lt;/code&gt; and &lt;code&gt;DROP TABLE user;&lt;/code&gt; would be
executed. To protect against this we &lt;strong&gt;highly&lt;/strong&gt; recommend you create a specific PostgreSQL user with restricted permissions.&lt;/p&gt;
&lt;p&gt;Example:&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;SQL&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-sql&#34;&gt; CREATE USER grafanareader WITH PASSWORD &amp;#39;password&amp;#39;;
 GRANT USAGE ON SCHEMA schema TO grafanareader;
 GRANT SELECT ON schema.table TO grafanareader;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Make sure the user does not get any unwanted privileges from the public role.&lt;/p&gt;
&lt;h2 id=&#34;query-builder&#34;&gt;Query builder&lt;/h2&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 949px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/v92/postgresql_query_builder.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/v92/postgresql_query_builder.png&#34;data-srcset=&#34;/static/img/docs/v92/postgresql_query_builder.png?w=320 320w, /static/img/docs/v92/postgresql_query_builder.png?w=550 550w, /static/img/docs/v92/postgresql_query_builder.png?w=750 750w, /static/img/docs/v92/postgresql_query_builder.png?w=900 900w, /static/img/docs/v92/postgresql_query_builder.png?w=1040 1040w, /static/img/docs/v92/postgresql_query_builder.png?w=1240 1240w, /static/img/docs/v92/postgresql_query_builder.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;PostgreSQL query builder&#34;width=&#34;949&#34;height=&#34;416&#34;title=&#34;PostgreSQL query builder&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v92/postgresql_query_builder.png&#34;
            alt=&#34;PostgreSQL query builder&#34;width=&#34;949&#34;height=&#34;416&#34;title=&#34;PostgreSQL query builder&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;PostgreSQL query builder&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;The PostgreSQL query builder is available when editing a panel using a PostgreSQL data source. The built query can be run by pressing the &lt;code&gt;Run query&lt;/code&gt; button in the top right corner of the editor.&lt;/p&gt;
&lt;h3 id=&#34;format&#34;&gt;Format&lt;/h3&gt;
&lt;p&gt;The response from PostgreSQL can be formatted as either a table or as a time series. To use the time series format one of the columns must be named &lt;code&gt;time&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;dataset-and-table-selection&#34;&gt;Dataset and Table selection&lt;/h3&gt;
&lt;p&gt;In the dataset dropdown, choose the PostgreSQL database to query. The dropdown is be populated with the databases that the user has access to.
When the dataset is selected, the table dropdown is populated with the tables that are available.&lt;/p&gt;
&lt;h3 id=&#34;columns-and-aggregation-functions-select&#34;&gt;Columns and Aggregation functions (SELECT)&lt;/h3&gt;
&lt;p&gt;Using the dropdown, select a column to include in the data. You can also specify an optional aggregation function.&lt;/p&gt;
&lt;p&gt;Add further value columns by clicking the plus button and another column dropdown appears.&lt;/p&gt;
&lt;h3 id=&#34;filter-data-where&#34;&gt;Filter data (WHERE)&lt;/h3&gt;
&lt;p&gt;To add a filter, flip the switch at the top of the editor.
Using the first dropdown, select if all the filters need to match (AND) or if only one of the filters needs to match (OR).&lt;/p&gt;
&lt;p&gt;To add more columns to filter on use the plus button.&lt;/p&gt;
&lt;h3 id=&#34;group-by&#34;&gt;Group By&lt;/h3&gt;
&lt;p&gt;To group the results by column, flip the group switch at the top of the editor. You can then choose which column to group the results by. The group by clause can be removed by pressing the X button.&lt;/p&gt;
&lt;h3 id=&#34;preview&#34;&gt;Preview&lt;/h3&gt;
&lt;p&gt;By flipping the preview switch at the top of the editor, you can get a preview of the SQL query generated by the query builder.&lt;/p&gt;
&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;It&amp;rsquo;s now possible to configure data sources using config files with Grafana&amp;rsquo;s provisioning system. You can read more about how it works and all the settings you can set for data sources on the &lt;a href=&#34;../../administration/provisioning/#datasources&#34;&gt;provisioning docs page&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-example&#34;&gt;Provisioning example&lt;/h4&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: Postgres
    type: postgres
    url: localhost:5432
    user: grafana
    secureJsonData:
      password: &amp;#39;Password!&amp;#39;
    jsonData:
      database: grafana
      sslmode: &amp;#39;disable&amp;#39; # disable/require/verify-ca/verify-full
      maxOpenConns: 0 # Grafana v5.4&amp;#43;
      maxIdleConns: 2 # Grafana v5.4&amp;#43;
      connMaxLifetime: 14400 # Grafana v5.4&amp;#43;
      postgresVersion: 903 # 903=9.3, 904=9.4, 905=9.5, 906=9.6, 1000=10
      timescaledb: false&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; In the above code, the &lt;code&gt;postgresVersion&lt;/code&gt; value of &lt;code&gt;10&lt;/code&gt; refers to version PostgreSQL 10 and above.&lt;/p&gt;&lt;/blockquote&gt;
&lt;h4 id=&#34;troubleshoot-provisioning&#34;&gt;Troubleshoot provisioning&lt;/h4&gt;
&lt;p&gt;If you encounter metric request errors or other issues:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Make sure your data source YAML file parameters exactly match the example. This includes parameter names and use of quotation marks.&lt;/li&gt;
&lt;li&gt;Make sure the &lt;code&gt;database&lt;/code&gt; name is not included in the &lt;code&gt;url&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;code-editor&#34;&gt;Code editor&lt;/h2&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 963px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/static/img/docs/v92/sql_code_editor.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/static/img/docs/v92/sql_code_editor.png&#34;data-srcset=&#34;/static/img/docs/v92/sql_code_editor.png?w=320 320w, /static/img/docs/v92/sql_code_editor.png?w=550 550w, /static/img/docs/v92/sql_code_editor.png?w=750 750w, /static/img/docs/v92/sql_code_editor.png?w=900 900w, /static/img/docs/v92/sql_code_editor.png?w=1040 1040w, /static/img/docs/v92/sql_code_editor.png?w=1240 1240w, /static/img/docs/v92/sql_code_editor.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;&#34;width=&#34;963&#34;height=&#34;326&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v92/sql_code_editor.png&#34;
            alt=&#34;&#34;width=&#34;963&#34;height=&#34;326&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;To make advanced queries, switch to the code editor by clicking &lt;code&gt;code&lt;/code&gt; in the top right corner of the editor. The code editor support autocompletion of tables, columns, SQL keywords, standard sql functions, Grafana template variables and Grafana macros. Columns cannot be completed before a table has been specified.&lt;/p&gt;
&lt;p&gt;You can expand the code editor by pressing the &lt;code&gt;chevron&lt;/code&gt; pointing downwards in the lower right corner of the code editor.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;CTRL/CMD &#43; Return&lt;/code&gt; works as a keyboard shortcut to run the query.&lt;/p&gt;
&lt;h2 id=&#34;macros&#34;&gt;Macros&lt;/h2&gt;
&lt;p&gt;Macros can be used within a query to simplify syntax and allow for dynamic parts.&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;Macro 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;code&gt;$__time(dateColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by an expression to convert to a UNIX timestamp and rename the column to &lt;code&gt;time_sec&lt;/code&gt;. For example, &lt;em&gt;UNIX_TIMESTAMP(dateColumn) as time_sec&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeEpoch(dateColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by an expression to convert to a UNIX timestamp and rename the column to &lt;code&gt;time_sec&lt;/code&gt;. For example, &lt;em&gt;UNIX_TIMESTAMP(dateColumn) as time_sec&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeFilter(dateColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by a time range filter using the specified column name. For example, &lt;em&gt;dateColumn BETWEEN FROM_UNIXTIME(1494410783) AND FROM_UNIXTIME(1494410983)&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeFrom()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the start of the currently active time selection. For example, &lt;em&gt;FROM_UNIXTIME(1494410783)&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeTo()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the end of the currently active time selection. For example, &lt;em&gt;FROM_UNIXTIME(1494410983)&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeGroup(dateColumn,&#39;5m&#39;)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by an expression usable in GROUP BY clause. For example, *cast(cast(UNIX_TIMESTAMP(dateColumn)/(300) as signed)*300 as signed),*&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeGroup(dateColumn,&#39;5m&#39;, 0)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Same as above but with a fill parameter so missing points in that series will be added by grafana and 0 will be used as value.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeGroup(dateColumn,&#39;5m&#39;, NULL)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Same as above but NULL will be used as value for missing points.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeGroup(dateColumn,&#39;5m&#39;, previous)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Same as above but the previous value in that series will be used as fill value if no value has been seen yet NULL will be used (only available in Grafana 5.3&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__timeGroupAlias(dateColumn,&#39;5m&#39;)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced identical to $__timeGroup but with an added column alias (only available in Grafana 5.3&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochFilter(dateColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by a time range filter using the specified column name with times represented as Unix timestamp. For example, &lt;em&gt;dateColumn &amp;gt; 1494410783 AND dateColumn &amp;lt; 1494497183&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochFrom()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the start of the currently active time selection as Unix timestamp. For example, &lt;em&gt;1494410783&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochTo()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the end of the currently active time selection as Unix timestamp. For example, &lt;em&gt;1494497183&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochNanoFilter(dateColumn)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by a time range filter using the specified column name with times represented as nanosecond timestamp. For example, &lt;em&gt;dateColumn &amp;gt; 1494410783152415214 AND dateColumn &amp;lt; 1494497183142514872&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochNanoFrom()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the start of the currently active time selection as nanosecond timestamp. For example, &lt;em&gt;1494410783152415214&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochNanoTo()&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Will be replaced by the end of the currently active time selection as nanosecond timestamp. For example, &lt;em&gt;1494497183142514872&lt;/em&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochGroup(dateColumn,&#39;5m&#39;, [fillmode])&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Same as $__timeGroup but for times stored as Unix timestamp (only available in Grafana 5.3&#43;).&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;$__unixEpochGroupAlias(dateColumn,&#39;5m&#39;, [fillmode])&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Same as above but also adds a column alias (only available in Grafana 5.3&#43;).&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;We plan to add many more macros. If you have suggestions for what macros you would like to see, please &lt;a href=&#34;https://github.com/grafana/grafana&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;open an issue&lt;/a&gt; in our GitHub repo.&lt;/p&gt;
&lt;h2 id=&#34;table-queries&#34;&gt;Table queries&lt;/h2&gt;
&lt;p&gt;If the &lt;code&gt;Format as&lt;/code&gt; query option is set to &lt;code&gt;Table&lt;/code&gt; then you can basically do any type of SQL query. The table panel will automatically show the results of whatever columns and rows your query returns.&lt;/p&gt;
&lt;p&gt;Query editor with example query:&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload&#34;
  data-src=&#34;/static/img/docs/v46/postgres_table_query.png&#34;
  alt=&#34;&#34; width=&#34;1195&#34;
     height=&#34;336&#34;/&gt;&lt;/p&gt;
&lt;p&gt;The query:&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;SQL&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-sql&#34;&gt;SELECT
  title as &amp;#34;Title&amp;#34;,
  &amp;#34;user&amp;#34;.login as &amp;#34;Created By&amp;#34;,
  dashboard.created as &amp;#34;Created On&amp;#34;
FROM dashboard
INNER JOIN &amp;#34;user&amp;#34; on &amp;#34;user&amp;#34;.id = dashboard.created_by
WHERE $__timeFilter(dashboard.created)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can control the name of the Table panel columns by using regular &lt;code&gt;as &lt;/code&gt; SQL column selection syntax.&lt;/p&gt;
&lt;p&gt;The resulting table panel:&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/static/img/docs/v46/postgres_table.png&#34;
  alt=&#34;postgres table&#34; width=&#34;531&#34;
     height=&#34;239&#34;/&gt;&lt;/p&gt;
&lt;h2 id=&#34;time-series-queries&#34;&gt;Time series queries&lt;/h2&gt;
&lt;p&gt;If you set Format as to &lt;em&gt;Time series&lt;/em&gt;, then the query must have a column named time that returns either a SQL datetime or any numeric datatype representing Unix epoch in seconds. In addition, result sets of time series queries must be sorted by time for panels to properly visualize the result.&lt;/p&gt;
&lt;p&gt;A time series query result is returned in a &lt;a href=&#34;/developers/plugin-tools/introduction/data-frames#wide-format&#34;&gt;wide data frame format&lt;/a&gt;. Any column except time or of type string transforms into value fields in the data frame query result. Any string column transforms into field labels in the data frame query result.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For backward compatibility, there&amp;rsquo;s an exception to the above rule for queries that return three columns including a string column named metric. Instead of transforming the metric column into field labels, it becomes the field name, and then the series name is formatted as the value of the metric column. See the example with the metric column below.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;To optionally customize the default series name formatting, refer to &lt;a href=&#34;../../panels-visualizations/configure-standard-options/#display-name&#34;&gt;Standard options definitions&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example with &lt;code&gt;metric&lt;/code&gt; column:&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;SQL&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-sql&#34;&gt;SELECT
  $__timeGroup(&amp;#34;time_date_time&amp;#34;,&amp;#39;5m&amp;#39;),
  min(&amp;#34;value_double&amp;#34;),
  &amp;#39;min&amp;#39; as metric
FROM test_data
WHERE $__timeFilter(&amp;#34;time_date_time&amp;#34;)
GROUP BY time
ORDER BY time&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Data frame result:&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;text&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-text&#34;&gt;&amp;#43;---------------------&amp;#43;-----------------&amp;#43;
| Name: time          | Name: min       |
| Labels:             | Labels:         |
| Type: []time.Time   | Type: []float64 |
&amp;#43;---------------------&amp;#43;-----------------&amp;#43;
| 2020-01-02 03:05:00 | 3               |
| 2020-01-02 03:10:00 | 6               |
&amp;#43;---------------------&amp;#43;-----------------&amp;#43;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Example using the fill parameter in the $__timeGroup macro to convert null values to be zero instead:&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;SQL&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-sql&#34;&gt;SELECT
  $__timeGroup(&amp;#34;createdAt&amp;#34;,&amp;#39;5m&amp;#39;,0),
  sum(value) as value,
  hostname
FROM test_data
WHERE
  $__timeFilter(&amp;#34;createdAt&amp;#34;)
GROUP BY time, hostname
ORDER BY time&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Given the data frame result in the following example and using the graph panel, you will get two series named &lt;em&gt;value 10.0.1.1&lt;/em&gt; and &lt;em&gt;value 10.0.1.2&lt;/em&gt;. To render the series with a name of &lt;em&gt;10.0.1.1&lt;/em&gt; and &lt;em&gt;10.0.1.2&lt;/em&gt; , use a &lt;a href=&#34;../../panels-visualizations/configure-standard-options/#display-name&#34;&gt;Standard options definitions&lt;/a&gt; display value of &lt;code&gt;${__field.labels.hostname}&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Data frame result:&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;text&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-text&#34;&gt;&amp;#43;---------------------&amp;#43;---------------------------&amp;#43;---------------------------&amp;#43;
| Name: time          | Name: value               | Name: value               |
| Labels:             | Labels: hostname=10.0.1.1 | Labels: hostname=10.0.1.2 |
| Type: []time.Time   | Type: []float64           | Type: []float64           |
&amp;#43;---------------------&amp;#43;---------------------------&amp;#43;---------------------------&amp;#43;
| 2020-01-02 03:05:00 | 3                         | 4                         |
| 2020-01-02 03:10:00 | 6                         | 7                         |
&amp;#43;---------------------&amp;#43;---------------------------&amp;#43;---------------------------&amp;#43;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Example with multiple columns:&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;SQL&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-sql&#34;&gt;SELECT
  $__timeGroup(&amp;#34;time_date_time&amp;#34;,&amp;#39;5m&amp;#39;),
  min(&amp;#34;value_double&amp;#34;) as &amp;#34;min_value&amp;#34;,
  max(&amp;#34;value_double&amp;#34;) as &amp;#34;max_value&amp;#34;
FROM test_data
WHERE $__timeFilter(&amp;#34;time_date_time&amp;#34;)
GROUP BY time
ORDER BY time&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Data frame result:&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;text&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-text&#34;&gt;&amp;#43;---------------------&amp;#43;-----------------&amp;#43;-----------------&amp;#43;
| Name: time          | Name: min_value | Name: max_value |
| Labels:             | Labels:         | Labels:         |
| Type: []time.Time   | Type: []float64 | Type: []float64 |
&amp;#43;---------------------&amp;#43;-----------------&amp;#43;-----------------&amp;#43;
| 2020-01-02 03:04:00 | 3               | 4               |
| 2020-01-02 03:05:00 | 6               | 7               |
&amp;#43;---------------------&amp;#43;-----------------&amp;#43;-----------------&amp;#43;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;templating&#34;&gt;Templating&lt;/h2&gt;
&lt;p&gt;Instead of hard-coding things like server, application and sensor name in your metric queries you can use variables in their place. Variables are shown as dropdown select boxes at the top of the dashboard. These dropdowns make it easy to change the data being displayed in your dashboard.&lt;/p&gt;
&lt;p&gt;Refer to &lt;a href=&#34;../../dashboards/variables/&#34;&gt;Templates and variables&lt;/a&gt; for an introduction to the templating feature and the different types of template variables.&lt;/p&gt;
&lt;h3 id=&#34;query-variable&#34;&gt;Query variable&lt;/h3&gt;
&lt;p&gt;If you add a template variable of the type &lt;code&gt;Query&lt;/code&gt;, you can write a PostgreSQL query that can
return things like measurement names, key names or key values that are shown as a dropdown select box.&lt;/p&gt;
&lt;p&gt;For example, you can have a variable that contains all values for the &lt;code&gt;hostname&lt;/code&gt; column in a table if you specify a query like this in the templating variable &lt;em&gt;Query&lt;/em&gt; setting.&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;SQL&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-sql&#34;&gt;SELECT hostname FROM host&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;A query can return multiple columns and Grafana will automatically create a list from them. For example, the query below will return a list with values from &lt;code&gt;hostname&lt;/code&gt; and &lt;code&gt;hostname2&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;SQL&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-sql&#34;&gt;SELECT host.hostname, other_host.hostname2 FROM host JOIN other_host ON host.city = other_host.city&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To use time range dependent macros like &lt;code&gt;$__timeFilter(column)&lt;/code&gt; in your query the refresh mode of the template variable needs to be set to &lt;em&gt;On Time Range Change&lt;/em&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;SQL&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-sql&#34;&gt;SELECT event_name FROM event_log WHERE $__timeFilter(time_column)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Another option is a query that can create a key/value variable. The query should return two columns that are named &lt;code&gt;__text&lt;/code&gt; and &lt;code&gt;__value&lt;/code&gt;. The &lt;code&gt;__text&lt;/code&gt; column value should be unique (if it is not unique then the first value is used). The options in the dropdown will have a text and value that allows you to have a friendly name as text and an id as the value. An example query with &lt;code&gt;hostname&lt;/code&gt; as the text and &lt;code&gt;id&lt;/code&gt; as the value:&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;SQL&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-sql&#34;&gt;SELECT hostname AS __text, id AS __value FROM host&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;You can also create nested variables. Using a variable named &lt;code&gt;region&lt;/code&gt;, you could have
the hosts variable only show hosts from the current selected region with a query like this (if &lt;code&gt;region&lt;/code&gt; is a multi-value variable then use the &lt;code&gt;IN&lt;/code&gt; comparison operator rather than &lt;code&gt;=&lt;/code&gt; to match against multiple values):&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;SQL&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-sql&#34;&gt;SELECT hostname FROM host  WHERE region IN($region)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;using-__searchfilter-to-filter-results-in-query-variable&#34;&gt;Using &lt;code&gt;__searchFilter&lt;/code&gt; to filter results in Query Variable&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;Available from Grafana 6.5 and above&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Using &lt;code&gt;__searchFilter&lt;/code&gt; in the query field will filter the query result based on what the user types in the dropdown select box.
When nothing has been entered by the user the default value for &lt;code&gt;__searchFilter&lt;/code&gt; is &lt;code&gt;%&lt;/code&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Important that you surround the &lt;code&gt;__searchFilter&lt;/code&gt; expression with quotes as Grafana does not do this for you.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The example below shows how to use &lt;code&gt;__searchFilter&lt;/code&gt; as part of the query field to enable searching for &lt;code&gt;hostname&lt;/code&gt; while the user types in the dropdown select box.&lt;/p&gt;
&lt;p&gt;Query&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;SQL&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-sql&#34;&gt;SELECT hostname FROM my_host  WHERE hostname LIKE &amp;#39;$__searchFilter&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;using-variables-in-queries&#34;&gt;Using Variables in Queries&lt;/h3&gt;
&lt;p&gt;From Grafana 4.3.0 to 4.6.0, template variables are always quoted automatically. If your template variables are strings, do not wrap them in quotes in where clauses.&lt;/p&gt;
&lt;p&gt;From Grafana 4.7.0, template variable values are only quoted when the template variable is a &lt;code&gt;multi-value&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If the variable is a multi-value variable then use the &lt;code&gt;IN&lt;/code&gt; comparison operator rather than &lt;code&gt;=&lt;/code&gt; to match against multiple values.&lt;/p&gt;
&lt;p&gt;There are two syntaxes:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$&amp;lt;varname&amp;gt;&lt;/code&gt; Example with a template variable named &lt;code&gt;hostname&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;SQL&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-sql&#34;&gt;SELECT
  atimestamp as time,
  aint as value
FROM table
WHERE $__timeFilter(atimestamp) and hostname in($hostname)
ORDER BY atimestamp ASC&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;[[varname]]&lt;/code&gt; Example with a template variable named &lt;code&gt;hostname&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;SQL&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-sql&#34;&gt;SELECT
  atimestamp as time,
  aint as value
FROM table
WHERE $__timeFilter(atimestamp) and hostname in([[hostname]])
ORDER BY atimestamp ASC&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;disabling-quoting-for-multi-value-variables&#34;&gt;Disabling quoting for multi-value variables&lt;/h4&gt;
&lt;p&gt;Grafana automatically creates a quoted, comma-separated string for multi-value variables. For example: if &lt;code&gt;server01&lt;/code&gt; and &lt;code&gt;server02&lt;/code&gt; are selected then it will be formatted as: &lt;code&gt;&#39;server01&#39;, &#39;server02&#39;&lt;/code&gt;. To disable quoting, use the csv formatting option for variables:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;${servers:csv}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Read more about variable formatting options in the &lt;a href=&#34;../../dashboards/variables/variable-syntax/#advanced-variable-format-options&#34;&gt;Variables&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h2 id=&#34;annotations&#34;&gt;Annotations&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;../../dashboards/build-dashboards/annotate-visualizations/&#34;&gt;Annotations&lt;/a&gt; allow you to overlay rich event information on top of graphs. You add annotation queries via the Dashboard menu / Annotations view.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example query using time column with epoch values:&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;SQL&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-sql&#34;&gt;SELECT
  epoch_time as time,
  metric1 as text,
  concat_ws(&amp;#39;, &amp;#39;, metric1::text, metric2::text) as tags
FROM
  public.test_data
WHERE
  $__unixEpochFilter(epoch_time)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Example region query using time and timeend columns with epoch values:&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Only available in Grafana v6.6&#43;.&lt;/p&gt;&lt;/blockquote&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;SQL&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-sql&#34;&gt;SELECT
  epoch_time as time,
  epoch_time_end as timeend,
  metric1 as text,
  concat_ws(&amp;#39;, &amp;#39;, metric1::text, metric2::text) as tags
FROM
  public.test_data
WHERE
  $__unixEpochFilter(epoch_time)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Example query using time column of native SQL date/time data type:&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;SQL&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-sql&#34;&gt;SELECT
  native_date_time as time,
  metric1 as text,
  concat_ws(&amp;#39;, &amp;#39;, metric1::text, metric2::text) as tags
FROM
  public.test_data
WHERE
  $__timeFilter(native_date_time)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&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;Name&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;time&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The name of the date/time field. Could be a column with a native SQL date/time data type or epoch value.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;timeend&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Optional name of the end date/time field. Could be a column with a native SQL date/time data type or epoch value. (Grafana v6.6&#43;)&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;text&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Event description field.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;tags&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Optional field name to use for event tags as a comma separated string.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;alerting&#34;&gt;Alerting&lt;/h2&gt;
&lt;p&gt;Time series queries should work in alerting conditions. Table formatted queries are not yet supported in alert rule
conditions.&lt;/p&gt;
]]></content><description>&lt;h1 id="postgresql-data-source">PostgreSQL data source&lt;/h1>
&lt;p>Grafana ships with a built-in PostgreSQL data source plugin that allows you to query and visualize data from a PostgreSQL compatible database.&lt;/p></description></item><item><title>Prometheus data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/prometheus/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/prometheus/</guid><content><![CDATA[&lt;h1 id=&#34;prometheus-data-source&#34;&gt;Prometheus data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with built-in support for Prometheus.
This topic explains options, variables, querying, and other features specific to the Prometheus data source, which include its &lt;a href=&#34;query-editor/&#34;&gt;feature-rich code editor for queries and visual query builder&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the data source, you can &lt;a href=&#34;#configure-the-data-source&#34;&gt;configure it&lt;/a&gt; so that your Grafana instance&amp;rsquo;s users can create queries in its &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt; when they &lt;a href=&#34;../../dashboards/build-dashboards/&#34;&gt;build dashboards&lt;/a&gt;, use &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;, and &lt;a href=&#34;query-editor/#apply-annotations&#34;&gt;annotate visualizations&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;prometheus-api&#34;&gt;Prometheus API&lt;/h2&gt;
&lt;p&gt;The Prometheus data source also works with other projects that implement the &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/api/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus querying API&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For more information on how to query other Prometheus-compatible projects from Grafana, refer to the specific project&amp;rsquo;s documentation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;/docs/mimir/latest/&#34;&gt;Grafana Mimir&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://thanos.io/tip/components/query.md/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Thanos&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the Prometheus data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options carefully:&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;Name&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;Name&lt;/code&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;code&gt;Default&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Default data source that is pre-selected for new panels.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;URL&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The URL of your Prometheus server, for example, &lt;code&gt;http://prometheus.example.org:9090&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Access&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Only Server access mode is functional. If Server mode is already selected this option is hidden. Otherwise change to Server mode to prevent errors.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Basic Auth&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Enable basic authentication to the Prometheus data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;User&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;User name for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Password&lt;/code&gt;&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;Manage alerts via Alerting UI&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Toggle whether to enable Alertmanager integration for this data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Scrape interval&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Set this to the typical scrape and evaluation interval configured in Prometheus. Defaults to 15s.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;HTTP method&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Use either POST or GET HTTP method to query your data source. POST is the recommended and pre-selected method as it allows bigger queries. Change this to GET if you have a Prometheus version older than 2.1 or if POST requests are restricted in your network.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Type&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The type of your Prometheus server; &lt;code&gt;Prometheus&lt;/code&gt;, &lt;code&gt;Cortex&lt;/code&gt;, &lt;code&gt;Thanos&lt;/code&gt;, &lt;code&gt;Mimir&lt;/code&gt;. When selected, the &lt;strong&gt;Version&lt;/strong&gt; field attempts to populate automatically using the Prometheus &lt;a href=&#34;https://semver.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;buildinfo&lt;/a&gt; API. Some Prometheus types, such as Cortex, don&amp;rsquo;t support this API and must be manually populated.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Version&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;The version of your Prometheus server, note that this field is not visible until the Prometheus type is selected.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Disable metrics lookup&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Checking this option will disable the metrics chooser and metric/label support in the query field&amp;rsquo;s autocomplete. This helps if you have performance issues with bigger Prometheus instances.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Custom query parameters&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Add custom parameters to the Prometheus query URL. For example &lt;code&gt;timeout&lt;/code&gt;, &lt;code&gt;partial_response&lt;/code&gt;, &lt;code&gt;dedup&lt;/code&gt;, or &lt;code&gt;max_source_resolution&lt;/code&gt;. Multiple parameters should be concatenated together with an &amp;lsquo;&amp;amp;&amp;rsquo;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Exemplars configuration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Internal link&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Enable this option if you have an internal link. When enabled, this reveals the data source selector. Select the backend tracing data store for your exemplar data.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Data source&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Visible only if you enable &lt;code&gt;Internal link&lt;/code&gt;)&lt;/em&gt; Selects the backend tracing data store for your exemplar data.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;URL&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Visible only if you disable &lt;code&gt;Internal link&lt;/code&gt;)&lt;/em&gt; Defines the external link&amp;rsquo;s full URL. You can interpolate the value from the field by using the &lt;a href=&#34;../../panels-visualizations/configure-data-links/#value-variables&#34;&gt;&lt;code&gt;${__value.raw}&lt;/code&gt; macro&lt;/a&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;URL Label&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Optional)&lt;/em&gt; Adds a custom display label to override the value of the &lt;code&gt;Label name&lt;/code&gt; field.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Label name&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Adds a name for the exemplar traceID property.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-example&#34;&gt;Provisioning example&lt;/h4&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: Prometheus
    type: prometheus
    # Access mode - proxy (server in the UI) or direct (browser in the UI).
    access: proxy
    url: http://localhost:9090
    jsonData:
      httpMethod: POST
      manageAlerts: true
      prometheusType: Prometheus
      prometheusVersion: 2.37.0
      exemplarTraceIdDestinations:
        # Field with internal link pointing to data source in Grafana.
        # datasourceUid value can be anything, but it should be unique across all defined data source uids.
        - datasourceUid: my_jaeger_uid
          name: traceID

        # Field with external link.
        - name: traceID
          url: &amp;#39;http://localhost:3000/explore?orgId=1&amp;amp;left=%5B%22now-1h%22,%22now%22,%22Jaeger%22,%7B%22query%22:%22$${__value.raw}%22%7D%5D&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;view-grafana-metrics-with-prometheus&#34;&gt;View Grafana metrics with Prometheus&lt;/h2&gt;
&lt;p&gt;Grafana exposes metrics for Prometheus on the &lt;code&gt;/metrics&lt;/code&gt; endpoint.
We also bundle a dashboard within Grafana so you can start viewing your metrics faster.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To import the bundled dashboard:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the data source&amp;rsquo;s &lt;a href=&#34;#configure-the-data-source&#34;&gt;configuration page&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the &lt;strong&gt;Dashboards&lt;/strong&gt; tab.&lt;/p&gt;
&lt;p&gt;This displays dashboards for Grafana and Prometheus.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Import&lt;/strong&gt; for the dashboard to import.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For details about these metrics, refer to &lt;a href=&#34;../../setup-grafana/set-up-grafana-monitoring/&#34;&gt;Internal Grafana metrics&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;amazon-managed-service-for-prometheus&#34;&gt;Amazon Managed Service for Prometheus&lt;/h3&gt;
&lt;p&gt;The Prometheus data source works with Amazon Managed Service for Prometheus.&lt;/p&gt;
&lt;p&gt;If you use an AWS Identity and Access Management (IAM) policy to control access to your Amazon Elasticsearch Service domain, you must use AWS Signature Version 4 (AWS SigV4) to sign all requests to that domain.&lt;/p&gt;
&lt;p&gt;For details on AWS SigV4, refer to the &lt;a href=&#34;https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;AWS documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;aws-signature-version-4-authentication&#34;&gt;AWS Signature Version 4 authentication&lt;/h4&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Available in Grafana v7.3.5 and higher.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;To connect the Prometheus data source to Amazon Managed Service for Prometheus using SigV4 authentication, refer to the AWS guide to &lt;a href=&#34;https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-onboard-query-standalone-grafana.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Set up Grafana open source or Grafana Enterprise for use with AMP&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you run Grafana in an Amazon EKS cluster, follow the AWS guide to &lt;a href=&#34;https://docs.aws.amazon.com/prometheus/latest/userguide/AMP-onboard-query-grafana-7.3.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Query using Grafana running in an Amazon EKS cluster&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;configure-exemplars&#34;&gt;Configure exemplars&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Available in Prometheus v2.26 and higher with Grafana v7.4 and higher.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Grafana 7.4 and higher can show exemplars data alongside a metric both in Explore and in Dashboards.
Exemplars associate higher-cardinality metadata from a specific event with traditional time series data.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 1834px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/v74/exemplars.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/v74/exemplars.png&#34;data-srcset=&#34;/static/img/docs/v74/exemplars.png?w=320 320w, /static/img/docs/v74/exemplars.png?w=550 550w, /static/img/docs/v74/exemplars.png?w=750 750w, /static/img/docs/v74/exemplars.png?w=900 900w, /static/img/docs/v74/exemplars.png?w=1040 1040w, /static/img/docs/v74/exemplars.png?w=1240 1240w, /static/img/docs/v74/exemplars.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot showing the detail window of an Exemplar&#34;width=&#34;1834&#34;height=&#34;840&#34;title=&#34;Screenshot showing the detail window of an Exemplar&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v74/exemplars.png&#34;
            alt=&#34;Screenshot showing the detail window of an Exemplar&#34;width=&#34;1834&#34;height=&#34;840&#34;title=&#34;Screenshot showing the detail window of an Exemplar&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot showing the detail window of an Exemplar&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Configure Exemplars in the data source settings by adding external or internal links.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 728px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/v74/exemplars-setting.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/v74/exemplars-setting.png&#34;data-srcset=&#34;/static/img/docs/v74/exemplars-setting.png?w=320 320w, /static/img/docs/v74/exemplars-setting.png?w=550 550w, /static/img/docs/v74/exemplars-setting.png?w=750 750w, /static/img/docs/v74/exemplars-setting.png?w=900 900w, /static/img/docs/v74/exemplars-setting.png?w=1040 1040w, /static/img/docs/v74/exemplars-setting.png?w=1240 1240w, /static/img/docs/v74/exemplars-setting.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Exemplars configuration&#34;width=&#34;728&#34;height=&#34;254&#34;title=&#34;Screenshot of the Exemplars configuration&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v74/exemplars-setting.png&#34;
            alt=&#34;Screenshot of the Exemplars configuration&#34;width=&#34;728&#34;height=&#34;254&#34;title=&#34;Screenshot of the Exemplars configuration&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Exemplars configuration&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h2 id=&#34;query-the-data-source&#34;&gt;Query the data source&lt;/h2&gt;
&lt;p&gt;You can create queries with the Prometheus data source&amp;rsquo;s query editor.&lt;/p&gt;
&lt;p&gt;For details, refer to the &lt;a href=&#34;query-editor/&#34;&gt;query editor documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-template-variables&#34;&gt;Use template variables&lt;/h2&gt;
&lt;p&gt;Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables.
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
Grafana refers to such variables as template variables.&lt;/p&gt;
&lt;p&gt;For details, see the &lt;a href=&#34;template-variables/&#34;&gt;template variables documentation&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="prometheus-data-source">Prometheus data source&lt;/h1>
&lt;p>Grafana ships with built-in support for Prometheus.
This topic explains options, variables, querying, and other features specific to the Prometheus data source, which include its &lt;a href="query-editor/">feature-rich code editor for queries and visual query builder&lt;/a>.&lt;/p></description></item><item><title>Tempo data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/tempo/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/tempo/</guid><content><![CDATA[&lt;h1 id=&#34;tempo-data-source&#34;&gt;Tempo data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with built-in support for Tempo, a high-volume, minimal-dependency trace storage, open-source tracing solution from Grafana Labs.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the data source, you can &lt;a href=&#34;#configure-the-data-source&#34;&gt;configure it&lt;/a&gt; so that your Grafana instance&amp;rsquo;s users can create queries in its &lt;a href=&#34;query-editor/&#34;&gt;query editor&lt;/a&gt; when they &lt;a href=&#34;../../dashboards/build-dashboards/&#34;&gt;build dashboards&lt;/a&gt; and use &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can also &lt;a href=&#34;#use-the-service-graph&#34;&gt;use the service graph&lt;/a&gt; to view service relationships, &lt;a href=&#34;#open-the-service-graph-view&#34;&gt;track RED metrics&lt;/a&gt;, &lt;a href=&#34;#upload-a-json-trace-file&#34;&gt;upload a JSON trace file&lt;/a&gt;, and &lt;a href=&#34;#link-a-trace-id-from-logs&#34;&gt;link a trace ID from logs&lt;/a&gt; in Loki or Elasticsearch.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the Tempo data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options carefully:&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;Name&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;Sets the name you use to 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;Sets the data source that&amp;rsquo;s pre-selected 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;Sets the URL of the Tempo instance, such as &lt;code&gt;http://tempo&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Basic Auth&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enables basic authentication to the Tempo data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;User&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the user name for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the password for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;You can also configure settings specific to the Tempo data source:&lt;/p&gt;
&lt;h3 id=&#34;configure-trace-to-logs&#34;&gt;Configure trace to logs&lt;/h3&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/tempo/tempo-trace-to-logs-9-4.png&#34;
  alt=&#34;Trace to logs settings&#34; width=&#34;1219&#34;
     height=&#34;852&#34;/&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Available in Grafana v7.4 and higher.
If you use Grafana Cloud, open a &lt;a href=&#34;/profile/org#support&#34;&gt;support ticket in the Cloud Portal&lt;/a&gt; to access this feature.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The &lt;strong&gt;Trace to logs&lt;/strong&gt; setting configures the &lt;a href=&#34;../../explore/trace-integration/&#34;&gt;trace to logs feature&lt;/a&gt; that is available when you integrate Grafana with Tempo.&lt;/p&gt;
&lt;p&gt;There are two ways to configure the trace to logs feature. You can use simplified configuration with default query, or you can configure custom query where you can use a &lt;a href=&#34;../../dashboards/variables/variable-syntax/&#34;&gt;template language&lt;/a&gt; to interpolate variables from the trace or span.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To use simple configuration:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the target data source.&lt;/li&gt;
&lt;li&gt;Set start and end time shift. As the logs timestamps may not exactly match the timestamps of the spans in trace it may be necessary to search in larger or shifted time range to find the desired logs.&lt;/li&gt;
&lt;li&gt;Select which tags to use in the logs query. The tags you configure must be present in the spans attributes or resources for a trace to logs span link to appear. You can optionally configure a new name for the tag. This is useful for example if the tag has dots in the name and the target data source does not allow using dots in labels. In that case you can for example remap &lt;code&gt;http.status&lt;/code&gt; to &lt;code&gt;http_status&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Optionally switch on Filter by Trace ID and/or Filter by Span ID to further filter the logs if your logs consistently contain trace or span IDs.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;To use custom query configuration:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the target data source.&lt;/li&gt;
&lt;li&gt;Set start and end time shift. As the logs timestamps may not exactly match the timestamps of the spans in the trace it may be necessary to widen or shift the time range to find the desired logs.&lt;/li&gt;
&lt;li&gt;Optionally select tags to map. These tags can be used in the custom query with &lt;code&gt;${__tags}&lt;/code&gt; variable. This variable will interpolate the mapped tags as list in an appropriate syntax for the data source and will only include the tags that were present in the span omitting those that weren&amp;rsquo;t present. You can optionally configure a new name for the tag. This is useful in cases where the tag has dots in the name and the target data source does not allow using dots in labels. For example, you can remap &lt;code&gt;http.status&lt;/code&gt; to &lt;code&gt;http_status&lt;/code&gt; in such a case. If you don&amp;rsquo;t map any tags here, you can still use any tag in the query like this &lt;code&gt;method=&amp;quot;${__span.tags.method}&amp;quot;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Skip Filter by Trace ID or Filter by Span ID as these cannot be used with custom query.&lt;/li&gt;
&lt;li&gt;Switch on Use custom query.&lt;/li&gt;
&lt;li&gt;Specify custom query to be used to query the logs. You can use various variables to make that query relevant for current span. The link will only be shown only if all the variables are interpolated with non-empty values to prevent creating invalid query.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Variables that can be used in custom query&lt;/strong&gt;
To use a variable you need to wrap it in &lt;code&gt;${}&lt;/code&gt;. For example &lt;code&gt;${__span.name}&lt;/code&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;Variable name&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;__tags&lt;/td&gt;
              &lt;td&gt;This variable is special because it uses the tag mapping in from the UI to create a label matcher string in the specific data source syntax. It uses only tags that are present in the span so the link will still be created even if only one of those tags is present in the span. You can use this if not all the tags are required for the query to be useful.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;__span.spanId&lt;/td&gt;
              &lt;td&gt;The ID of the span.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;__span.traceId&lt;/td&gt;
              &lt;td&gt;The ID of the trace.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;__span.duration&lt;/td&gt;
              &lt;td&gt;The duration of the span.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;__span.name&lt;/td&gt;
              &lt;td&gt;Name of the span.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;__span.tags&lt;/td&gt;
              &lt;td&gt;Namespace for the tags in the span. To access a specific tag named &amp;ldquo;version&amp;rdquo; you would use &lt;code&gt;${__span.tags.version}&lt;/code&gt;. In case the tag contains dot you have to access it as &lt;code&gt;${__span.tags[&amp;quot;http.status&amp;quot;]}&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;__trace.traceId&lt;/td&gt;
              &lt;td&gt;The ID of the trace.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;__trace.duration&lt;/td&gt;
              &lt;td&gt;The duration of the trace.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;__trace.name&lt;/td&gt;
              &lt;td&gt;The name of the trace.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;The following table describes the ways in which you can configure your trace to logs settings:&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 name&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;Data source&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the target data source. You can select only Loki or Splunk [logs] data sources.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Span start time shift&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Shifts the start time for the logs query, based on the span&amp;rsquo;s start time. You can use time units, such as &lt;code&gt;5s&lt;/code&gt;, &lt;code&gt;1m&lt;/code&gt;, &lt;code&gt;3h&lt;/code&gt;. To extend the time to the past, use a negative value. Default is 0.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Span end time shift&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Shifts the end time for the logs query, based on the span&amp;rsquo;s end time. You can use time units. Default is 0.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the the tags to use in the logs query. Default is &lt;code&gt;&#39;cluster&#39;, &#39;hostname&#39;, &#39;namespace&#39;, &#39;pod&#39;&lt;/code&gt;. You can change the tag name for example to remove dots from the name if they are not allowed in the target data source. For example map &lt;code&gt;http.status&lt;/code&gt; to &lt;code&gt;http_status&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter by Trace ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggles whether to append the trace ID to the logs query.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter by Span ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggles whether to append the span ID to the logs query.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Use custom query&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggles use of custom query with interpolation.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Query&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Input to write custom query. Use variable interpolation to customize it with variables from span.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;configure-trace-to-metrics&#34;&gt;Configure trace to metrics&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This feature is behind the &lt;code&gt;traceToMetrics&lt;/code&gt; &lt;a href=&#34;../../setup-grafana/configure-grafana/#feature_toggles&#34;&gt;feature toggle&lt;/a&gt;.
If you use Grafana Cloud, open a &lt;a href=&#34;/profile/org#support&#34;&gt;support ticket in the Cloud Portal&lt;/a&gt; to access this feature.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The &lt;strong&gt;Trace to metrics&lt;/strong&gt; setting configures the &lt;a href=&#34;/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/&#34;&gt;trace to metrics feature&lt;/a&gt; available when integrating Grafana with Tempo.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To configure trace to metrics:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the target data source.&lt;/li&gt;
&lt;li&gt;Create any desired linked queries.&lt;/li&gt;
&lt;/ol&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 name&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;Data source&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the target data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the tags used in linked queries. The key sets the span attribute name, and the optional value sets the corresponding metric label name. For example, you can map &lt;code&gt;k8s.pod&lt;/code&gt; to &lt;code&gt;pod&lt;/code&gt;. To interpolate these tags into queries, use the &lt;code&gt;$__tags&lt;/code&gt; keyword.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Each linked query consists of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Link Label:&lt;/strong&gt; &lt;em&gt;(Optional)&lt;/em&gt; Descriptive label for the linked query.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Query:&lt;/strong&gt; The query ran when navigating from a trace to the metrics data source.
Interpolate tags using the &lt;code&gt;$__tags&lt;/code&gt; keyword.
For example, when you configure the query &lt;code&gt;requests_total{$__tags}&lt;/code&gt;with the tags &lt;code&gt;k8s.pod=pod&lt;/code&gt; and &lt;code&gt;cluster&lt;/code&gt;, the result looks like &lt;code&gt;requests_total{pod=&amp;quot;nginx-554b9&amp;quot;, cluster=&amp;quot;us-east-1&amp;quot;}&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;configure-service-graph&#34;&gt;Configure service graph&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Service Graph&lt;/strong&gt; section configures the &lt;a href=&#34;/docs/tempo/latest/grafana-agent/service-graphs/&#34;&gt;Service Graph&lt;/a&gt; feature.&lt;/p&gt;
&lt;p&gt;Configure the &lt;strong&gt;Data source&lt;/strong&gt; setting to define in which Prometheus instance the Service Graph data is stored.&lt;/p&gt;
&lt;p&gt;To use the service graph, refer to the &lt;a href=&#34;#use-the-service-graph&#34;&gt;Service graph section&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;configure-tempo-search-integration&#34;&gt;Configure Tempo search integration&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Search&lt;/strong&gt; section configures &lt;a href=&#34;/docs/tempo/latest/configuration/#search&#34;&gt;Tempo search&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Optionally configure the &lt;strong&gt;Hide search&lt;/strong&gt; setting to hide the search query option in Explore if search is not configured in the Tempo instance.&lt;/p&gt;
&lt;h3 id=&#34;enable-node-graph&#34;&gt;Enable Node Graph&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Node Graph&lt;/strong&gt; setting enables the &lt;a href=&#34;../../panels-visualizations/visualizations/node-graph/&#34;&gt;Node Graph visualization&lt;/a&gt;, which is disabled by default.&lt;/p&gt;
&lt;p&gt;Once enabled, Grafana displays the Node Graph after loading the trace view.&lt;/p&gt;
&lt;h3 id=&#34;configure-loki-search&#34;&gt;Configure Loki search&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Loki search&lt;/strong&gt; section configures the Loki search query type.&lt;/p&gt;
&lt;p&gt;Configure the &lt;strong&gt;Data source&lt;/strong&gt; setting to define which Loki instance you want to use to search traces.
You must configure &lt;a href=&#34;../loki/#configure-derived-fields&#34;&gt;derived fields&lt;/a&gt; in the Loki instance.&lt;/p&gt;
&lt;h3 id=&#34;span-bar-label&#34;&gt;Span bar label&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Span bar label&lt;/strong&gt; section helps you display additional information in the span bar row.&lt;/p&gt;
&lt;p&gt;You can choose one of three 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;Name&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;None&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Adds nothing to the span bar row.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Duration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Default)&lt;/em&gt; Displays the span duration on the span bar row.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tag&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Displays the span tag on the span bar row. You must also specify which tag key to use to get the tag value, such as &lt;code&gt;span.kind&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;provision-the-data-source&#34;&gt;Provision the data source&lt;/h3&gt;
&lt;p&gt;You can define and configure the Tempo data source in YAML files as part of Grafana&amp;rsquo;s provisioning system.
For more information about provisioning, and for available configuration options, refer to &lt;a href=&#34;../../administration/provisioning/#data-sources&#34;&gt;Provisioning Grafana&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;provisioning-examples&#34;&gt;Provisioning examples&lt;/h4&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: Tempo
    type: tempo
    # Access mode - proxy (server in the UI) or direct (browser in the UI).
    access: proxy
    url: http://localhost:3200
    jsonData:
      httpMethod: GET
      tracesToLogs:
        datasourceUid: &amp;#39;loki&amp;#39;
        tags: [&amp;#39;job&amp;#39;, &amp;#39;instance&amp;#39;, &amp;#39;pod&amp;#39;, &amp;#39;namespace&amp;#39;]
        mappedTags: [{ key: &amp;#39;service.name&amp;#39;, value: &amp;#39;service&amp;#39; }]
        mapTagNamesEnabled: false
        spanStartTimeShift: &amp;#39;1h&amp;#39;
        spanEndTimeShift: &amp;#39;1h&amp;#39;
        filterByTraceID: false
        filterBySpanID: false
      tracesToMetrics:
        datasourceUid: &amp;#39;prom&amp;#39;
        tags: [{ key: &amp;#39;service.name&amp;#39;, value: &amp;#39;service&amp;#39; }, { key: &amp;#39;job&amp;#39; }]
        queries:
          - name: &amp;#39;Sample query&amp;#39;
            query: &amp;#39;sum(rate(traces_spanmetrics_latency_bucket{$__tags}[5m]))&amp;#39;
      serviceMap:
        datasourceUid: &amp;#39;prometheus&amp;#39;
      search:
        hide: false
      nodeGraph:
        enabled: true
      lokiSearch:
        datasourceUid: &amp;#39;loki&amp;#39;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;query-the-data-source&#34;&gt;Query the data source&lt;/h2&gt;
&lt;p&gt;The Tempo data source&amp;rsquo;s query editor helps you query and display traces from Tempo in &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For details, refer to the &lt;a href=&#34;query-editor/&#34;&gt;query editor documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;upload-a-json-trace-file&#34;&gt;Upload a JSON trace file&lt;/h2&gt;
&lt;p&gt;You can upload a JSON file that contains a single trace and visualize it.
If the file has multiple traces, Grafana visualizes its first trace.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To download a trace or service graph through the inspector:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the inspector.&lt;/li&gt;
&lt;li&gt;Navigate to the &lt;strong&gt;Data&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Download traces&lt;/strong&gt; or &lt;strong&gt;Download service graph&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;trace-json-example&#34;&gt;Trace JSON example&lt;/h3&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;JSON&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-json&#34;&gt;{
  &amp;#34;batches&amp;#34;: [
    {
      &amp;#34;resource&amp;#34;: {
        &amp;#34;attributes&amp;#34;: [
          { &amp;#34;key&amp;#34;: &amp;#34;service.name&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;db&amp;#34; } },
          { &amp;#34;key&amp;#34;: &amp;#34;job&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;tns/db&amp;#34; } },
          { &amp;#34;key&amp;#34;: &amp;#34;opencensus.exporterversion&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;Jaeger-Go-2.22.1&amp;#34; } },
          { &amp;#34;key&amp;#34;: &amp;#34;host.name&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;63d16772b4a2&amp;#34; } },
          { &amp;#34;key&amp;#34;: &amp;#34;ip&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;0.0.0.0&amp;#34; } },
          { &amp;#34;key&amp;#34;: &amp;#34;client-uuid&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;39fb01637a579639&amp;#34; } }
        ]
      },
      &amp;#34;instrumentationLibrarySpans&amp;#34;: [
        {
          &amp;#34;instrumentationLibrary&amp;#34;: {},
          &amp;#34;spans&amp;#34;: [
            {
              &amp;#34;traceId&amp;#34;: &amp;#34;AAAAAAAAAABguiq7RPE&amp;#43;rg==&amp;#34;,
              &amp;#34;spanId&amp;#34;: &amp;#34;cmteMBAvwNA=&amp;#34;,
              &amp;#34;parentSpanId&amp;#34;: &amp;#34;OY8PIaPbma4=&amp;#34;,
              &amp;#34;name&amp;#34;: &amp;#34;HTTP GET - root&amp;#34;,
              &amp;#34;kind&amp;#34;: &amp;#34;SPAN_KIND_SERVER&amp;#34;,
              &amp;#34;startTimeUnixNano&amp;#34;: &amp;#34;1627471657255809000&amp;#34;,
              &amp;#34;endTimeUnixNano&amp;#34;: &amp;#34;1627471657256268000&amp;#34;,
              &amp;#34;attributes&amp;#34;: [
                { &amp;#34;key&amp;#34;: &amp;#34;http.status_code&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;intValue&amp;#34;: &amp;#34;200&amp;#34; } },
                { &amp;#34;key&amp;#34;: &amp;#34;http.method&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;GET&amp;#34; } },
                { &amp;#34;key&amp;#34;: &amp;#34;http.url&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;/&amp;#34; } },
                { &amp;#34;key&amp;#34;: &amp;#34;component&amp;#34;, &amp;#34;value&amp;#34;: { &amp;#34;stringValue&amp;#34;: &amp;#34;net/http&amp;#34; } }
              ],
              &amp;#34;status&amp;#34;: {}
            }
          ]
        }
      ]
    }
  ]
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;use-the-service-graph&#34;&gt;Use the service graph&lt;/h2&gt;
&lt;p&gt;A service graph is a visual representation of the relationships between services.
Each node on the graph represents a service such as an API or database.&lt;/p&gt;
&lt;p&gt;You use a service graph to detect performance issues; track increases in error, fault, or throttle rates in services; and investigate root causes by viewing corresponding traces.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 500px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/node-graph/node-graph-8-0.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/node-graph/node-graph-8-0.png&#34;data-srcset=&#34;/static/img/docs/node-graph/node-graph-8-0.png?w=320 320w, /static/img/docs/node-graph/node-graph-8-0.png?w=550 550w, /static/img/docs/node-graph/node-graph-8-0.png?w=750 750w, /static/img/docs/node-graph/node-graph-8-0.png?w=900 900w, /static/img/docs/node-graph/node-graph-8-0.png?w=1040 1040w, /static/img/docs/node-graph/node-graph-8-0.png?w=1240 1240w, /static/img/docs/node-graph/node-graph-8-0.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of a Node Graph&#34;width=&#34;1768&#34;height=&#34;1288&#34;title=&#34;Screenshot of a Node Graph&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/node-graph/node-graph-8-0.png&#34;
            alt=&#34;Screenshot of a Node Graph&#34;width=&#34;1768&#34;height=&#34;1288&#34;title=&#34;Screenshot of a Node Graph&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of a Node Graph&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;To display the service graph:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&#34;/docs/tempo/latest/grafana-agent/service-graphs/#quickstart&#34;&gt;Configure Grafana Agent&lt;/a&gt; or &lt;a href=&#34;/docs/tempo/latest/metrics-generator/service_graphs/#tempo&#34;&gt;Tempo or GET&lt;/a&gt; to generate service graph data.&lt;/li&gt;
&lt;li&gt;Link a Prometheus data source in the Tempo data source&amp;rsquo;s &lt;a href=&#34;#configure-service-graph&#34;&gt;Service Graph&lt;/a&gt; settings.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Select the Tempo data source.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Service Graph&lt;/strong&gt; query type.&lt;/li&gt;
&lt;li&gt;Run the query.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;(Optional)&lt;/em&gt; Filter by service name.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For details, refer to &lt;a href=&#34;../../panels-visualizations/visualizations/node-graph/&#34;&gt;Node Graph panel&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Each circle in the graph represents a service.
To open a context menu with additional links for quick navigation to other relevant information, click a service.&lt;/p&gt;
&lt;p&gt;Numbers inside the circles indicate the average time per request and requests per second.&lt;/p&gt;
&lt;p&gt;Each circle&amp;rsquo;s color represents the percentage of requests in each state:&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;Color&lt;/th&gt;
              &lt;th&gt;State&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Green&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Success&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Red&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Fault&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Yellow&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Errors&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Purple&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Throttled responses&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;open-the-service-graph-view&#34;&gt;Open the Service Graph view&lt;/h2&gt;
&lt;p&gt;Service graph view displays a table of request rate, error rate, and duration metrics (RED) calculated from your incoming spans. It also includes a node graph view built from your spans.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 500px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/tempo/apm-table.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/tempo/apm-table.png&#34;data-srcset=&#34;/static/img/docs/tempo/apm-table.png?w=320 320w, /static/img/docs/tempo/apm-table.png?w=550 550w, /static/img/docs/tempo/apm-table.png?w=750 750w, /static/img/docs/tempo/apm-table.png?w=900 900w, /static/img/docs/tempo/apm-table.png?w=1040 1040w, /static/img/docs/tempo/apm-table.png?w=1240 1240w, /static/img/docs/tempo/apm-table.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Service Graph view table&#34;width=&#34;1074&#34;height=&#34;258&#34;title=&#34;Screenshot of the Service Graph view table&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/tempo/apm-table.png&#34;
            alt=&#34;Screenshot of the Service Graph view table&#34;width=&#34;1074&#34;height=&#34;258&#34;title=&#34;Screenshot of the Service Graph view table&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Service Graph view table&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;For details, refer to the &lt;a href=&#34;/docs/tempo/latest/metrics-generator/service-graph-view/&#34;&gt;Service Graph view documentation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To open the Service Graph view:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Link a Prometheus data source in the Tempo data source settings.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Select the Tempo data source.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Service Graph&lt;/strong&gt; query type and run the query.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;(Optional)&lt;/em&gt; Filter your results.&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Grafana uses the &lt;code&gt;traces_spanmetrics_calls_total&lt;/code&gt; metric to display the name, rate, and error rate columns, and &lt;code&gt;traces_spanmetrics_latency_bucket&lt;/code&gt; to display the duration column.
These metrics must exist in your Prometheus data source.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;To open a query in Prometheus with the span name of that row automatically set in the query, click a row in the &lt;strong&gt;rate&lt;/strong&gt;, &lt;strong&gt;error rate&lt;/strong&gt;, or &lt;strong&gt;duration&lt;/strong&gt; columns.&lt;/p&gt;
&lt;p&gt;To open a query in Tempo with the span name of that row automatically set in the query, click a row in the &lt;strong&gt;links&lt;/strong&gt; column.&lt;/p&gt;
&lt;h2 id=&#34;link-a-trace-id-from-logs&#34;&gt;Link a trace ID from logs&lt;/h2&gt;
&lt;p&gt;You can link to Tempo trace from logs in &lt;a href=&#34;/docs/loki/latest/&#34;&gt;Loki&lt;/a&gt; or Elasticsearch by configuring an internal link.&lt;/p&gt;
&lt;p&gt;To configure this feature, see the &lt;a href=&#34;../loki/#configure-derived-fields&#34;&gt;Derived fields&lt;/a&gt; section of the &lt;a href=&#34;../loki/&#34;&gt;Loki data source docs&lt;/a&gt;, or the &lt;a href=&#34;../elasticsearch/#data-links&#34;&gt;Data links&lt;/a&gt; section of the &lt;a href=&#34;../elasticsearch/&#34;&gt;Elasticsearch data source docs&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="tempo-data-source">Tempo data source&lt;/h1>
&lt;p>Grafana ships with built-in support for Tempo, a high-volume, minimal-dependency trace storage, open-source tracing solution from Grafana Labs.&lt;/p>
&lt;p>For instructions on how to add a data source to Grafana, refer to the &lt;a href="../../administration/data-source-management/">administration documentation&lt;/a>.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href="#provision-the-data-source">configure the data source via YAML&lt;/a> with Grafana&amp;rsquo;s provisioning system.&lt;/p></description></item><item><title>TestData data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/testdata/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/testdata/</guid><content><![CDATA[&lt;h1 id=&#34;testdata-data-source&#34;&gt;TestData data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with a TestData data source, which creates simulated time series data for any &lt;a href=&#34;../../panels-visualizations/&#34;&gt;panel&lt;/a&gt;.
You can use it to build your own fake and random time series data and render it in any panel, which helps you verify dashboard functionality since you can safely and easily share the data.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the TestData data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The data source doesn&amp;rsquo;t provide any settings beyond the most basic options common to all data sources:&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;Name&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;Sets the name you use to 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;Defines whether this data source is pre-selected for new panels.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;create-mock-data&#34;&gt;Create mock data&lt;/h2&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 1208px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/grafana/data-sources/screenshot-testdata-add-10.0.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/grafana/data-sources/screenshot-testdata-add-10.0.png&#34;data-srcset=&#34;/media/docs/grafana/data-sources/screenshot-testdata-add-10.0.png?w=320 320w, /media/docs/grafana/data-sources/screenshot-testdata-add-10.0.png?w=550 550w, /media/docs/grafana/data-sources/screenshot-testdata-add-10.0.png?w=750 750w, /media/docs/grafana/data-sources/screenshot-testdata-add-10.0.png?w=900 900w, /media/docs/grafana/data-sources/screenshot-testdata-add-10.0.png?w=1040 1040w, /media/docs/grafana/data-sources/screenshot-testdata-add-10.0.png?w=1240 1240w, /media/docs/grafana/data-sources/screenshot-testdata-add-10.0.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Adding test data&#34;width=&#34;1208&#34;height=&#34;388&#34;title=&#34;Adding test data&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/grafana/data-sources/screenshot-testdata-add-10.0.png&#34;
            alt=&#34;Adding test data&#34;width=&#34;1208&#34;height=&#34;388&#34;title=&#34;Adding test data&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Adding test data&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the TestData data source, your Grafana instance&amp;rsquo;s users can use it as a data source in any metric panel.&lt;/p&gt;
&lt;h3 id=&#34;choose-a-scenario&#34;&gt;Choose a scenario&lt;/h3&gt;
&lt;p&gt;Instead of providing a query editor, the TestData data source helps you select a &lt;strong&gt;Scenario&lt;/strong&gt; that generates simulated data for panels.&lt;/p&gt;
&lt;p&gt;You can assign an &lt;strong&gt;Alias&lt;/strong&gt; to each scenario, and many have their own options that appear when selected.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 1196px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/media/docs/grafana/data-sources/screenshot-testdata-csv-example-10.0.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/media/docs/grafana/data-sources/screenshot-testdata-csv-example-10.0.png&#34;data-srcset=&#34;/media/docs/grafana/data-sources/screenshot-testdata-csv-example-10.0.png?w=320 320w, /media/docs/grafana/data-sources/screenshot-testdata-csv-example-10.0.png?w=550 550w, /media/docs/grafana/data-sources/screenshot-testdata-csv-example-10.0.png?w=750 750w, /media/docs/grafana/data-sources/screenshot-testdata-csv-example-10.0.png?w=900 900w, /media/docs/grafana/data-sources/screenshot-testdata-csv-example-10.0.png?w=1040 1040w, /media/docs/grafana/data-sources/screenshot-testdata-csv-example-10.0.png?w=1240 1240w, /media/docs/grafana/data-sources/screenshot-testdata-csv-example-10.0.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Using CSV Metric Values&#34;width=&#34;1196&#34;height=&#34;628&#34;title=&#34;Using CSV Metric Values&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/grafana/data-sources/screenshot-testdata-csv-example-10.0.png&#34;
            alt=&#34;Using CSV Metric Values&#34;width=&#34;1196&#34;height=&#34;628&#34;title=&#34;Using CSV Metric Values&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Using CSV Metric Values&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Available scenarios:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Annotations&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Conditional Error&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSV Content&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSV File&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CSV Metric Values&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Datapoints Outside Range&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Exponential heatmap bucket data&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Grafana API&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Grafana Live&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Linear heatmap bucket data&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Load Apache Arrow Data&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Logs&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No Data Points&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Node Graph&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Predictable CSV Wave&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Predictable Pulse&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Random Walk&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Random Walk (with error)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Random Walk Table&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Raw Frames&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Simulation&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Slow Query&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Streaming Client&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Table Static&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;USA generated data&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;import-a-pre-configured-dashboard&#34;&gt;Import a pre-configured dashboard&lt;/h2&gt;
&lt;p&gt;TestData also provides an example dashboard.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To import the example dashboard:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to the data source&amp;rsquo;s &lt;a href=&#34;#configure-the-data-source&#34;&gt;configuration page&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Dashboards&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Import&lt;/strong&gt; for the &lt;strong&gt;Simple Streaming Example&lt;/strong&gt; dashboard.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;To customize an imported dashboard:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To customize the imported dashboard, we recommend that you save it under a different name.
If you don&amp;rsquo;t, upgrading Grafana can overwrite the customized dashboard with the new version.&lt;/p&gt;
&lt;h2 id=&#34;use-test-data-to-report-issues&#34;&gt;Use test data to report issues&lt;/h2&gt;
&lt;p&gt;If you report an issue on GitHub involving the use or rendering of time series data, we strongly recommend that you use this data source to replicate the issue.
That makes it much easier for the developers to replicate and solve your issue.&lt;/p&gt;
]]></content><description>&lt;h1 id="testdata-data-source">TestData data source&lt;/h1>
&lt;p>Grafana ships with a TestData data source, which creates simulated time series data for any &lt;a href="../../panels-visualizations/">panel&lt;/a>.
You can use it to build your own fake and random time series data and render it in any panel, which helps you verify dashboard functionality since you can safely and easily share the data.&lt;/p></description></item><item><title>Zipkin data source</title><link>https://grafana.com/docs/grafana/v9.4/datasources/zipkin/</link><pubDate>Fri, 06 Mar 2026 07:23:54 +0000</pubDate><guid>https://grafana.com/docs/grafana/v9.4/datasources/zipkin/</guid><content><![CDATA[&lt;h1 id=&#34;zipkin-data-source&#34;&gt;Zipkin data source&lt;/h1&gt;
&lt;p&gt;Grafana ships with built-in support for Zipkin, an open source, distributed tracing system.&lt;/p&gt;
&lt;p&gt;For instructions on how to add a data source to Grafana, refer to the &lt;a href=&#34;../../administration/data-source-management/&#34;&gt;administration documentation&lt;/a&gt;.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href=&#34;#provision-the-data-source&#34;&gt;configure the data source via YAML&lt;/a&gt; with Grafana&amp;rsquo;s provisioning system.&lt;/p&gt;
&lt;p&gt;Once you&amp;rsquo;ve added the Zipkin data source, you can &lt;a href=&#34;#configure-the-data-source&#34;&gt;configure it&lt;/a&gt; so that your Grafana instance&amp;rsquo;s users can create queries in its &lt;a href=&#34;#query-traces&#34;&gt;query editor&lt;/a&gt; when they &lt;a href=&#34;../../dashboards/build-dashboards/&#34;&gt;build dashboards&lt;/a&gt; and use &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;configure-the-data-source&#34;&gt;Configure the data source&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;To access the data source configuration page:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hover the cursor over the &lt;strong&gt;Configuration&lt;/strong&gt; (gear) icon.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Data Sources&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the Zipkin data source.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Set the data source&amp;rsquo;s basic configuration options carefully:&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;Name&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;Sets the name you use to 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;Defines whether this data source is pre-selected 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;Sets the URL of the Zipkin instance, such as &lt;code&gt;http://localhost:9411&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Basic Auth&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enables basic authentication for the Zipkin data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;User&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the user name for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Password&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the password for basic authentication.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;configure-trace-to-logs&#34;&gt;Configure trace to logs&lt;/h3&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 572px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/explore/traces-to-logs-settings-8-2.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/explore/traces-to-logs-settings-8-2.png&#34;data-srcset=&#34;/static/img/docs/explore/traces-to-logs-settings-8-2.png?w=320 320w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=550 550w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=750 750w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=900 900w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=1040 1040w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=1240 1240w, /static/img/docs/explore/traces-to-logs-settings-8-2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the trace to logs settings&#34;width=&#34;572&#34;height=&#34;342&#34;title=&#34;Screenshot of the trace to logs settings&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/explore/traces-to-logs-settings-8-2.png&#34;
            alt=&#34;Screenshot of the trace to logs settings&#34;width=&#34;572&#34;height=&#34;342&#34;title=&#34;Screenshot of the trace to logs settings&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the trace to logs settings&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Available in Grafana v7.4 and higher.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The &lt;strong&gt;Trace to logs&lt;/strong&gt; setting configures the &lt;a href=&#34;../../explore/trace-integration/&#34;&gt;trace to logs feature&lt;/a&gt; that is available when you integrate Grafana with Zipkin.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To configure trace to logs:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select the target data source.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select which tags to use in the logs query. The tags you configure must be present in the spans attributes or resources for a trace to logs span link to appear.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Single tag&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Configuring &lt;code&gt;job&lt;/code&gt; as a tag and clicking on a span link will take you to your configured logs datasource with the query &lt;code&gt;{job=&#39;value from clicked span&#39;}&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiple tags&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;If multiple tags are used they will be concatenated so the logs query would look like &lt;code&gt;{job=&#39;value from clicked span&#39;, service=&#39;value from clicked span&#39;}&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mapped tags&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;For a mapped tag &lt;code&gt;service.name&lt;/code&gt; with value &lt;code&gt;service&lt;/code&gt;, clicking on a span link will take you to your configured logs datasource with the query &lt;code&gt;{service=&#39;value from clicked span&#39;}&lt;/code&gt; instead of &lt;code&gt;{service.name=&#39;value from clicked span&#39;}&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;This is useful for instances where your tracing datasource tags and your logs datasource tags don&amp;rsquo;t match one-to-one.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following table describes the ways in which you can configure your trace to logs settings:&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;Name&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;Data source&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Sets the target data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the tags to use in the logs query. Default is &lt;code&gt;&#39;cluster&#39;, &#39;hostname&#39;, &#39;namespace&#39;, &#39;pod&#39;&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Map tag names&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Enables configuring how Jaeger tag names map to logs label names. For example, map &lt;code&gt;service.name&lt;/code&gt; to &lt;code&gt;service&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Span start time shift&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Shifts the start time for the logs query based on the span start time. To extend to the past, use a negative value. Use time interval units like &lt;code&gt;5s&lt;/code&gt;, &lt;code&gt;1m&lt;/code&gt;, &lt;code&gt;3h&lt;/code&gt;. Default is &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Span end time shift&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Shifts the end time for the logs query based on the span end time. Use time interval units. Default is &lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter by Trace ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggles whether to append the trace ID to the logs query.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Filter by Span ID&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Toggles whether to append the span ID to the logs query.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h3 id=&#34;configure-trace-to-metrics&#34;&gt;Configure trace to metrics&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This feature is behind the &lt;code&gt;traceToMetrics&lt;/code&gt; &lt;a href=&#34;../../setup-grafana/configure-grafana/#feature_toggles&#34;&gt;feature toggle&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The &lt;strong&gt;Trace to metrics&lt;/strong&gt; section configures the &lt;a href=&#34;/blog/2022/08/18/new-in-grafana-9.1-trace-to-metrics-allows-users-to-navigate-from-a-trace-span-to-a-selected-data-source/&#34;&gt;trace to metrics feature&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Use the settings to select the target Prometheus data source, and create any desired linked queries.&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 name&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;Data source&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the target data source.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tags&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Defines the tags used in linked queries. The key sets the span attribute name, and the optional value sets the corresponding metric label name. For example, you can map &lt;code&gt;k8s.pod&lt;/code&gt; to &lt;code&gt;pod&lt;/code&gt;. To interpolate these tags into queries, use the &lt;code&gt;$__tags&lt;/code&gt; keyword.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;Each linked query consists of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Link Label:&lt;/strong&gt; &lt;em&gt;(Optional)&lt;/em&gt; Descriptive label for the linked query.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Query:&lt;/strong&gt; The query ran when navigating from a trace to the metrics data source.
Interpolate tags using the &lt;code&gt;$__tags&lt;/code&gt; keyword.
For example, when you configure the query &lt;code&gt;requests_total{$__tags}&lt;/code&gt;with the tags &lt;code&gt;k8s.pod=pod&lt;/code&gt; and &lt;code&gt;cluster&lt;/code&gt;, the result looks like &lt;code&gt;requests_total{pod=&amp;quot;nginx-554b9&amp;quot;, cluster=&amp;quot;us-east-1&amp;quot;}&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;enable-node-graph&#34;&gt;Enable Node Graph&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Node Graph&lt;/strong&gt; setting enables the &lt;a href=&#34;../../panels-visualizations/visualizations/node-graph/&#34;&gt;Node Graph visualization&lt;/a&gt;, which is disabled by default.&lt;/p&gt;
&lt;p&gt;Once enabled, Grafana displays the Node Graph after loading the trace view.&lt;/p&gt;
&lt;h3 id=&#34;configure-the-span-bar-label&#34;&gt;Configure the span bar label&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Span bar label&lt;/strong&gt; section helps you display additional information in the span bar row.&lt;/p&gt;
&lt;p&gt;You can choose one of three 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;Name&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;None&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Adds nothing to the span bar row.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Duration&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;em&gt;(Default)&lt;/em&gt; Displays the span duration on the span bar row.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Tag&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Displays the span tag on the span bar row. You must also specify which tag key to use to get the tag value, such as &lt;code&gt;span.kind&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;query-traces&#34;&gt;Query traces&lt;/h2&gt;
&lt;p&gt;You can query and display traces from Zipkin via &lt;a href=&#34;../../explore/&#34;&gt;Explore&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This topic explains configuration and queries specific to the Zipkin data source.
For general documentation on querying data sources in Grafana, see &lt;a href=&#34;../../panels-visualizations/query-transform-data/&#34;&gt;Query and transform data&lt;/a&gt;.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 1468px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/v70/zipkin-query-editor.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/v70/zipkin-query-editor.png&#34;data-srcset=&#34;/static/img/docs/v70/zipkin-query-editor.png?w=320 320w, /static/img/docs/v70/zipkin-query-editor.png?w=550 550w, /static/img/docs/v70/zipkin-query-editor.png?w=750 750w, /static/img/docs/v70/zipkin-query-editor.png?w=900 900w, /static/img/docs/v70/zipkin-query-editor.png?w=1040 1040w, /static/img/docs/v70/zipkin-query-editor.png?w=1240 1240w, /static/img/docs/v70/zipkin-query-editor.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Zipkin query editor&#34;width=&#34;1468&#34;height=&#34;230&#34;title=&#34;Screenshot of the Zipkin query editor&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v70/zipkin-query-editor.png&#34;
            alt=&#34;Screenshot of the Zipkin query editor&#34;width=&#34;1468&#34;height=&#34;230&#34;title=&#34;Screenshot of the Zipkin query editor&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Zipkin query editor&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;To query by trace ID, enter it.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 1468px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/v70/zipkin-query-editor-open.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/v70/zipkin-query-editor-open.png&#34;data-srcset=&#34;/static/img/docs/v70/zipkin-query-editor-open.png?w=320 320w, /static/img/docs/v70/zipkin-query-editor-open.png?w=550 550w, /static/img/docs/v70/zipkin-query-editor-open.png?w=750 750w, /static/img/docs/v70/zipkin-query-editor-open.png?w=900 900w, /static/img/docs/v70/zipkin-query-editor-open.png?w=1040 1040w, /static/img/docs/v70/zipkin-query-editor-open.png?w=1240 1240w, /static/img/docs/v70/zipkin-query-editor-open.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Zipkin query editor with trace selector expanded&#34;width=&#34;1468&#34;height=&#34;528&#34;title=&#34;Screenshot of the Zipkin query editor with trace selector expanded&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v70/zipkin-query-editor-open.png&#34;
            alt=&#34;Screenshot of the Zipkin query editor with trace selector expanded&#34;width=&#34;1468&#34;height=&#34;528&#34;title=&#34;Screenshot of the Zipkin query editor with trace selector expanded&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Zipkin query editor with trace selector expanded&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;To select a particular trace from all traces logged in the time range you have selected in Explore, you can also query by trace selector.
The trace selector has three levels of nesting:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The service you&amp;rsquo;re interested in.&lt;/li&gt;
&lt;li&gt;Particular operation, part of the selected service&lt;/li&gt;
&lt;li&gt;Specific trace in which the selected operation occurred, represented by the root operation name and trace duration&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;view-data-mapping-in-the-trace-ui&#34;&gt;View data mapping in the trace UI&lt;/h2&gt;
&lt;p&gt;You can view Zipkin annotations in the trace view as logs with annotation value displayed under the annotation key.&lt;/p&gt;
&lt;h2 id=&#34;upload-a-json-trace-file&#34;&gt;Upload a JSON trace file&lt;/h2&gt;
&lt;p&gt;You can upload a JSON file that contains a single trace and visualize it.
If the file has multiple traces, Grafana visualizes its first trace.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 1857px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/explore/zipkin-upload-json.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/explore/zipkin-upload-json.png&#34;data-srcset=&#34;/static/img/docs/explore/zipkin-upload-json.png?w=320 320w, /static/img/docs/explore/zipkin-upload-json.png?w=550 550w, /static/img/docs/explore/zipkin-upload-json.png?w=750 750w, /static/img/docs/explore/zipkin-upload-json.png?w=900 900w, /static/img/docs/explore/zipkin-upload-json.png?w=1040 1040w, /static/img/docs/explore/zipkin-upload-json.png?w=1240 1240w, /static/img/docs/explore/zipkin-upload-json.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Screenshot of the Zipkin data source in explore with upload selected&#34;width=&#34;1857&#34;height=&#34;548&#34;title=&#34;Screenshot of the Zipkin data source in explore with upload selected&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/explore/zipkin-upload-json.png&#34;
            alt=&#34;Screenshot of the Zipkin data source in explore with upload selected&#34;width=&#34;1857&#34;height=&#34;548&#34;title=&#34;Screenshot of the Zipkin data source in explore with upload selected&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Screenshot of the Zipkin data source in explore with upload selected&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h3 id=&#34;trace-json-example&#34;&gt;Trace JSON example&lt;/h3&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;JSON&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-json&#34;&gt;[
  {
    &amp;#34;traceId&amp;#34;: &amp;#34;efe9cb8857f68c8f&amp;#34;,
    &amp;#34;parentId&amp;#34;: &amp;#34;efe9cb8857f68c8f&amp;#34;,
    &amp;#34;id&amp;#34;: &amp;#34;8608dc6ce5cafe8e&amp;#34;,
    &amp;#34;kind&amp;#34;: &amp;#34;SERVER&amp;#34;,
    &amp;#34;name&amp;#34;: &amp;#34;get /api&amp;#34;,
    &amp;#34;timestamp&amp;#34;: 1627975249601797,
    &amp;#34;duration&amp;#34;: 23457,
    &amp;#34;localEndpoint&amp;#34;: { &amp;#34;serviceName&amp;#34;: &amp;#34;backend&amp;#34;, &amp;#34;ipv4&amp;#34;: &amp;#34;127.0.0.1&amp;#34;, &amp;#34;port&amp;#34;: 9000 },
    &amp;#34;tags&amp;#34;: {
      &amp;#34;http.method&amp;#34;: &amp;#34;GET&amp;#34;,
      &amp;#34;http.path&amp;#34;: &amp;#34;/api&amp;#34;,
      &amp;#34;jaxrs.resource.class&amp;#34;: &amp;#34;Resource&amp;#34;,
      &amp;#34;jaxrs.resource.method&amp;#34;: &amp;#34;printDate&amp;#34;
    },
    &amp;#34;shared&amp;#34;: true
  }
]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;link-a-trace-id-from-logs&#34;&gt;Link a trace ID from logs&lt;/h2&gt;
&lt;p&gt;You can link to a Zipkin trace from logs in &lt;a href=&#34;/docs/loki/latest/&#34;&gt;Loki&lt;/a&gt; or Splunk by configuring a derived field with an internal link.&lt;/p&gt;
&lt;p&gt;For details, refer to &lt;a href=&#34;../loki/#configure-derived-fields&#34;&gt;Derived fields&lt;/a&gt; section of the &lt;a href=&#34;../loki/&#34;&gt;Loki data source&lt;/a&gt; documentation.&lt;/p&gt;
]]></content><description>&lt;h1 id="zipkin-data-source">Zipkin data source&lt;/h1>
&lt;p>Grafana ships with built-in support for Zipkin, an open source, distributed tracing system.&lt;/p>
&lt;p>For instructions on how to add a data source to Grafana, refer to the &lt;a href="../../administration/data-source-management/">administration documentation&lt;/a>.
Only users with the organization administrator role can add data sources.
Administrators can also &lt;a href="#provision-the-data-source">configure the data source via YAML&lt;/a> with Grafana&amp;rsquo;s provisioning system.&lt;/p></description></item></channel></rss>