<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Prometheus data source on Grafana Labs</title><link>https://grafana.com/docs/grafana/v12.4/datasources/prometheus/</link><description>Recent content in Prometheus data source on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v12.4/datasources/prometheus/index.xml" rel="self" type="application/rss+xml"/><item><title>Configure the Prometheus data source</title><link>https://grafana.com/docs/grafana/v12.4/datasources/prometheus/configure/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/prometheus/configure/</guid><content><![CDATA[&lt;h1 id=&#34;configure-the-prometheus-data-source&#34;&gt;Configure the Prometheus data source&lt;/h1&gt;
&lt;p&gt;This document provides instructions for configuring the Prometheus data source and explains the available configuration options. Grafana includes built-in support for Prometheus, so you don&amp;rsquo;t need to install a plugin. For general information on adding a data source to Grafana, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/#add-a-data-source&#34;&gt;Add a data source&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;before-you-begin&#34;&gt;Before you begin&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;You need the &lt;code&gt;Organization administrator&lt;/code&gt; role to configure the data source. You can also &lt;a href=&#34;#provision-the-prometheus-data-source&#34;&gt;configure it via YAML&lt;/a&gt; using Grafana provisioning.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Grafana includes a built-in Prometheus data source; no plugin installation is required.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Know which type of Prometheus-compatible database you&amp;rsquo;re connecting to (Prometheus, Mimir, Cortex, or Thanos), as the configuration options vary by type.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Have your Prometheus server URL ready. If using TLS/SSL, gather any necessary security certificates and client keys.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If using Basic authentication, have your username and password ready.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;configure-the-data-source-using-the-ui&#34;&gt;Configure the data source using the UI&lt;/h2&gt;
&lt;p&gt;To add the Prometheus data source, complete the following steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Connections&lt;/strong&gt; in the left-side menu.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Connections&lt;/strong&gt;, click &lt;strong&gt;Add new connection&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter &lt;code&gt;Prometheus&lt;/code&gt; in the search bar.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Prometheus data source&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add new data source&lt;/strong&gt; in the upper right.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Grafana takes you to the &lt;strong&gt;Settings&lt;/strong&gt; tab where you will set up your Prometheus configuration.&lt;/p&gt;
&lt;h2 id=&#34;configuration-options&#34;&gt;Configuration options&lt;/h2&gt;
&lt;p&gt;Following is a list of configuration options for Prometheus.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Name&lt;/strong&gt; - The data source name. Sets the name you use to refer to the data source in panels and queries. Examples: prometheus-1, prom-metrics.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Default&lt;/strong&gt; - Toggle to select as the default name in dashboard panels. When you go to a dashboard panel this will be the default selected data source.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Connection:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Prometheus server URL&lt;/strong&gt; - The URL of your Prometheus server. &lt;p&gt;If Prometheus is running locally, use &lt;code&gt;http://localhost:9090&lt;/code&gt;. If it&amp;rsquo;s hosted on a networked server, provide the server’s URL along with the port where Prometheus is running. Example: &lt;code&gt;http://prometheus.example.orgname:9090&lt;/code&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;When running Grafana and Prometheus in separate containers, localhost refers to each container’s own network namespace. This means that &lt;code&gt;localhost:9090&lt;/code&gt; points to port 9090 inside the Grafana container, not on the host machine.&lt;/p&gt;
&lt;p&gt;Use the IP address of the Prometheus container, or the hostname if you are using Docker Compose. Alternatively, you can use &lt;code&gt;http://host.docker.internal:9090&lt;/code&gt; to reference the host machine.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Authentication:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are three authentication options for the Prometheus data source.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Basic authentication&lt;/strong&gt; - The most common authentication method.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;User&lt;/strong&gt; - The username you use to connect to the data source.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Password&lt;/strong&gt; - The password you use to connect to the data source.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Forward OAuth identity&lt;/strong&gt; - Forward the OAuth access token (and also the OIDC ID token if available) of the user querying the data source.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;No authentication&lt;/strong&gt; - Allows access to the data source without any authentication.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;TLS settings:&lt;/strong&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;Use TLS (Transport Layer Security) for an additional layer of security when working with Prometheus. For information on setting up TLS encryption with Prometheus refer to &lt;a href=&#34;https://prometheus.io/docs/guides/tls-encryption/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Securing Prometheus API and UI Endpoints Using TLS Encryption&lt;/a&gt;. You must add TLS settings to your Prometheus configuration file &lt;strong&gt;prior&lt;/strong&gt; to setting these options in Grafana.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Add self-signed certificate&lt;/strong&gt; - Check the box to authenticate with a CA certificate. Follow the instructions of the CA (Certificate Authority) to download the certificate file. Required for verifying self-signed TLS certificates.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;CA certificate&lt;/strong&gt; - Add your certificate.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;TLS client authentication&lt;/strong&gt; - Check the box to enable TLS client authentication.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Server name&lt;/strong&gt; - Add the server name, which is used to verify the hostname on the returned certificate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client certificate&lt;/strong&gt; - The client certificate is generated from a Certificate Authority or its self-signed. Follow the instructions of the CA (Certificate Authority) to download the certificate file.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Client key&lt;/strong&gt; - Add your client key, which can also be generated from a Certificate Authority (CA) or be self-signed. The client key encrypts data between the client and server.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Skip TLS verify&lt;/strong&gt; - Toggle on to bypass TLS certificate validation. Skipping TLS certificate validation is not recommended unless absolutely necessary or for testing purposes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;HTTP headers:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Pass along additional information and metadata about the request or response.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Header&lt;/strong&gt; - Add a custom header. This allows custom headers to be passed based on the needs of your Prometheus instance.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Value&lt;/strong&gt; - The value of the header.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Advanced settings:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Following are optional configuration settings you can configure for more control over your data source.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Advanced HTTP settings:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Allowed cookies&lt;/strong&gt; - Specify cookies by name that should be forwarded to the data source. The Grafana proxy deletes all forwarded cookies by default.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Timeout&lt;/strong&gt; - The HTTP request timeout, must be in seconds.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Alerting:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Manage alerts via Alerting UI&lt;/strong&gt; -Toggled on by default. This enables 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/fundamentals/alert-rules/&#34;&gt;data source-managed rules in Grafana Alerting&lt;/a&gt; for this data source. For &lt;code&gt;Mimir&lt;/code&gt;, it enables managing data source-managed rules and alerts. For &lt;code&gt;Prometheus&lt;/code&gt;, it only supports viewing existing rules and alerts, which are displayed as data source-managed. Change this by setting the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/#default_manage_alerts_ui_toggle&#34;&gt;&lt;code&gt;default_manage_alerts_ui_toggle&lt;/code&gt;&lt;/a&gt; option in the &lt;code&gt;grafana.ini&lt;/code&gt; configuration file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Allow as recording rules target&lt;/strong&gt; - Toggled on by default. This allows the data source to be selected as a target destination for writing 
    &lt;a href=&#34;/docs/grafana/v12.4/alerting/alerting-rules/create-recording-rules/create-grafana-managed-recording-rules/&#34;&gt;Grafana-managed recording rules&lt;/a&gt;. When enabled, this data source will appear in the target data source list when creating or importing recording rules. When disabled, the data source will be filtered out from recording rules target selection. Change this by setting the 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/#default_allow_recording_rules_target_alerts_ui_toggle&#34;&gt;&lt;code&gt;default_allow_recording_rules_target_alerts_ui_toggle&lt;/code&gt;&lt;/a&gt; option in the &lt;code&gt;grafana.ini&lt;/code&gt; configuration file.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Interval behavior:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Scrape interval&lt;/strong&gt; - Sets the standard scrape and evaluation interval in Prometheus. The default is &lt;code&gt;15s&lt;/code&gt;. This interval determines how often Prometheus scrapes targets. Set it to match the typical scrape and evaluation interval in your Prometheus configuration file. If you set a higher value than your Prometheus configuration, Grafana will evaluate data at this interval, resulting in fewer data points.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Query timeout&lt;/strong&gt; - Sets the Prometheus query timeout. The default is &lt;code&gt;60s&lt;/code&gt;. Without a timeout, complex or inefficient queries can run indefinitely, consuming CPU and memory resources.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Query editor:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Default editor&lt;/strong&gt; - Sets the default query editor. Options are &lt;code&gt;Builder&lt;/code&gt; or &lt;code&gt;Code&lt;/code&gt;. &lt;code&gt;Builder&lt;/code&gt; mode helps you build queries using a visual interface. &lt;code&gt;Code&lt;/code&gt; mode is geared for the experienced Prometheus user with prior expertise in PromQL. For more details on editor types refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/prometheus/query-editor/&#34;&gt;Prometheus query editor&lt;/a&gt;. You can switch easily code editors in the Query editor UI.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Disable metrics lookup&lt;/strong&gt; - Toggle on to disable the metrics chooser and metric and label support in the query field&amp;rsquo;s autocomplete. This can improve performance for large Prometheus instances.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Performance:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Prometheus type&lt;/strong&gt; - Select the type of your Prometheus-compatible database, such as Prometheus, Cortex, Mimir, or Thanos. Changing this setting will save your current configuration. Different database types support different APIs. For example, some allow &lt;code&gt;regex&lt;/code&gt; matching for label queries to improve performance, while others provide a metadata API. Setting this incorrectly may cause unexpected behavior when querying metrics and labels. Refer to your Prometheus documentation to ensure you select the correct type.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cache level&lt;/strong&gt; - Sets the browser caching level for editor queries. There are four options: &lt;code&gt;Low&lt;/code&gt;, &lt;code&gt;Medium&lt;/code&gt;, &lt;code&gt;High&lt;/code&gt;, or &lt;code&gt;None&lt;/code&gt;. Higher cache settings are recommended for high cardinality data sources.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Incremental querying (beta)&lt;/strong&gt; - Toggle on to enable incremental querying. Enabling this feature changes the default behavior of relative queries. Instead of always requesting fresh data from the Prometheus instance, Grafana will cache query results and only fetch new records. This helps reduce database and network load.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Query overlap window&lt;/strong&gt; - If you are using incremental querying, specify a duration (e.g., 10m, 120s, or 0s). The default is &lt;code&gt;10m&lt;/code&gt;. This is a buffer of time added to incremental queries and this value is added to the duration of each incremental request.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Disable recording rules (beta)&lt;/strong&gt; - Toggle on to disable the recording rules. When recording rules are disabled, Grafana won&amp;rsquo;t fetch and parse recording rules from Prometheus, improving dashboard performance by reducing processing overhead..&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Other settings:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Custom query parameters&lt;/strong&gt; - Add custom parameters to the Prometheus query URL, which allow for more control over how queries are executed. Examples: &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 joined using &lt;code&gt;&amp;amp;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HTTP method&lt;/strong&gt; - Select either the &lt;code&gt;POST&lt;/code&gt; or &lt;code&gt;GET&lt;/code&gt; HTTP method to query your data source. &lt;code&gt;POST&lt;/code&gt;is recommended and selected by default, as it supports larger queries. Select &lt;code&gt;GET&lt;/code&gt; if you&amp;rsquo;re using Prometheus version 2.1 or older, or if your network restricts &lt;code&gt;POST&lt;/code&gt; requests.
Toggle on&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Series limit&lt;/strong&gt; - Number of maximum returned series. The limit applies to all resources (metrics, labels, and values) for both endpoints (series and labels). Leave the field empty to use the default limit (40000). Set to 0 to disable the limit and fetch everything — this may cause performance issues. Default limit is 40000.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use series endpoint&lt;/strong&gt; - Enabling this option makes Grafana use the series endpoint (/api/v1/series) with the match[] parameter instead of the label values endpoint (/api/v1/label/&amp;lt;label_name&amp;gt;/values). While the label values endpoint is generally more performant, some users may prefer the series endpoint because it supports the &lt;code&gt;POST&lt;/code&gt; method, whereas the label values endpoint only allows &lt;code&gt;GET&lt;/code&gt; requests.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Exemplars:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Support for exemplars is available only for the Prometheus data source. For more information on exemplars refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/fundamentals/exemplars/&#34;&gt;Introduction to exemplars&lt;/a&gt;. An exemplar is a trace that represents a specific measurement taken within a given time interval.&lt;/p&gt;
&lt;p&gt;Click the &lt;strong&gt;&#43; sign&lt;/strong&gt; to add exemplars.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Internal link&lt;/strong&gt; - Toggle on to enable an internal link. This will display the data source selector, where you can choose the backend tracing data store for your exemplar data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;URL&lt;/strong&gt; - &lt;em&gt;(Visible if you &lt;strong&gt;disable&lt;/strong&gt; &lt;code&gt;Internal link&lt;/code&gt;)&lt;/em&gt; Defines the external link&amp;rsquo;s URL trace backend. You can interpolate the value from the field by using the 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/configure-data-links/#value-variables&#34;&gt;&lt;code&gt;${__value.raw}&lt;/code&gt; macro&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Data source&lt;/strong&gt; - &lt;em&gt;(Visible when&lt;code&gt;Internal link&lt;/code&gt; is enabled.)&lt;/em&gt; Select the data source that the exemplar will link to from the drop-down.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;URL label&lt;/strong&gt; - Adds a custom display label to override the value of the &lt;code&gt;Label name&lt;/code&gt; field.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Label name&lt;/strong&gt; - The name of the field in the &lt;code&gt;labels&lt;/code&gt; object used to obtain the traceID property.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Remove exemplar link&lt;/strong&gt; - Click the &lt;strong&gt;X&lt;/strong&gt; to remove existing links.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can add multiple exemplars.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Private data source connect&lt;/strong&gt; - &lt;em&gt;Only for Grafana Cloud users.&lt;/em&gt; Private data source connect, or PDC, allows you to establish a private, secured connection between a Grafana Cloud instance, or stack, and data sources secured within a private network. Click the drop-down to locate the URL for PDC. For more information regarding Grafana PDC refer to &lt;a href=&#34;/docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/&#34;&gt;Private data source connect (PDC)&lt;/a&gt; and &lt;a href=&#34;/docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/configure-pdc/#configure-grafana-private-data-source-connect-pdc&#34;&gt;Configure Grafana private data source connect (PDC)&lt;/a&gt; for steps on setting up a PDC connection.&lt;/p&gt;
&lt;p&gt;If you use PDC with SIGv4 (AWS Signature Version 4 Authentication), the PDC agent must allow internet egress to&lt;code&gt;sts.&amp;lt;region&amp;gt;.amazonaws.com:443&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Click &lt;strong&gt;Manage private data source connect&lt;/strong&gt; to open your PDC connection page and view your configuration details.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After you have configured your Prometheus data source options, click &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt; at the bottom to test out your data source connection.&lt;/p&gt;
&lt;p&gt;You should see a confirmation dialog box that says:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Successfully queried the Prometheus API.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Next, you can start to visualize data by building a dashboard, or by querying data in the Explore view.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can also remove a connection by clicking &lt;strong&gt;Delete&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&#34;provision-the-prometheus-data-source&#34;&gt;Provision the Prometheus data source&lt;/h2&gt;
&lt;p&gt;You can define and configure the data source in YAML files as part of the Grafana provisioning system. For more information about provisioning, and for available configuration options, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/administration/provisioning/&#34;&gt;Provision Grafana&lt;/a&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;After you have provisioned a data source you cannot edit it.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Example of a Prometheus data source configuration:&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: Prometheus
    type: prometheus
    access: proxy
    url: http://localhost:9090
    jsonData:
      httpMethod: POST
      manageAlerts: true
      allowAsRecordingRulesTarget: true
      prometheusType: Prometheus
      prometheusVersion: 3.3.0
      cacheLevel: &amp;#39;High&amp;#39;
      disableRecordingRules: false
      seriesEndpoint: false
      timeInterval: 10s # Prometheus scrape interval
      incrementalQueryOverlapWindow: 10m
      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;azure-authentication-settings&#34;&gt;Azure authentication settings&lt;/h2&gt;
&lt;p&gt;The Prometheus data source works with Azure authentication. To configure Azure authentication refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/datasources/azure-monitor/#configure-azure-active-directory-ad-authentication&#34;&gt;Configure Azure Active Directory (AD) authentication&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In Grafana Enterprise, you need to update the .ini configuration file. Refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/setup-grafana/configure-grafana/#configuration-file-location&#34;&gt;Configuration file location&lt;/a&gt; to locate your .ini file.&lt;/p&gt;
&lt;p&gt;Add the following setting in the &lt;strong&gt;[auth]&lt;/strong&gt; section of the .ini configuration file:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&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-bash&#34;&gt;[auth]
azure_auth_enabled = true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&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;If you are using Azure authentication, don&amp;rsquo;t enable &lt;code&gt;Forward OAuth identity&lt;/code&gt;. Both methods use the same HTTP authorization headers, and the OAuth token will override your Azure credentials.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;recording-rules-beta&#34;&gt;Recording rules (beta)&lt;/h2&gt;
&lt;p&gt;You can configure the Prometheus data source to disable recording rules in the data source configuration or provisioning file under &lt;code&gt;disableRecordingRules&lt;/code&gt; in jsonData.&lt;/p&gt;
&lt;h2 id=&#34;troubleshooting-configuration-issues&#34;&gt;Troubleshooting configuration issues&lt;/h2&gt;
&lt;p&gt;Refer to the following troubleshooting information as needed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Data doesn&amp;rsquo;t appear in Metrics Drilldown:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you have successfully tested the connection to a Prometheus data source or are sending metrics to Grafana Cloud and there is no metric data appearing in Explore, make sure you&amp;rsquo;ve selected the correct data source from the data source drop-down menu. When using &lt;code&gt;remote_write&lt;/code&gt; to send metrics to Grafana Cloud, the data source name follows the convention &lt;code&gt;grafanacloud-stackname-prom&lt;/code&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-the-prometheus-data-source">Configure the Prometheus data source&lt;/h1>
&lt;p>This document provides instructions for configuring the Prometheus data source and explains the available configuration options. Grafana includes built-in support for Prometheus, so you don&amp;rsquo;t need to install a plugin. For general information on adding a data source to Grafana, refer to
&lt;a href="/docs/grafana/v12.4/datasources/#add-a-data-source">Add a data source&lt;/a>.&lt;/p></description></item><item><title>Prometheus query editor</title><link>https://grafana.com/docs/grafana/v12.4/datasources/prometheus/query-editor/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/prometheus/query-editor/</guid><content><![CDATA[&lt;h1 id=&#34;prometheus-query-editor&#34;&gt;Prometheus query editor&lt;/h1&gt;
&lt;p&gt;Grafana provides a query editor for the Prometheus data source to create queries in PromQL. For more information about PromQL, see &lt;a href=&#34;http://prometheus.io/docs/querying/basics/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Querying Prometheus&lt;/a&gt;. The Prometheus query editor is located on the 
    &lt;a href=&#34;/docs/grafana/v12.4/explore/&#34;&gt;Explore page&lt;/a&gt;. You can also access the PostgreSQL query editor from a dashboard panel. Click the ellipsis in the upper right of the panel and select &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;For general documentation on querying data sources in Grafana, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/query-transform-data/&#34;&gt;Query and transform data&lt;/a&gt;. For options and functions common to all query editors, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/query-transform-data/&#34;&gt;Query editors&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The Prometheus query editor has two modes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#builder-mode&#34;&gt;Builder mode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#code-mode&#34;&gt;Code mode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/prometheus/builder-code-v11-mode.png&#34;
  alt=&#34;Query editor mode&#34; width=&#34;1130&#34;
     height=&#34;216&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Grafana synchronizes both modes, allowing you to switch between them. Grafana also displays a warning message if it detects an issue with the query while switching modes.&lt;/p&gt;
&lt;p&gt;You can configure Prometheus-specific options in the query editor by setting several options regardless of mode.&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/prometheus/options.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/prometheus/options.png&#34;data-srcset=&#34;/static/img/docs/prometheus/options.png?w=320 320w, /static/img/docs/prometheus/options.png?w=550 550w, /static/img/docs/prometheus/options.png?w=750 750w, /static/img/docs/prometheus/options.png?w=900 900w, /static/img/docs/prometheus/options.png?w=1040 1040w, /static/img/docs/prometheus/options.png?w=1240 1240w, /static/img/docs/prometheus/options.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Options&#34;width=&#34;820&#34;height=&#34;114&#34;title=&#34;Options&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/prometheus/options.png&#34;
            alt=&#34;Options&#34;width=&#34;820&#34;height=&#34;114&#34;title=&#34;Options&#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;Options&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;h2 id=&#34;builder-mode&#34;&gt;Builder mode&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Builder mode&lt;/strong&gt; helps you build queries using a visual interface. This option is best for users who have limited experience working with Prometheus and PromQL.&lt;/p&gt;
&lt;p&gt;The following video demonstrates how to use the visual Prometheus query builder:&lt;/p&gt;





  
  
  


&lt;div&gt;
  &lt;iframe src=&#34;https://player.vimeo.com/video/742056367?transparent=0&#34; title=&#34;vimeo video&#34; webkitallowfullscreen=&#34;&#34; mozallowfullscreen=&#34;&#34; allowfullscreen=&#34;&#34;&gt;&lt;/iframe&gt;
  &lt;div &gt;
    
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Builder mode contains the following components:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Kick start your query&lt;/strong&gt; - Click to view a list of predefined operation patterns that help you quickly build queries with multiple operations. These include:
&lt;ul&gt;
&lt;li&gt;Rate query starters&lt;/li&gt;
&lt;li&gt;Histogram query starters&lt;/li&gt;
&lt;li&gt;Binary query starters&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Click the arrow next to each to see the available options to add to your query.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Explain&lt;/strong&gt; - Toggle on to display a step-by-step explanation of all query components and operations.&lt;/li&gt;
&lt;/ul&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/prometheus/explain-results.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/prometheus/explain-results.png&#34;data-srcset=&#34;/static/img/docs/prometheus/explain-results.png?w=320 320w, /static/img/docs/prometheus/explain-results.png?w=550 550w, /static/img/docs/prometheus/explain-results.png?w=750 750w, /static/img/docs/prometheus/explain-results.png?w=900 900w, /static/img/docs/prometheus/explain-results.png?w=1040 1040w, /static/img/docs/prometheus/explain-results.png?w=1240 1240w, /static/img/docs/prometheus/explain-results.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Explain results&#34;width=&#34;1673&#34;height=&#34;366&#34;title=&#34;Explain results&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/prometheus/explain-results.png&#34;
            alt=&#34;Explain results&#34;width=&#34;1673&#34;height=&#34;366&#34;title=&#34;Explain results&#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;Explain results&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Builder/Code&lt;/strong&gt; - Click the corresponding &lt;strong&gt;Builder&lt;/strong&gt; or &lt;strong&gt;Code&lt;/strong&gt; tab on the toolbar to select an editor mode.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you select Builder mode you will see the following options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Metric&lt;/strong&gt; - Select a metric from the drop-down. Click the icon to open Metrics explorer, where you can search for metrics by name and filter by type if your instance has a large number of metrics. Refer to &lt;a href=&#34;#metrics-explorer&#34;&gt;Metrics explorer&lt;/a&gt; for more detail on using this feature.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Label filters&lt;/strong&gt; - Select label filters from the drop-down. Select an operator and a value.
Select desired labels and their values from the drop-down list.
When a metric is selected, the data source requests available labels and their values from the server.
Use the &lt;code&gt;&#43;&lt;/code&gt; button to add a label, and the &lt;code&gt;x&lt;/code&gt; button to remove a label.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Click &lt;strong&gt;&#43; Operations&lt;/strong&gt; to select from a list of operations including Aggregations, Range functions, Functions, Binary operations, Trigonometric and Time functions. You can select multiple operations. Refer to &lt;a href=&#34;#operations&#34;&gt;Operations&lt;/a&gt; for more detail.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Options:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Legend&lt;/strong&gt;- Lets you customize the name for the time series. You can use a predefined or custom format.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Auto&lt;/strong&gt; - Displays unique labels. Also displays all overlapping labels if a series has multiple labels.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Verbose&lt;/strong&gt; - Displays all label names.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Custom&lt;/strong&gt; - Lets you customize the legend using label templates. For example, &lt;code&gt;{{hostname}}&lt;/code&gt; is replaced with the value of the &lt;code&gt;hostname&lt;/code&gt; label. To switch to a different legend mode, clear the input and click outside the field.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Min step&lt;/strong&gt; - Sets the minimum interval between data points returned by the query. For example, setting this to &lt;code&gt;1h&lt;/code&gt; suggests that data is collected or displayed at hourly intervals. This setting supports the &lt;code&gt;$__interval&lt;/code&gt; and &lt;code&gt;$__rate_interval&lt;/code&gt; macros. Note that the time range of the query is aligned to this step size, which may adjust the actual start and end times of the returned data.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Format&lt;/strong&gt; - Determines how the data from your Prometheus query is interpreted and visualized in a panel. Choose from the following format options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Time series&lt;/strong&gt; - The default format. Refer to &lt;a href=&#34;/developers/dataplane/timeseries/&#34;&gt;Time series kind formats&lt;/a&gt; for information on time series data frames and how time and value fields are structured.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Table&lt;/strong&gt; - Displays data in table format. This format works only in a 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/visualizations/table/&#34;&gt;Table panel&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Heatmap&lt;/strong&gt; - Displays Histogram-type metrics in a 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/visualizations/heatmap/&#34;&gt;Heatmap panel&lt;/a&gt; by converting cumulative histograms to regular ones and sorting the series by the bucket bound. Converts cumulative histogram data into regular histogram format and sorts the series by bucket boundaries for proper display.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Type&lt;/strong&gt; - This setting determines the query type. These include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Both&lt;/strong&gt; - The default option. Returns results for both a &lt;strong&gt;Range&lt;/strong&gt; query and an &lt;strong&gt;Instant&lt;/strong&gt; query.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Range&lt;/strong&gt; - Returns a range vector - a set of time series
a set of time series where each series includes multiple data points over a period of time. You can choose to visualize the data as lines, bars, points, stacked lines, or stacked bars.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Instant&lt;/strong&gt; - Returns a single data point per series — the most recent value within the selected time range. The results can be displayed in a table or as raw data. To visualize instant query results in a time series panel, start by adding field override, then add a property to the override called &lt;code&gt;Transform&lt;/code&gt;, and set the Transform value to &lt;code&gt;Constant&lt;/code&gt; in the drop-down. For more information, refer to the 
    &lt;a href=&#34;/docs/grafana/v12.4/panels-visualizations/visualizations/time-series/#transform&#34;&gt;Time Series Transform option documentation&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&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;Grafana adjusts the query time range to align with the dynamically calculated step interval. This alignment ensures consistent metric visualization and supports Prometheus&amp;rsquo;s result caching requirements. However, this alignment can cause minor visual differences, such as a slight gap at the graph&amp;rsquo;s right edge or a shifted start time. For example, a &lt;code&gt;15s&lt;/code&gt; step aligns timestamps to Unix times divisible by 15 seconds. A &lt;code&gt;1w&lt;/code&gt; &lt;code&gt;minstep&lt;/code&gt; aligns the range to the start of the week, which for Prometheus is Thursday at 00:00 UTC.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Exemplars&lt;/strong&gt; - Toggle on to run a query that includes exemplars in the graph. Exemplars are unique to Prometheus. For more information see 
    &lt;a href=&#34;/docs/grafana/v12.4/fundamentals/exemplars/&#34;&gt;Introduction to exemplars&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&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;There is no option to add exemplars with an &lt;strong&gt;Instant&lt;/strong&gt; query type.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;filter-metrics&#34;&gt;Filter metrics&lt;/h3&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/prometheus/metrics-and-labels.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/prometheus/metrics-and-labels.png&#34;data-srcset=&#34;/static/img/docs/prometheus/metrics-and-labels.png?w=320 320w, /static/img/docs/prometheus/metrics-and-labels.png?w=550 550w, /static/img/docs/prometheus/metrics-and-labels.png?w=750 750w, /static/img/docs/prometheus/metrics-and-labels.png?w=900 900w, /static/img/docs/prometheus/metrics-and-labels.png?w=1040 1040w, /static/img/docs/prometheus/metrics-and-labels.png?w=1240 1240w, /static/img/docs/prometheus/metrics-and-labels.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Metric and label filters&#34;width=&#34;641&#34;height=&#34;120&#34;title=&#34;Metric and label filters&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/prometheus/metrics-and-labels.png&#34;
            alt=&#34;Metric and label filters&#34;width=&#34;641&#34;height=&#34;120&#34;title=&#34;Metric and label filters&#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;Metric and label filters&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;When you are ready to create a query, you can choose the specific metric name from the drop-down list under &lt;strong&gt;Metric&lt;/strong&gt;.
The data source provides the list of available metrics based on the selected time range.
You can also enter text into the selector when the drop-down is open to search and filter the list.&lt;/p&gt;
&lt;h4 id=&#34;metrics-explorer-in-builder-mode&#34;&gt;Metrics explorer in Builder mode&lt;/h4&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/prometheus/screenshot-grafana-prometheus-metrics-explorer-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/prometheus/screenshot-grafana-prometheus-metrics-explorer-2.png&#34;data-srcset=&#34;/static/img/docs/prometheus/screenshot-grafana-prometheus-metrics-explorer-2.png?w=320 320w, /static/img/docs/prometheus/screenshot-grafana-prometheus-metrics-explorer-2.png?w=550 550w, /static/img/docs/prometheus/screenshot-grafana-prometheus-metrics-explorer-2.png?w=750 750w, /static/img/docs/prometheus/screenshot-grafana-prometheus-metrics-explorer-2.png?w=900 900w, /static/img/docs/prometheus/screenshot-grafana-prometheus-metrics-explorer-2.png?w=1040 1040w, /static/img/docs/prometheus/screenshot-grafana-prometheus-metrics-explorer-2.png?w=1240 1240w, /static/img/docs/prometheus/screenshot-grafana-prometheus-metrics-explorer-2.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Metrics explorer&#34;width=&#34;1322&#34;height=&#34;643&#34;title=&#34;Metrics explorer&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/prometheus/screenshot-grafana-prometheus-metrics-explorer-2.png&#34;
            alt=&#34;Metrics explorer&#34;width=&#34;1322&#34;height=&#34;643&#34;title=&#34;Metrics explorer&#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;Metrics explorer&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Click the &lt;strong&gt;Open book icon&lt;/strong&gt; to open the Metrics explorer, where you can search for and filter all the metrics in your instance.&lt;/p&gt;
&lt;p&gt;If you would like to explore your metrics in the query builder further, you can open the &lt;strong&gt;Metrics explorer&lt;/strong&gt; by clicking the first option in the metric select component of the query builder.&lt;/p&gt;
&lt;p&gt;The Metrics explorer displays all metrics in a paginated table list. The list shows the total number of metrics, as well as the name, type, and description for each metric. You can enter text into the search input to filter results.
You can also filter by type.&lt;/p&gt;
&lt;p&gt;The following options are included under the &lt;strong&gt;Additional Settings&lt;/strong&gt; drop-down:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Include description in search&lt;/strong&gt;: Toggle on to search by both name and description.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Include results with no metadata&lt;/strong&gt;: Toggle on to include metrics that lack type or description metadata.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Disable text wrap&lt;/strong&gt;: Toggle on to disable text wrapping.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enable regex search&lt;/strong&gt;: Toggle on to filter metric names by regex search, which uses an additional call on the Prometheus API.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The Metrics explorer (Builder mode) and &lt;a href=&#34;#metrics-browser-in-code-mode&#34;&gt;Metrics browser (Code mode)&lt;/a&gt; are separate elements. The Metrics explorer does not have the ability to browse labels yet, but the Metrics browser can display all labels on a metric name.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h3 id=&#34;operations&#34;&gt;Operations&lt;/h3&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/prometheus/operations.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/prometheus/operations.png&#34;data-srcset=&#34;/static/img/docs/prometheus/operations.png?w=320 320w, /static/img/docs/prometheus/operations.png?w=550 550w, /static/img/docs/prometheus/operations.png?w=750 750w, /static/img/docs/prometheus/operations.png?w=900 900w, /static/img/docs/prometheus/operations.png?w=1040 1040w, /static/img/docs/prometheus/operations.png?w=1240 1240w, /static/img/docs/prometheus/operations.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Operations&#34;width=&#34;652&#34;height=&#34;102&#34;title=&#34;Operations&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/prometheus/operations.png&#34;
            alt=&#34;Operations&#34;width=&#34;652&#34;height=&#34;102&#34;title=&#34;Operations&#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;Operations&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Select the &lt;strong&gt;&#43; Operations&lt;/strong&gt; button to add operations to your query.&lt;/p&gt;
&lt;p&gt;The query editor groups operations into the following sections:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Aggregations - for additional information see &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Aggregation operators&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Range functions - for additional information see &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/functions/#functions&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Functions&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Functions - for additional information see &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/functions/#functions&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Functions&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Binary operations - for additional information see &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/operators/#binary-operators&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Binary operators&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Trigonometric - for additional information see &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/functions/#trigonometric-functions&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Trigonometric functions&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Time functions - for additional information see &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/functions/#functions&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Functions&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All operations have function parameters under the operation header. Click the &lt;code&gt;operator&lt;/code&gt; to see a full list of supported functions. Some operations allow you to apply specific labels to functions.&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/prometheus/use-function-by-label-9-5.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/prometheus/use-function-by-label-9-5.png&#34;data-srcset=&#34;/static/img/docs/prometheus/use-function-by-label-9-5.png?w=320 320w, /static/img/docs/prometheus/use-function-by-label-9-5.png?w=550 550w, /static/img/docs/prometheus/use-function-by-label-9-5.png?w=750 750w, /static/img/docs/prometheus/use-function-by-label-9-5.png?w=900 900w, /static/img/docs/prometheus/use-function-by-label-9-5.png?w=1040 1040w, /static/img/docs/prometheus/use-function-by-label-9-5.png?w=1240 1240w, /static/img/docs/prometheus/use-function-by-label-9-5.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Functions and labels&#34;width=&#34;614&#34;height=&#34;429&#34;title=&#34;Functions and labels&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/prometheus/use-function-by-label-9-5.png&#34;
            alt=&#34;Functions and labels&#34;width=&#34;614&#34;height=&#34;429&#34;title=&#34;Functions and labels&#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;Functions and labels&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;Some operations are only valid when used in a specific order. If you add an operation in a way that would create an invalid or illogical query, the query editor automatically places it in the correct position to maintain a valid query structure.&lt;/p&gt;
&lt;h3 id=&#34;hints&#34;&gt;Hints&lt;/h3&gt;
&lt;p&gt;The query editor can detect which operations are most appropriate for certain selected metrics.
When it does, it displays a hint next to the &lt;strong&gt;&#43; Operations&lt;/strong&gt; button.&lt;/p&gt;
&lt;p&gt;To add the operation to your query, click the &lt;strong&gt;Hint&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: 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/prometheus/hint-example.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/prometheus/hint-example.png&#34;data-srcset=&#34;/static/img/docs/prometheus/hint-example.png?w=320 320w, /static/img/docs/prometheus/hint-example.png?w=550 550w, /static/img/docs/prometheus/hint-example.png?w=750 750w, /static/img/docs/prometheus/hint-example.png?w=900 900w, /static/img/docs/prometheus/hint-example.png?w=1040 1040w, /static/img/docs/prometheus/hint-example.png?w=1240 1240w, /static/img/docs/prometheus/hint-example.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Hint&#34;width=&#34;655&#34;height=&#34;197&#34;title=&#34;Hint&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/prometheus/hint-example.png&#34;
            alt=&#34;Hint&#34;width=&#34;655&#34;height=&#34;197&#34;title=&#34;Hint&#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;Hint&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;When you are satisfied with your query, click &lt;strong&gt;Run query&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&#34;code-mode&#34;&gt;Code mode&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Code mode&lt;/strong&gt; is for the experienced Prometheus user with prior expertise in PromQL, Prometheus&amp;rsquo; query language. The Code mode editor allows you to create queries just as you would in Prometheus. For more information about PromQL see &lt;a href=&#34;http://prometheus.io/docs/querying/basics/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Querying Prometheus&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/prometheus/code-mode.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/prometheus/code-mode.png&#34;data-srcset=&#34;/static/img/docs/prometheus/code-mode.png?w=320 320w, /static/img/docs/prometheus/code-mode.png?w=550 550w, /static/img/docs/prometheus/code-mode.png?w=750 750w, /static/img/docs/prometheus/code-mode.png?w=900 900w, /static/img/docs/prometheus/code-mode.png?w=1040 1040w, /static/img/docs/prometheus/code-mode.png?w=1240 1240w, /static/img/docs/prometheus/code-mode.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Code mode&#34;width=&#34;1688&#34;height=&#34;171&#34;title=&#34;Code mode&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/prometheus/code-mode.png&#34;
            alt=&#34;Code mode&#34;width=&#34;1688&#34;height=&#34;171&#34;title=&#34;Code mode&#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;Code mode&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;The user interface (UI) also lets you select metrics, labels, filters, and operations.&lt;/p&gt;
&lt;p&gt;You can write complex queries using the text editor with autocompletion features and syntax highlighting. Code mode&amp;rsquo;s autocomplete feature works automatically while typing. The query editor can autocomplete static functions, aggregations, keywords, and also dynamic items like metrics and labels. The autocompletion drop-down includes documentation for the suggested items where available.&lt;/p&gt;
&lt;p&gt;It also contains a &lt;a href=&#34;#metrics-browser-in-code-mode&#34;&gt;Metrics browser&lt;/a&gt; to further help you write queries. To open the Metrics browser, click the arrow next to &lt;strong&gt;Metrics browser&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&#34;metrics-browser-in-code-mode&#34;&gt;Metrics browser in Code mode&lt;/h3&gt;
&lt;p&gt;The Metrics browser locates metrics and selects relevant labels to help you build basic queries.
When you click &lt;strong&gt;Metrics browser&lt;/strong&gt; in &lt;code&gt;Code&lt;/code&gt; mode, it displays all available metrics and labels.
If supported by your Prometheus instance, each metric also displays its &lt;code&gt;HELP&lt;/code&gt; and &lt;code&gt;TYPE&lt;/code&gt; as a tooltip.&lt;/p&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p &#34;
    style=&#34;max-width: 1335px;&#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/prometheus/Metrics-browser-V10-prom-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;/media/docs/prometheus/Metrics-browser-V10-prom-query-editor.png&#34;data-srcset=&#34;/media/docs/prometheus/Metrics-browser-V10-prom-query-editor.png?w=320 320w, /media/docs/prometheus/Metrics-browser-V10-prom-query-editor.png?w=550 550w, /media/docs/prometheus/Metrics-browser-V10-prom-query-editor.png?w=750 750w, /media/docs/prometheus/Metrics-browser-V10-prom-query-editor.png?w=900 900w, /media/docs/prometheus/Metrics-browser-V10-prom-query-editor.png?w=1040 1040w, /media/docs/prometheus/Metrics-browser-V10-prom-query-editor.png?w=1240 1240w, /media/docs/prometheus/Metrics-browser-V10-prom-query-editor.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Prometheus query editor metrics browser&#34;width=&#34;1335&#34;height=&#34;675&#34;title=&#34;Metrics browser&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/media/docs/prometheus/Metrics-browser-V10-prom-query-editor.png&#34;
            alt=&#34;Prometheus query editor metrics browser&#34;width=&#34;1335&#34;height=&#34;675&#34;title=&#34;Metrics browser&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Metrics browser&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;When you select a metric under &lt;strong&gt;Step 1&lt;/strong&gt;, the browser narrows down the available labels to show only the ones applicable to the metric.
You can then select one or more labels shown in &lt;strong&gt;Step 2&lt;/strong&gt;.
Select one or more values in &lt;strong&gt;Step 3&lt;/strong&gt; for each label to tighten your query scope.
In &lt;strong&gt;Step 4&lt;/strong&gt;, you can select &lt;strong&gt;Use query&lt;/strong&gt; to run the query, &lt;strong&gt;Use as rate query&lt;/strong&gt; to add the rate operation to your query (&lt;code&gt;$__rate_interval&lt;/code&gt;), &lt;strong&gt;Validate selector&lt;/strong&gt; to verify the selector is valid and show the number of series found, or &lt;strong&gt;Clear&lt;/strong&gt; to clear your selections and start over.&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;If you don&amp;rsquo;t remember the exact metric name, you can start by selecting a few labels to filter the list. This helps you find relevant label values and narrow down your options.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;All lists in the Metrics browser include a search field to quickly filter metrics or labels by keyword.
In the &lt;strong&gt;Values&lt;/strong&gt; section, there&amp;rsquo;s a single search field that filters across all selected labels, making it easier to find matching values. For example, if you have labels like &lt;code&gt;app&lt;/code&gt;, &lt;code&gt;job&lt;/code&gt;, and &lt;code&gt;job_name&lt;/code&gt;, only one of them might contain the value you&amp;rsquo;re looking for.&lt;/p&gt;
&lt;p&gt;When you are satisfied with your query, click &lt;strong&gt;Run query&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&#34;incremental-dashboard-queries-beta&#34;&gt;Incremental dashboard queries (beta)&lt;/h2&gt;
&lt;p&gt;Starting with Grafana v10, the Prometheus data source supports incremental querying for live dashboards. Instead of re-querying the entire time range on each refresh, Grafana can fetch only new data since the last query.&lt;/p&gt;
&lt;p&gt;You can enable or disable this feature in the data source configuration or provisioning file using the &lt;code&gt;incrementalQuerying&lt;/code&gt; field in &lt;code&gt;jsonData&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You can also control the overlap between consecutive incremental queries using the &lt;code&gt;incrementalQueryOverlapWindow&lt;/code&gt; field in &lt;code&gt;jsonData&lt;/code&gt;. By default, this is set to &lt;code&gt;10m&lt;/code&gt; (10 minutes). Increasing the &lt;code&gt;incrementalQueryOverlapWindow&lt;/code&gt; value increases the time range covered by each incremental query. This can help in environments where the most recent data may be delayed or incomplete.&lt;/p&gt;
]]></content><description>&lt;h1 id="prometheus-query-editor">Prometheus query editor&lt;/h1>
&lt;p>Grafana provides a query editor for the Prometheus data source to create queries in PromQL. For more information about PromQL, see &lt;a href="http://prometheus.io/docs/querying/basics/" target="_blank" rel="noopener noreferrer">Querying Prometheus&lt;/a>. The Prometheus query editor is located on the
&lt;a href="/docs/grafana/v12.4/explore/">Explore page&lt;/a>. You can also access the PostgreSQL query editor from a dashboard panel. Click the ellipsis in the upper right of the panel and select &lt;strong>Edit&lt;/strong>.&lt;/p></description></item><item><title>Prometheus template variables</title><link>https://grafana.com/docs/grafana/v12.4/datasources/prometheus/template-variables/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/prometheus/template-variables/</guid><content><![CDATA[&lt;h1 id=&#34;prometheus-template-variables&#34;&gt;Prometheus template variables&lt;/h1&gt;
&lt;p&gt;Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables. Grafana refers to such variables as &lt;strong&gt;template&lt;/strong&gt; variables.
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the displayed data.&lt;/p&gt;
&lt;p&gt;For an introduction to templating and template variables, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/variables/&#34;&gt;Templating&lt;/a&gt; and 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/variables/add-template-variables/&#34;&gt;Add and manage variables&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-query-variables&#34;&gt;Use query variables&lt;/h2&gt;
&lt;p&gt;Grafana supports several types of variables, but Query variables are specifically used to query Prometheus. They can return a list of metrics, labels, label values, query results, or series.&lt;/p&gt;
&lt;p&gt;Select a Prometheus data source query type and enter the required inputs:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Query Type&lt;/th&gt;
              &lt;th&gt;Input(* required)&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Used API endpoints&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Label names&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;metric&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns a list of all label names matching the specified &lt;code&gt;metric&lt;/code&gt; regex.&lt;/td&gt;
              &lt;td&gt;/api/v1/labels&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Label values&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;label&lt;/code&gt;*, &lt;code&gt;metric&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns a list of label values for the &lt;code&gt;label&lt;/code&gt; in all metrics or the optional metric.&lt;/td&gt;
              &lt;td&gt;/api/v1/label/&lt;code&gt;label&lt;/code&gt;/values or /api/v1/series&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Metrics&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;metric&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns a list of metrics matching the specified &lt;code&gt;metric&lt;/code&gt; regex.&lt;/td&gt;
              &lt;td&gt;/api/v1/label/__name__/values&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Query result&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;query&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns a list of Prometheus query result for the &lt;code&gt;query&lt;/code&gt;.&lt;/td&gt;
              &lt;td&gt;/api/v1/query&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Series query&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;metric&lt;/code&gt;, &lt;code&gt;label&lt;/code&gt; or both&lt;/td&gt;
              &lt;td&gt;Returns a list of time series associated with the entered data.&lt;/td&gt;
              &lt;td&gt;/api/v1/series&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;Classic query&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;classic query string&lt;/td&gt;
              &lt;td&gt;Deprecated, classic version of variable query editor. Enter a string with the query type using a syntax like the following: &lt;code&gt;label_values(&amp;lt;metric&amp;gt;, &amp;lt;label&amp;gt;)&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;all&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;p&gt;For details on &lt;code&gt;metric names&lt;/code&gt;, &lt;code&gt;label names&lt;/code&gt;, and &lt;code&gt;label values&lt;/code&gt;, refer to the &lt;a href=&#34;http://prometheus.io/docs/concepts/data_model/#metric-names-and-labels&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;query-options&#34;&gt;Query options&lt;/h3&gt;
&lt;p&gt;With the query variable type, you can set the following query 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;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;strong&gt;Data source&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Select your data source from the drop-down list.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Select query type&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Options are &lt;code&gt;default&lt;/code&gt;, &lt;code&gt;value&lt;/code&gt; and &lt;code&gt;metric name&lt;/code&gt;. Each query type hits a different Prometheus endpoint.&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;Optional, if you want to extract part of a series name or metric node segment.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Sort&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Default is &lt;code&gt;disabled&lt;/code&gt;. Options include &lt;code&gt;alphabetical&lt;/code&gt;, &lt;code&gt;numerical&lt;/code&gt;, and &lt;code&gt;alphabetical case-sensitive&lt;/code&gt;.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Refresh&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;When to update the values for the variable. Options are &lt;code&gt;On dashboard load&lt;/code&gt; and &lt;code&gt;On time range change&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;selection-options&#34;&gt;Selection options&lt;/h3&gt;
&lt;p&gt;The following selection options are available:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Multi-value&lt;/strong&gt; - Check this option to enable multiple values to be selected at the same time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Include All option&lt;/strong&gt; - Check this option to include all variables.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;use-interval-and-range-variables&#34;&gt;Use interval and range variables&lt;/h3&gt;
&lt;p&gt;You can use global built-in variables in query variables, including the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$__interval&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$__interval_ms&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$__range&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$__range_s&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$__range_ms&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For details, refer to 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/variables/add-template-variables/#global-variables&#34;&gt;Global built-in variables&lt;/a&gt;.
The &lt;code&gt;label_values&lt;/code&gt; function doesn&amp;rsquo;t support queries, so you can use these variables in conjunction with the &lt;code&gt;query_result&lt;/code&gt; function to filter variable queries.&lt;/p&gt;
&lt;p&gt;Configure the variable’s &lt;code&gt;refresh&lt;/code&gt; setting to &lt;code&gt;On Time Range Change&lt;/code&gt; to ensure it dynamically queries and displays the correct instances when the dashboard time range is modified.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Populate a variable with the top 5 busiest request instances ranked by average QPS over the dashboard&amp;rsquo;s selected time range:&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;query_result(topk(5, sum(rate(http_requests_total[$__range])) by (instance)))
Regex: /&amp;#34;([^&amp;#34;]&amp;#43;)&amp;#34;/&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Populate a variable with the instances having a certain state over the time range shown in the dashboard, using &lt;code&gt;$__range_s&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;query_result(max_over_time(&amp;lt;metric&amp;gt;[${__range_s}s]) != &amp;lt;state&amp;gt;)
Regex:&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;use-__rate_interval&#34;&gt;Use &lt;code&gt;$__rate_interval&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Grafana recommends using &lt;code&gt;$__rate_interval&lt;/code&gt; with the &lt;code&gt;rate&lt;/code&gt; and &lt;code&gt;increase&lt;/code&gt; functions instead of &lt;code&gt;$__interval&lt;/code&gt; or a fixed interval value.
Since &lt;code&gt;$__rate_interval&lt;/code&gt; is always at least four times the scrape interval, it helps avoid issues specific to Prometheus, such as gaps or inaccuracies in query results.&lt;/p&gt;
&lt;p&gt;For example, instead of using the following:&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;rate(http_requests_total[5m])&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;or:&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;rate(http_requests_total[$__interval])&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Use the following:&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;rate(http_requests_total[$__rate_interval])&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;!-- The value of `$__rate_interval` is defined as
*max(`$__interval` &#43; *Scrape interval*, 4 \* *Scrape interval*)*,
where _Scrape interval_ is the &#34;Min step&#34; setting (also known as `query*interval`, a setting per PromQL query) if any is set.
Otherwise, Grafana uses the Prometheus data source&#39;s `scrape interval` setting. --&gt;
&lt;p&gt;The value of &lt;code&gt;$__rate_interval&lt;/code&gt; is calculated as:&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;max($__interval &amp;#43; scrape_interval, 4 * scrape_interval)&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here, &lt;code&gt;scrape_interval&lt;/code&gt; refers to the &lt;code&gt;min step&lt;/code&gt; setting (also known as &lt;code&gt;query_interval&lt;/code&gt;) specified per PromQL query, if set. If not, Grafana falls back to the Prometheus data source’s scrape interval setting.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;min interval&lt;/code&gt; setting in the panel is modified by the resolution setting, and therefore doesn&amp;rsquo;t have any effect on &lt;code&gt;scrape interval&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For details, refer to the Grafana blog &lt;a href=&#34;/blog/2020/09/28/new-in-grafana-7.2-__rate_interval-for-prometheus-rate-queries-that-just-work/&#34;&gt;$__rate_interval for Prometheus rate queries that just work&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;choose-a-variable-syntax&#34;&gt;Choose a variable syntax&lt;/h2&gt;
&lt;p&gt;The Prometheus data source supports two variable syntaxes for use in the &lt;strong&gt;Query&lt;/strong&gt; field:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$&amp;lt;varname&amp;gt;&lt;/code&gt;, for example &lt;code&gt;rate(http_requests_total{job=~&amp;quot;$job&amp;quot;}[$_rate_interval])&lt;/code&gt;, which is easier to read and write but does not allow you to use a variable in the middle of a word.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;[[varname]]&lt;/code&gt;, for example &lt;code&gt;rate(http_requests_total{job=~&amp;quot;[[job]]&amp;quot;}[$_rate_interval])&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you&amp;rsquo;ve enabled the &lt;code&gt;Multi-value&lt;/code&gt; or &lt;code&gt;Include all value&lt;/code&gt; options, Grafana converts the labels from plain text to a regex-compatible string, which requires you to use &lt;code&gt;=~&lt;/code&gt; instead of &lt;code&gt;=&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&#34;use-the-ad-hoc-filters-variable-type&#34;&gt;Use the ad hoc filters variable type&lt;/h2&gt;
&lt;p&gt;Prometheus supports the special 
    &lt;a href=&#34;/docs/grafana/v12.4/dashboards/variables/add-template-variables/#add-ad-hoc-filters&#34;&gt;ad hoc filters&lt;/a&gt; variable type, which allows you to dynamically apply label/value filters across your dashboards. These filters are automatically added to all Prometheus queries, allowing dynamic filtering without modifying individual queries.&lt;/p&gt;
]]></content><description>&lt;h1 id="prometheus-template-variables">Prometheus template variables&lt;/h1>
&lt;p>Instead of hard-coding details such as server, application, and sensor names in metric queries, you can use variables. Grafana refers to such variables as &lt;strong>template&lt;/strong> variables.
Grafana lists these variables in dropdown select boxes at the top of the dashboard to help you change the displayed data.&lt;/p></description></item><item><title>Troubleshoot Prometheus data source issues</title><link>https://grafana.com/docs/grafana/v12.4/datasources/prometheus/troubleshooting/</link><pubDate>Fri, 03 Apr 2026 19:43:06 +0000</pubDate><guid>https://grafana.com/docs/grafana/v12.4/datasources/prometheus/troubleshooting/</guid><content><![CDATA[&lt;h1 id=&#34;troubleshoot-prometheus-data-source-issues&#34;&gt;Troubleshoot Prometheus data source issues&lt;/h1&gt;
&lt;p&gt;This document provides troubleshooting information for common errors you may encounter when using the Prometheus data source in Grafana.&lt;/p&gt;
&lt;h2 id=&#34;connection-errors&#34;&gt;Connection errors&lt;/h2&gt;
&lt;p&gt;The following errors occur when Grafana cannot establish or maintain a connection to Prometheus.&lt;/p&gt;
&lt;h3 id=&#34;failed-to-connect-to-prometheus&#34;&gt;Failed to connect to Prometheus&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; &amp;ldquo;There was an error returned querying the Prometheus API&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; Grafana cannot establish a network connection to the Prometheus server.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify that the Prometheus server URL is correct in the data source configuration.&lt;/li&gt;
&lt;li&gt;Check that Prometheus is running and accessible from the Grafana server.&lt;/li&gt;
&lt;li&gt;Ensure the URL includes the protocol (&lt;code&gt;http://&lt;/code&gt; or &lt;code&gt;https://&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Verify the port is correct (the Prometheus default port is &lt;code&gt;9090&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Ensure there are no firewall rules blocking the connection.&lt;/li&gt;
&lt;li&gt;If Grafana and Prometheus are running in separate containers, use the container IP address or hostname instead of &lt;code&gt;localhost&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;For Grafana Cloud, ensure you have configured &lt;a href=&#34;/docs/grafana-cloud/connect-externally-hosted/private-data-source-connect/&#34;&gt;Private data source connect&lt;/a&gt; if your Prometheus instance is not publicly accessible.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;request-timed-out&#34;&gt;Request timed out&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; &amp;ldquo;context deadline exceeded&amp;rdquo; or &amp;ldquo;request timeout&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The connection to Prometheus timed out before receiving a response.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check the network latency between Grafana and Prometheus.&lt;/li&gt;
&lt;li&gt;Verify that Prometheus is not overloaded or experiencing performance issues.&lt;/li&gt;
&lt;li&gt;Increase the &lt;strong&gt;Query timeout&lt;/strong&gt; setting in the data source configuration under &lt;strong&gt;Interval behavior&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Check the &lt;a href=&#34;/docs/grafana/latest/setup-grafana/configure-grafana/#timeout&#34;&gt;Grafana server timeout configuration&lt;/a&gt; for server-level timeout settings.&lt;/li&gt;
&lt;li&gt;Reduce the time range or complexity of your query.&lt;/li&gt;
&lt;li&gt;Check if any network devices (load balancers, proxies) are timing out the connection.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;failed-to-parse-data-source-url&#34;&gt;Failed to parse data source URL&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; &amp;ldquo;Failed to parse data source URL&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The URL entered in the data source configuration is not valid.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify the URL format is correct (for example, &lt;code&gt;http://localhost:9090&lt;/code&gt; or &lt;code&gt;https://prometheus.example.com:9090&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Ensure the URL includes the protocol (&lt;code&gt;http://&lt;/code&gt; or &lt;code&gt;https://&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Remove any trailing slashes or invalid characters from the URL.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;authentication-errors&#34;&gt;Authentication errors&lt;/h2&gt;
&lt;p&gt;The following errors occur when there are issues with authentication credentials or permissions.&lt;/p&gt;
&lt;h3 id=&#34;unauthorized-401&#34;&gt;Unauthorized (401)&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; &amp;ldquo;401 Unauthorized&amp;rdquo; or &amp;ldquo;Authorization failed&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The authentication credentials are invalid or missing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify that the username and password are correct if using basic authentication.&lt;/li&gt;
&lt;li&gt;Check that the authentication method selected matches your Prometheus configuration.&lt;/li&gt;
&lt;li&gt;If using a reverse proxy with authentication, verify the credentials are correct.&lt;/li&gt;
&lt;li&gt;For AWS SigV4 authentication, verify the IAM credentials and permissions. Alternatively, consider using the &lt;a href=&#34;/grafana/plugins/grafana-amazonprometheus-datasource/&#34;&gt;Amazon Managed Service for Prometheus data source&lt;/a&gt; for simplified AWS authentication.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;forbidden-403&#34;&gt;Forbidden (403)&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; &amp;ldquo;403 Forbidden&amp;rdquo; or &amp;ldquo;Access denied&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The authenticated user does not have permission to access the requested resource.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify the user has read access to the Prometheus API.&lt;/li&gt;
&lt;li&gt;Check Prometheus security settings and access control configuration.&lt;/li&gt;
&lt;li&gt;If using a reverse proxy, verify the proxy is not blocking the request.&lt;/li&gt;
&lt;li&gt;For AWS Managed Prometheus, verify the IAM policy grants the required permissions. Alternatively, consider using the &lt;a href=&#34;/grafana/plugins/grafana-amazonprometheus-datasource/&#34;&gt;Amazon Managed Service for Prometheus data source&lt;/a&gt; for simplified AWS authentication.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;query-errors&#34;&gt;Query errors&lt;/h2&gt;
&lt;p&gt;The following errors occur when there are issues with PromQL syntax or query execution.&lt;/p&gt;
&lt;h3 id=&#34;query-syntax-error&#34;&gt;Query syntax error&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; &amp;ldquo;parse error: unexpected character&amp;rdquo; or &amp;ldquo;bad_data: 1:X: parse error&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The PromQL query contains invalid syntax.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Alternative cause:&lt;/strong&gt; A proxy between Grafana and Prometheus requires authentication. When proxy authentication fails, the proxy redirects the request to an HTML authentication page. Grafana cannot parse the HTML response, which results in a parse error. This appears to be a query issue but is actually a proxy authentication issue.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check your query syntax for typos or invalid characters.&lt;/li&gt;
&lt;li&gt;Verify that metric names and label names are valid identifiers.&lt;/li&gt;
&lt;li&gt;Ensure string values in label matchers are enclosed in quotes.&lt;/li&gt;
&lt;li&gt;Use the Prometheus expression browser to test your query directly.&lt;/li&gt;
&lt;li&gt;Refer to the &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/basics/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus querying documentation&lt;/a&gt; for syntax guidance.&lt;/li&gt;
&lt;li&gt;If you have a proxy between Grafana and Prometheus, verify that proxy authentication is correctly configured. Check your proxy logs for authentication failures or redirects.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;query-returns-no-data-for-a-metric&#34;&gt;Query returns no data for a metric&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; The query returns no data and the visualization is empty.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The specified metric does not exist in Prometheus, or there is no data for the selected time range.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify the metric name is spelled correctly.&lt;/li&gt;
&lt;li&gt;Check that the metric is being scraped by Prometheus.&lt;/li&gt;
&lt;li&gt;Use the Prometheus API to browse available metrics at &lt;code&gt;/api/v1/label/__name__/values&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use the &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/api#querying-target-metadata&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;target metadata API&lt;/a&gt; to verify which metrics a target exposes.&lt;/li&gt;
&lt;li&gt;Verify the time range includes data for the metric.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;query-timeout-limit-exceeded&#34;&gt;Query timeout limit exceeded&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; &amp;ldquo;query timed out in expression evaluation&amp;rdquo; or &amp;ldquo;query processing would load too many samples&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The query took longer than the configured timeout limit or would return too many samples.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reduce the time range of your query.&lt;/li&gt;
&lt;li&gt;Add more specific label filters to limit the data scanned.&lt;/li&gt;
&lt;li&gt;Increase the &lt;strong&gt;Query timeout&lt;/strong&gt; setting in the data source configuration.&lt;/li&gt;
&lt;li&gt;Use aggregation functions like &lt;code&gt;sum()&lt;/code&gt;, &lt;code&gt;avg()&lt;/code&gt;, or &lt;code&gt;rate()&lt;/code&gt; to reduce the number of time series.&lt;/li&gt;
&lt;li&gt;Increase the &lt;code&gt;query.timeout&lt;/code&gt; or &lt;code&gt;query.max-samples&lt;/code&gt; settings in Prometheus if you have admin access.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;too-many-time-series&#34;&gt;Too many time series&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; &amp;ldquo;exceeded maximum resolution of 11,000 points per timeseries&amp;rdquo; or &amp;ldquo;maximum number of series limit exceeded&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The query is returning more time series or data points than the configured limits allow.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reduce the time range of your query.&lt;/li&gt;
&lt;li&gt;Add label filters to limit the number of time series returned.&lt;/li&gt;
&lt;li&gt;Increase the &lt;strong&gt;Min interval&lt;/strong&gt; or &lt;strong&gt;Resolution&lt;/strong&gt; in the query options to reduce the number of data points.&lt;/li&gt;
&lt;li&gt;Use aggregation functions to combine time series.&lt;/li&gt;
&lt;li&gt;Adjust the &lt;strong&gt;Series limit&lt;/strong&gt; setting in the data source configuration under &lt;strong&gt;Other settings&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;invalid-function-or-aggregation&#34;&gt;Invalid function or aggregation&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; &amp;ldquo;unknown function&amp;rdquo; or &amp;ldquo;parse error: unexpected aggregation&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The query uses an invalid or unsupported PromQL function.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify the function name is spelled correctly and is a valid PromQL function.&lt;/li&gt;
&lt;li&gt;Check that you are using the correct syntax for the function.&lt;/li&gt;
&lt;li&gt;Ensure your Prometheus version supports the function you are using.&lt;/li&gt;
&lt;li&gt;Refer to the &lt;a href=&#34;https://prometheus.io/docs/prometheus/latest/querying/functions/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;PromQL functions documentation&lt;/a&gt; for available functions.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configuration-errors&#34;&gt;Configuration errors&lt;/h2&gt;
&lt;p&gt;The following errors occur when the data source is not configured correctly.&lt;/p&gt;
&lt;h3 id=&#34;invalid-prometheus-type&#34;&gt;Invalid Prometheus type&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; Unexpected behavior when querying metrics or labels&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The &lt;strong&gt;Prometheus type&lt;/strong&gt; setting does not match your actual Prometheus-compatible database.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the data source configuration in Grafana.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Performance&lt;/strong&gt;, select the correct &lt;strong&gt;Prometheus type&lt;/strong&gt; (Prometheus, Cortex, Mimir, or Thanos).&lt;/li&gt;
&lt;li&gt;Different database types support different APIs, so setting this incorrectly may cause unexpected behavior.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;scrape-interval-mismatch&#34;&gt;Scrape interval mismatch&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; Data appears sparse, or &lt;code&gt;rate()&lt;/code&gt; queries return no data or incomplete results.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The &lt;strong&gt;Scrape interval&lt;/strong&gt; setting in Grafana does not match the actual scrape interval in Prometheus. This especially affects &lt;code&gt;rate()&lt;/code&gt; queries, which require at least two data points within the specified time window. For example, if your actual scrape interval is 5 minutes but Grafana uses the default (15 seconds for OSS, 1 minute for Grafana Cloud), a query like &lt;code&gt;rate(http_requests_total[1m])&lt;/code&gt; returns no data because there are no data points within that 1-minute window.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check your Prometheus configuration file for the &lt;code&gt;scrape_interval&lt;/code&gt; setting.&lt;/li&gt;
&lt;li&gt;Update the &lt;strong&gt;Scrape interval&lt;/strong&gt; in the Grafana data source configuration under &lt;strong&gt;Interval behavior&lt;/strong&gt; to match.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;$__rate_interval&lt;/code&gt; instead of hardcoded time windows in &lt;code&gt;rate()&lt;/code&gt; queries. This variable automatically adjusts based on your scrape interval.&lt;/li&gt;
&lt;li&gt;For more information, refer to &lt;a href=&#34;/blog/2020/09/28/new-in-grafana-7.2-__rate_interval-for-prometheus-rate-queries-that-just-work/&#34;&gt;$__rate_interval for Prometheus rate queries that just work&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;tls-and-certificate-errors&#34;&gt;TLS and certificate errors&lt;/h2&gt;
&lt;p&gt;The following errors occur when there are issues with TLS configuration.&lt;/p&gt;
&lt;h3 id=&#34;certificate-verification-failed&#34;&gt;Certificate verification failed&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; &amp;ldquo;x509: certificate signed by unknown authority&amp;rdquo; or &amp;ldquo;certificate verify failed&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; Grafana cannot verify the TLS certificate presented by Prometheus.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If using a self-signed certificate, enable &lt;strong&gt;Add self-signed certificate&lt;/strong&gt; in the TLS settings and add your CA certificate.&lt;/li&gt;
&lt;li&gt;Verify the certificate chain is complete and valid.&lt;/li&gt;
&lt;li&gt;Ensure the certificate has not expired.&lt;/li&gt;
&lt;li&gt;As a temporary workaround for testing, enable &lt;strong&gt;Skip TLS verify&lt;/strong&gt; (not recommended for production).&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;tls-handshake-error&#34;&gt;TLS handshake error&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Error message:&lt;/strong&gt; &amp;ldquo;TLS: handshake failure&amp;rdquo; or &amp;ldquo;connection reset&amp;rdquo;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The TLS handshake between Grafana and Prometheus failed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify that Prometheus is configured to use TLS.&lt;/li&gt;
&lt;li&gt;Check that the TLS version and cipher suites are compatible.&lt;/li&gt;
&lt;li&gt;If using client certificates, ensure they are correctly configured in the &lt;strong&gt;TLS client authentication&lt;/strong&gt; section.&lt;/li&gt;
&lt;li&gt;Verify the server name matches the certificate&amp;rsquo;s Common Name or Subject Alternative Name.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;other-common-issues&#34;&gt;Other common issues&lt;/h2&gt;
&lt;p&gt;The following issues don&amp;rsquo;t produce specific error messages but are commonly encountered.&lt;/p&gt;
&lt;h3 id=&#34;empty-query-results&#34;&gt;Empty query results&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The query returns no data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify the time range includes data in Prometheus.&lt;/li&gt;
&lt;li&gt;Check that the metric and label names are correct.&lt;/li&gt;
&lt;li&gt;Test the query directly in the Prometheus expression browser.&lt;/li&gt;
&lt;li&gt;Ensure label filters are not excluding all data.&lt;/li&gt;
&lt;li&gt;For rate or increase functions, ensure the time range is at least twice the scrape interval.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;slow-query-performance&#34;&gt;Slow query performance&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; Queries take a long time to execute.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Reduce the time range of your query.&lt;/li&gt;
&lt;li&gt;Add more specific label filters to limit the data scanned.&lt;/li&gt;
&lt;li&gt;Increase the &lt;strong&gt;Min interval&lt;/strong&gt; in the query options.&lt;/li&gt;
&lt;li&gt;Check Prometheus server performance and resource utilization.&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;Disable metrics lookup&lt;/strong&gt; in the data source configuration for large Prometheus instances.&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;Incremental querying (beta)&lt;/strong&gt; to cache query results.&lt;/li&gt;
&lt;li&gt;Consider using recording rules to pre-aggregate frequently queried data.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;data-appears-delayed-or-missing-recent-points&#34;&gt;Data appears delayed or missing recent points&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; The visualization doesn&amp;rsquo;t show the most recent data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check the dashboard time range and refresh settings.&lt;/li&gt;
&lt;li&gt;Verify the &lt;strong&gt;Scrape interval&lt;/strong&gt; is configured correctly.&lt;/li&gt;
&lt;li&gt;Ensure Prometheus has finished scraping the target.&lt;/li&gt;
&lt;li&gt;Check for clock synchronization issues between Grafana and Prometheus.&lt;/li&gt;
&lt;li&gt;For &lt;code&gt;rate()&lt;/code&gt; and similar functions, remember that they need at least two data points to calculate.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;exemplars-not-showing&#34;&gt;Exemplars not showing&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; Exemplar data is not appearing in visualizations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify that exemplars are enabled in the data source configuration under &lt;strong&gt;Exemplars&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Check that your Prometheus version supports exemplars (2.26&#43;).&lt;/li&gt;
&lt;li&gt;Ensure your instrumented application is sending exemplar data.&lt;/li&gt;
&lt;li&gt;Verify the tracing data source is correctly configured for the exemplar link.&lt;/li&gt;
&lt;li&gt;Enable the &lt;strong&gt;Exemplars&lt;/strong&gt; toggle in the query editor.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;alerting-rules-not-visible&#34;&gt;Alerting rules not visible&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Cause:&lt;/strong&gt; Prometheus alerting rules are not appearing in the Grafana Alerting UI.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Verify that &lt;strong&gt;Manage alerts via Alerting UI&lt;/strong&gt; is enabled in the data source configuration.&lt;/li&gt;
&lt;li&gt;Check that Prometheus has alerting rules configured.&lt;/li&gt;
&lt;li&gt;Ensure Grafana can access the Prometheus rules API endpoint.&lt;/li&gt;
&lt;li&gt;Note that for Prometheus (unlike Mimir), the Alerting UI only supports viewing existing rules, not creating new ones.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;get-additional-help&#34;&gt;Get additional help&lt;/h2&gt;
&lt;p&gt;If you continue to experience issues after following this troubleshooting guide:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Check the &lt;a href=&#34;https://prometheus.io/docs/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Prometheus documentation&lt;/a&gt; for API and PromQL guidance.&lt;/li&gt;
&lt;li&gt;Review the &lt;a href=&#34;https://community.grafana.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana community forums&lt;/a&gt; for similar issues.&lt;/li&gt;
&lt;li&gt;Contact Grafana Support if you are a Cloud Pro, Cloud Contracted, or Enterprise user.&lt;/li&gt;
&lt;li&gt;When reporting issues, include:
&lt;ul&gt;
&lt;li&gt;Grafana version&lt;/li&gt;
&lt;li&gt;Prometheus version and type (Prometheus, Mimir, Cortex, Thanos)&lt;/li&gt;
&lt;li&gt;Error messages (redact sensitive information)&lt;/li&gt;
&lt;li&gt;Steps to reproduce&lt;/li&gt;
&lt;li&gt;Relevant configuration such as data source settings, query timeout, and TLS settings (redact tokens, passwords, and other credentials)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="troubleshoot-prometheus-data-source-issues">Troubleshoot Prometheus data source issues&lt;/h1>
&lt;p>This document provides troubleshooting information for common errors you may encounter when using the Prometheus data source in Grafana.&lt;/p>
&lt;h2 id="connection-errors">Connection errors&lt;/h2>
&lt;p>The following errors occur when Grafana cannot establish or maintain a connection to Prometheus.&lt;/p></description></item></channel></rss>