<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Google Cloud Monitoring data source on Grafana Labs</title><link>https://grafana.com/docs/grafana/v10.1/datasources/google-cloud-monitoring/</link><description>Recent content in Google Cloud Monitoring data source on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/grafana/v10.1/datasources/google-cloud-monitoring/index.xml" rel="self" type="application/rss+xml"/><item><title>Authentication</title><link>https://grafana.com/docs/grafana/v10.1/datasources/google-cloud-monitoring/google-authentication/</link><pubDate>Fri, 06 Mar 2026 08:18:51 +0000</pubDate><guid>https://grafana.com/docs/grafana/v10.1/datasources/google-cloud-monitoring/google-authentication/</guid><content><![CDATA[&lt;h1 id=&#34;configure-google-authentication&#34;&gt;Configure Google authentication&lt;/h1&gt;
&lt;p&gt;Requests from a Grafana plugin to Google are made on behalf of an Identity and Access Management (IAM) role or IAM user.
The IAM user or IAM role must have the associated policies to perform certain API actions.
Since these policies are specific to each data source, refer to the data source documentation for details.&lt;/p&gt;
&lt;p&gt;All requests to Google APIs are performed on the server-side by the Grafana backend.
You can authenticate a Grafana plugin to Google by uploading a Google JSON Web Token (JWT) file, or by automatically retrieving credentials from the Google metadata server.
The latter option is available only when running Grafana on a GCE virtual machine.&lt;/p&gt;
&lt;h2 id=&#34;use-a-google-service-account-key-file&#34;&gt;Use a Google Service Account key file&lt;/h2&gt;
&lt;p&gt;To authenticate the Grafana plugin with the Google API, create a Google Cloud Platform (GCP) Service Account for the Project you want to show data.&lt;/p&gt;
&lt;p&gt;Each Grafana data source integrates with one GCP Project.
To visualize data from multiple GCP Projects, create one data source per GCP Project.&lt;/p&gt;
&lt;h3 id=&#34;create-a-gcp-service-account-and-key-file&#34;&gt;Create a GCP Service Account and key file&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Navigate to the &lt;a href=&#34;https://console.cloud.google.com/apis/credentials&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;APIs and Services Credentials page&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Click on the &lt;strong&gt;Create credentials&lt;/strong&gt; dropdown and select the &lt;strong&gt;Service account&lt;/strong&gt; option.&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Service account name&lt;/strong&gt;, enter a name for the account.&lt;/li&gt;
&lt;li&gt;From the &lt;strong&gt;Role&lt;/strong&gt; dropdown, choose the roles required by the specific plugin.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Done&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Use the newly created account to &lt;a href=&#34;https://cloud.google.com/iam/docs/creating-managing-service-account-keys#iam-service-account-keys-create-console&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;create a service account key&lt;/a&gt;.
A JSON key file is created and downloaded to your computer.&lt;/li&gt;
&lt;li&gt;Store the key file in a secure place, because it grants access to your Google data.&lt;/li&gt;
&lt;li&gt;In the Grafana data source configuration page, upload the key file.
The file&amp;rsquo;s contents are encrypted and saved in the Grafana database.
Remember to save the file after uploading.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;configure-a-gce-default-service-account&#34;&gt;Configure a GCE Default Service Account&lt;/h2&gt;
&lt;p&gt;When Grafana is running on a Google Compute Engine (GCE) virtual machine, Grafana can automatically retrieve default credentials from the metadata server. As a result, there is no need to generate a private key file for the service account. You also do not need to upload the file to Grafana. The following preconditions must be met before Grafana can retrieve default credentials.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You must create a Service Account for use by the GCE virtual machine. For more information, refer to &lt;a href=&#34;https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances#createanewserviceaccount&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Create new service account&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Verify that the GCE virtual machine instance is running as the service account that you created. For more information, refer to &lt;a href=&#34;https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances#using&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;setting up an instance to run as a service account&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Allow access to the specified API scope.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information about creating and enabling service accounts for GCE instances, refer to &lt;a href=&#34;https://cloud.google.com/compute/docs/access/create-enable-service-accounts-for-instances&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;enabling service accounts for instances in Google documentation&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="configure-google-authentication">Configure Google authentication&lt;/h1>
&lt;p>Requests from a Grafana plugin to Google are made on behalf of an Identity and Access Management (IAM) role or IAM user.
The IAM user or IAM role must have the associated policies to perform certain API actions.
Since these policies are specific to each data source, refer to the data source documentation for details.&lt;/p></description></item><item><title>Google Cloud Monitoring query editor</title><link>https://grafana.com/docs/grafana/v10.1/datasources/google-cloud-monitoring/query-editor/</link><pubDate>Fri, 06 Mar 2026 08:18:51 +0000</pubDate><guid>https://grafana.com/docs/grafana/v10.1/datasources/google-cloud-monitoring/query-editor/</guid><content><![CDATA[&lt;h1 id=&#34;google-cloud-monitoring-query-editor&#34;&gt;Google Cloud Monitoring query editor&lt;/h1&gt;
&lt;p&gt;This topic explains querying specific to the Google Cloud Monitoring data source.
For general documentation on querying data sources in Grafana, see &lt;a href=&#34;/docs/grafana/v10.1/panels-visualizations/query-transform-data/&#34;&gt;Query and transform data&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;choose-a-query-editing-mode&#34;&gt;Choose a query editing mode&lt;/h2&gt;
&lt;p&gt;The Google Cloud Monitoring query editor helps you build queries for two types of data, which both return time series data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#query-metrics&#34;&gt;Metrics&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can also create &lt;a href=&#34;#use-the-monitoring-query-language&#34;&gt;Monitoring Query Language (MQL)&lt;/a&gt; queries.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href=&#34;#query-service-level-objectives&#34;&gt;Service Level Objectives (SLO)&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You also use the query editor when you &lt;a href=&#34;#apply-annotations&#34;&gt;annotate&lt;/a&gt; visualizations.&lt;/p&gt;
&lt;h2 id=&#34;query-metrics&#34;&gt;Query metrics&lt;/h2&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 400px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/google-cloud-monitoring/metric-query-builder-8-0.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/google-cloud-monitoring/metric-query-builder-8-0.png&#34;data-srcset=&#34;/static/img/docs/google-cloud-monitoring/metric-query-builder-8-0.png?w=320 320w, /static/img/docs/google-cloud-monitoring/metric-query-builder-8-0.png?w=550 550w, /static/img/docs/google-cloud-monitoring/metric-query-builder-8-0.png?w=750 750w, /static/img/docs/google-cloud-monitoring/metric-query-builder-8-0.png?w=900 900w, /static/img/docs/google-cloud-monitoring/metric-query-builder-8-0.png?w=1040 1040w, /static/img/docs/google-cloud-monitoring/metric-query-builder-8-0.png?w=1240 1240w, /static/img/docs/google-cloud-monitoring/metric-query-builder-8-0.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Google Cloud Monitoring metrics query builder&#34;width=&#34;1016&#34;height=&#34;291&#34;title=&#34;Google Cloud Monitoring metrics query builder&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/google-cloud-monitoring/metric-query-builder-8-0.png&#34;
            alt=&#34;Google Cloud Monitoring metrics query builder&#34;width=&#34;1016&#34;height=&#34;291&#34;title=&#34;Google Cloud Monitoring metrics query builder&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Google Cloud Monitoring metrics query builder&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;The metrics query editor helps you select metrics, group and aggregate by labels and time, and use filters to specify which time series you want to query.&lt;/p&gt;
&lt;h3 id=&#34;create-a-metrics-query&#34;&gt;Create a metrics query&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Select the &lt;strong&gt;Metrics&lt;/strong&gt; option in the &lt;strong&gt;Query Type&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;li&gt;Select a project from the &lt;strong&gt;Project&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;li&gt;Select a Google Cloud Platform service from the &lt;strong&gt;Service&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;li&gt;Select a metric from the &lt;strong&gt;Metric&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;(Optional)&lt;/em&gt; Use the plus and minus icons in the filter and group-by sections to add and remove filters or group-by clauses.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Google Cloud Monitoring supports several metrics types, such as &lt;code&gt;GAUGE&lt;/code&gt;, &lt;code&gt;DELTA,&lt;/code&gt; and &lt;code&gt;CUMULATIVE&lt;/code&gt;.
Each supports different aggregation options, such as reducers and aligners.
The metrics query editor lists available aggregation methods for a selected metric, and sets a default reducer and aligner when you select a metric.&lt;/p&gt;
&lt;h3 id=&#34;apply-a-filter&#34;&gt;Apply a filter&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;To add and apply a filter:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click the plus icon in the filter section.&lt;/li&gt;
&lt;li&gt;Select a field to filter by.&lt;/li&gt;
&lt;li&gt;Enter a filter value, such as &lt;code&gt;instance_name = grafana-1&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;To remove the filter, click the trash icon.&lt;/p&gt;
&lt;h4 id=&#34;use-simple-wildcards&#34;&gt;Use simple wildcards&lt;/h4&gt;
&lt;p&gt;When you set the operator to &lt;code&gt;=&lt;/code&gt; or &lt;code&gt;!=&lt;/code&gt;, you can add wildcards to the filter value field.&lt;/p&gt;
&lt;p&gt;For example, entering &lt;code&gt;us-*&lt;/code&gt; captures all values that start with &amp;ldquo;us-&amp;rdquo;, and entering &lt;code&gt;*central-a&lt;/code&gt; captures all values that end with &amp;ldquo;central-a&amp;rdquo;.
&lt;code&gt;*-central-*&lt;/code&gt; captures all values with the substring of &amp;ldquo;-central-&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;Simple wildcards perform better than regular expressions.&lt;/p&gt;
&lt;h4 id=&#34;use-regular-expressions&#34;&gt;Use regular expressions&lt;/h4&gt;
&lt;p&gt;When you set the operator to &lt;code&gt;=~&lt;/code&gt; or &lt;code&gt;!=~&lt;/code&gt;, you can add regular expressions to the filter value field.&lt;/p&gt;
&lt;p&gt;For example, entering &lt;code&gt;us-central[1-3]-[af]&lt;/code&gt; matches all values that start with &amp;ldquo;us-central&amp;rdquo;, then are followed by a number in the range of 1 to 3, a dash, and then either an &amp;ldquo;a&amp;rdquo; or an &amp;ldquo;f&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;You don&amp;rsquo;t need leading and trailing slashes when you create these regular expressions.&lt;/p&gt;
&lt;h3 id=&#34;configure-pre-processing-options&#34;&gt;Configure pre-processing options&lt;/h3&gt;
&lt;p&gt;The query editor displays pre-processing options when the selected metric has a metric type of &lt;code&gt;DELTA&lt;/code&gt; or &lt;code&gt;CUMULATIVE&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;Rate&lt;/strong&gt; option aligns and converts data points to a rate per time series.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Delta&lt;/strong&gt; option aligns data points by their delta (difference) per time series.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;group-time-series&#34;&gt;Group time series&lt;/h3&gt;
&lt;p&gt;To combine multiple time series and reduce the amount of data returned for a metric, specify a grouping and a function.&lt;/p&gt;
&lt;h4 id=&#34;group-by&#34;&gt;Group by&lt;/h4&gt;
&lt;p&gt;Use the &lt;strong&gt;Group By&lt;/strong&gt; segment to group resource or metric labels, which reduces the number of time series and aggregates the results by group.&lt;/p&gt;
&lt;p&gt;For example, if you group by &lt;code&gt;instance_name&lt;/code&gt;, Grafana displays an aggregated metric for the specified Compute instance.&lt;/p&gt;
&lt;h5 id=&#34;metadata-labels&#34;&gt;Metadata labels&lt;/h5&gt;
&lt;p&gt;Resource metadata labels contain information that can uniquely identify a resource in Google Cloud.
A time series response returns metadata labels only if they&amp;rsquo;re part of the Group By segment in the time series request.&lt;/p&gt;
&lt;p&gt;There&amp;rsquo;s no API for retrieving metadata labels, so you can&amp;rsquo;t populate the Group By list with the metadata labels that are available for the selected service and metric.
However, the &lt;strong&gt;Group By&lt;/strong&gt; field list comes with a pre-defined set of common system labels.&lt;/p&gt;
&lt;p&gt;You can&amp;rsquo;t pre-define user labels, but you can enter them manually in the &lt;strong&gt;Group By&lt;/strong&gt; field.
If you include a metadata label, user label, or system label in the &lt;strong&gt;Group By&lt;/strong&gt; segment, you can create filters based on it and expand its value on the &lt;strong&gt;Alias&lt;/strong&gt; field.&lt;/p&gt;
&lt;h4 id=&#34;group-by-function&#34;&gt;Group by function&lt;/h4&gt;
&lt;p&gt;To combine the time series in the group into a single time series, select a grouping function.&lt;/p&gt;
&lt;h3 id=&#34;align-data&#34;&gt;Align data&lt;/h3&gt;
&lt;p&gt;You can align all data points received in a fixed length of time by applying an alignment function to combine those data points, and then assigning a timestamp to the result.&lt;/p&gt;
&lt;h4 id=&#34;select-an-alignment-function&#34;&gt;Select an alignment function&lt;/h4&gt;
&lt;p&gt;During alignment, all data points are received in a fixed interval.
Within each interval, as defined by the &lt;a href=&#34;#alignment-period&#34;&gt;alignment period&lt;/a&gt;), and for each time series, the data is aggregated into a single point.
The value of that point is determined by the type of alignment function you use.&lt;/p&gt;
&lt;p&gt;For more information on alignment functions, refer to &lt;a href=&#34;https://cloud.google.com/monitoring/charts/metrics-selector#alignment&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;alignment metric selector&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;define-the-alignment-period&#34;&gt;Define the alignment period&lt;/h4&gt;
&lt;p&gt;You can set the &lt;strong&gt;Alignment Period&lt;/strong&gt; field to group a metric by time if you&amp;rsquo;ve chosen an aggregation.&lt;/p&gt;
&lt;p&gt;The default, called &amp;ldquo;cloud monitoring auto&amp;rdquo;, uses GCP Google Cloud Monitoring&amp;rsquo;s default groupings.
These enable you to compare graphs in Grafana with graphs in the Google Cloud Monitoring UI.&lt;/p&gt;
&lt;p&gt;The default values for &amp;ldquo;cloud monitoring auto&amp;rdquo; are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1m for time ranges &amp;lt; 23 hours&lt;/li&gt;
&lt;li&gt;5m for time ranges &amp;gt;= 23 hours and &amp;lt; 6 days&lt;/li&gt;
&lt;li&gt;1h for time ranges &amp;gt;= 6 days&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The other automatic option is &amp;ldquo;grafana auto&amp;rdquo;, which automatically sets the Group By time depending on the time range chosen and width of the time series panel.&lt;/p&gt;
&lt;p&gt;For more information about &amp;ldquo;grafana auto&amp;rdquo;, refer to &lt;a href=&#34;/docs/grafana/v10.1/dashboards/variables/add-template-variables/#add-an-interval-variable&#34;&gt;Interval variable&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;You can also choose fixed time intervals to group by, like &lt;code&gt;1h&lt;/code&gt; or &lt;code&gt;1d&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;set-alias-patterns&#34;&gt;Set alias patterns&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Alias By&lt;/strong&gt; helps you control the format of legend keys.
By default, Grafana shows the metric name and labels, which can be long and difficult to read.&lt;/p&gt;
&lt;p&gt;You can use patterns in the alias field to customize the legend key&amp;rsquo;s format:&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;Alias pattern&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Alias pattern example&lt;/th&gt;
              &lt;th&gt;Example result&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{metric.label.xxx}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the metric label value.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{metric.label.instance_name}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;grafana-1-prod&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{metric.type}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the full Metric Type.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{metric.type}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;compute.googleapis.com/instance/cpu/utilization&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{metric.name}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the metric name part.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{metric.name}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;instance/cpu/utilization&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{metric.service}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the service part.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{metric.service}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;compute&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{resource.label.xxx}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the resource label value.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{resource.label.zone}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;us-east1-b&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{resource.type}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the name of the monitored resource type.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{resource.type}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;gce_instance&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{metadata.system_labels.xxx}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the metadata system label value.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{metadata.system_labels.name}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;grafana&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{metadata.user_labels.xxx}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the metadata user label value.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{metadata.user_labels.tag}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;production&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h4 id=&#34;alias-pattern-examples&#34;&gt;Alias pattern examples&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Using metric labels:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can select from a list of metric and resource labels for a metric in the Group By dropdown.
You can then include them in the legend key using alias patterns.&lt;/p&gt;
&lt;p&gt;For example, given this value of Alias By: &lt;code&gt;{{metric.type}} - {{metric.label.instance_name}}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;An expected result would look like: &lt;code&gt;compute.googleapis.com/instance/cpu/usage_time - server1-prod&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using the Monitored Resource Type:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can also resolve the name of the Monitored Resource Type with the &lt;code&gt;resource.type&lt;/code&gt; alias.&lt;/p&gt;
&lt;p&gt;For example, given this value of Alias By: &lt;code&gt;{{resource.type}} - {{metric.type}}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;An expected result would look like: &lt;code&gt;gce_instance - compute.googleapis.com/instance/cpu/usage_time&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;deep-link-from-grafana-panels-to-the-google-cloud-console-metrics-explorer&#34;&gt;Deep-link from Grafana panels to the Google Cloud Console Metrics Explorer&lt;/h3&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;Available in Grafana v7.1 and higher.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&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/v71/cloudmonitoring_deep_linking.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/v71/cloudmonitoring_deep_linking.png&#34;data-srcset=&#34;/static/img/docs/v71/cloudmonitoring_deep_linking.png?w=320 320w, /static/img/docs/v71/cloudmonitoring_deep_linking.png?w=550 550w, /static/img/docs/v71/cloudmonitoring_deep_linking.png?w=750 750w, /static/img/docs/v71/cloudmonitoring_deep_linking.png?w=900 900w, /static/img/docs/v71/cloudmonitoring_deep_linking.png?w=1040 1040w, /static/img/docs/v71/cloudmonitoring_deep_linking.png?w=1240 1240w, /static/img/docs/v71/cloudmonitoring_deep_linking.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Google Cloud Monitoring deep linking&#34;width=&#34;450&#34;height=&#34;163&#34;title=&#34;Google Cloud Monitoring deep linking&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/v71/cloudmonitoring_deep_linking.png&#34;
            alt=&#34;Google Cloud Monitoring deep linking&#34;width=&#34;450&#34;height=&#34;163&#34;title=&#34;Google Cloud Monitoring deep linking&#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;Google Cloud Monitoring deep linking&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;You can click on a time series in the panel to access a context menu, which contains a link to &lt;strong&gt;View in Metrics Explorer in Google Cloud Console&lt;/strong&gt;.
The link points to the Google Cloud Console&amp;rsquo;s Metrics Explorer and runs the Grafana panel&amp;rsquo;s query there.&lt;/p&gt;
&lt;p&gt;If you select the link, you first select an account in the Google Account Chooser.
Google then redirects you to the Metrics Explorer.&lt;/p&gt;
&lt;p&gt;The provided link is valid for any account, but displays the query only if your account has access to the query&amp;rsquo;s specified GCP project.&lt;/p&gt;
&lt;h3 id=&#34;understand-automatic-unit-detection&#34;&gt;Understand automatic unit detection&lt;/h3&gt;
&lt;p&gt;Grafana issues one query to the Cloud Monitoring API per query editor row, and each API response includes a unit.
Grafana attempts to convert the returned unit into a unit compatible with its time series panel.&lt;/p&gt;
&lt;p&gt;If successful, Grafana displays the unit on the panel&amp;rsquo;s Y-axis.
If the query editor rows return different units, Grafana uses the unit from the last query editor row in the time series panel.&lt;/p&gt;
&lt;h3 id=&#34;use-the-monitoring-query-language&#34;&gt;Use the Monitoring Query Language&lt;/h3&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;Available in Grafana v7.4 and higher.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;The Monitoring Query Language (MQL) query builder helps you query and display MQL results in time series format.
To understand basic MQL concepts, refer to &lt;a href=&#34;https://cloud.google.com/monitoring/mql&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Introduction to Monitoring Query Language&lt;/a&gt;.&lt;/p&gt;
&lt;h4 id=&#34;create-an-mql-query&#34;&gt;Create an MQL query&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;To create an MQL query:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the &lt;strong&gt;Metrics&lt;/strong&gt; option in the &lt;strong&gt;Query Type&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;&amp;lt;&amp;gt; Edit MQL&lt;/strong&gt; next to the &lt;strong&gt;Query Type&lt;/strong&gt; field.
This toggles the MQL query builder mode.&lt;/li&gt;
&lt;li&gt;Select a project from the &lt;strong&gt;Project&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;li&gt;Enter your MQL query in the text area.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;set-alias-patterns-for-mql-queries&#34;&gt;Set alias patterns for MQL queries&lt;/h3&gt;
&lt;p&gt;MQL queries use the same alias patterns as &lt;a href=&#34;#set-alias-patterns&#34;&gt;metric queries&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;However, &lt;code&gt;{{metric.service}}&lt;/code&gt; is not supported, and &lt;code&gt;{{metric.type}}&lt;/code&gt; and &lt;code&gt;{{metric.name}}&lt;/code&gt; show the time series key in the response.&lt;/p&gt;
&lt;h2 id=&#34;query-service-level-objectives&#34;&gt;Query Service Level Objectives&lt;/h2&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;Available in Grafana v7.0 and higher.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--no-shadow&#34;
    style=&#34;max-width: 400px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link captioned&#34;
        href=&#34;/static/img/docs/google-cloud-monitoring/slo-query-builder-8-0.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload mb-0&#34;
          data-src=&#34;/static/img/docs/google-cloud-monitoring/slo-query-builder-8-0.png&#34;data-srcset=&#34;/static/img/docs/google-cloud-monitoring/slo-query-builder-8-0.png?w=320 320w, /static/img/docs/google-cloud-monitoring/slo-query-builder-8-0.png?w=550 550w, /static/img/docs/google-cloud-monitoring/slo-query-builder-8-0.png?w=750 750w, /static/img/docs/google-cloud-monitoring/slo-query-builder-8-0.png?w=900 900w, /static/img/docs/google-cloud-monitoring/slo-query-builder-8-0.png?w=1040 1040w, /static/img/docs/google-cloud-monitoring/slo-query-builder-8-0.png?w=1240 1240w, /static/img/docs/google-cloud-monitoring/slo-query-builder-8-0.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;Service Level Objectives (SLO) query editor&#34;width=&#34;735&#34;height=&#34;259&#34;title=&#34;Service Level Objectives (SLO) query editor&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/google-cloud-monitoring/slo-query-builder-8-0.png&#34;
            alt=&#34;Service Level Objectives (SLO) query editor&#34;width=&#34;735&#34;height=&#34;259&#34;title=&#34;Service Level Objectives (SLO) query editor&#34;class=&#34;docs-image--no-shadow&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;figcaption class=&#34;w-100p caption text-gray-13  &#34;&gt;Service Level Objectives (SLO) query editor&lt;/figcaption&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;The SLO query builder helps you visualize SLO data in time series format.
To understand basic concepts in service monitoring, refer to the &lt;a href=&#34;https://cloud.google.com/monitoring/service-monitoring&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Google Cloud Monitoring documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;create-an-slo-query&#34;&gt;Create an SLO query&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;To create an SLO query:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Select the &lt;strong&gt;Service Level Objectives (SLO)&lt;/strong&gt; option in the &lt;strong&gt;Query Type&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;li&gt;Select a project from the &lt;strong&gt;Project&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;li&gt;Select an &lt;a href=&#34;https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SLO service&lt;/a&gt; from the &lt;strong&gt;Service&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;li&gt;Select an &lt;a href=&#34;https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services.serviceLevelObjectives&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SLO&lt;/a&gt; from the &lt;strong&gt;SLO&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;li&gt;Select a &lt;a href=&#34;https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/timeseries-selectors#ts-selector-list&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;time series selector&lt;/a&gt; from the &lt;strong&gt;Selector&lt;/strong&gt; dropdown.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Grafana&amp;rsquo;s time series selectors use descriptive names that map to system names that Google uses in the Service Monitoring documentation:&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;Selector dropdown value&lt;/th&gt;
              &lt;th&gt;Corresponding time series selector&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;SLI Value&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;select_slo_health&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;SLO Compliance&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;select_slo_compliance&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;SLO Error Budget Remaining&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;select_slo_budget_fraction&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;SLO Burn Rate&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;select_slo_burn_rate&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;alias-patterns-for-slo-queries&#34;&gt;Alias patterns for SLO queries&lt;/h3&gt;
&lt;p&gt;The &lt;strong&gt;Alias By&lt;/strong&gt; field helps you control the format of legend keys for SLO queries.&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Alias pattern&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Example result&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{project}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the GCP project name.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;myProject&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{service}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the service name.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;myService&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{slo}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the SLO.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;latency-slo&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{selector}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the selector.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;select_slo_health&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;alignment-period-and-group-by-time-for-slo-queries&#34;&gt;Alignment period and group-by time for SLO queries&lt;/h3&gt;
&lt;p&gt;SLO queries use the same alignment period functionality as &lt;a href=&#34;#define-the-alignment-period&#34;&gt;metric queries&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;apply-annotations&#34;&gt;Apply annotations&lt;/h2&gt;
&lt;figure
    class=&#34;figure-wrapper figure-wrapper__lightbox w-100p docs-image--right&#34;
    style=&#34;max-width: 400px;&#34;
    itemprop=&#34;associatedMedia&#34;
    itemscope=&#34;&#34;
    itemtype=&#34;http://schema.org/ImageObject&#34;
  &gt;&lt;a
        class=&#34;lightbox-link&#34;
        href=&#34;/static/img/docs/google-cloud-monitoring/annotations-8-0.png&#34;
        itemprop=&#34;contentUrl&#34;
      &gt;&lt;div class=&#34;img-wrapper w-100p h-auto&#34;&gt;&lt;img
          class=&#34;lazyload &#34;
          data-src=&#34;/static/img/docs/google-cloud-monitoring/annotations-8-0.png&#34;data-srcset=&#34;/static/img/docs/google-cloud-monitoring/annotations-8-0.png?w=320 320w, /static/img/docs/google-cloud-monitoring/annotations-8-0.png?w=550 550w, /static/img/docs/google-cloud-monitoring/annotations-8-0.png?w=750 750w, /static/img/docs/google-cloud-monitoring/annotations-8-0.png?w=900 900w, /static/img/docs/google-cloud-monitoring/annotations-8-0.png?w=1040 1040w, /static/img/docs/google-cloud-monitoring/annotations-8-0.png?w=1240 1240w, /static/img/docs/google-cloud-monitoring/annotations-8-0.png?w=1920 1920w&#34;data-sizes=&#34;auto&#34;alt=&#34;&#34;width=&#34;735&#34;height=&#34;197&#34;/&gt;
        &lt;noscript&gt;
          &lt;img
            src=&#34;/static/img/docs/google-cloud-monitoring/annotations-8-0.png&#34;
            alt=&#34;&#34;width=&#34;735&#34;height=&#34;197&#34;class=&#34;docs-image--right&#34;/&gt;
        &lt;/noscript&gt;&lt;/div&gt;&lt;/a&gt;&lt;/figure&gt;
&lt;p&gt;&lt;a href=&#34;/docs/grafana/v10.1/dashboards/build-dashboards/annotate-visualizations/&#34;&gt;Annotations&lt;/a&gt; overlay rich event information on top of graphs.
You can add annotation queries in the Dashboard menu&amp;rsquo;s Annotations view.&lt;/p&gt;
&lt;p&gt;Rendering annotations is expensive, and it&amp;rsquo;s important to limit the number of rows returned.
There&amp;rsquo;s no support for displaying Google Cloud Monitoring&amp;rsquo;s annotations and events, but it works well with &lt;a href=&#34;https://cloud.google.com/monitoring/custom-metrics/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;custom metrics&lt;/a&gt; in Google Cloud Monitoring.&lt;/p&gt;
&lt;p&gt;With the query editor for annotations, you can select a metric and filters.
The &lt;code&gt;Title&lt;/code&gt; and &lt;code&gt;Text&lt;/code&gt; fields support templating and can use data returned from the query.&lt;/p&gt;
&lt;p&gt;For example, the Title field could have the following text:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;{{metric.type}} has value: {{metric.value}}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Example result: &lt;code&gt;monitoring.googleapis.com/uptime_check/http_status has this value: 502&lt;/code&gt;&lt;/p&gt;
&lt;h3 id=&#34;patterns-for-the-annotation-query-editor&#34;&gt;Patterns for the annotation query editor&lt;/h3&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Alias pattern format&lt;/th&gt;
              &lt;th&gt;Description&lt;/th&gt;
              &lt;th&gt;Alias pattern example&lt;/th&gt;
              &lt;th&gt;Example result&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{metric.value}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Value of the metric/point.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{metric.value}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;555&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{metric.type}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the full Metric Type.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{metric.type}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;compute.googleapis.com/instance/cpu/utilization&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{metric.name}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the metric name part.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{metric.name}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;instance/cpu/utilization&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{metric.service}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the service part.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{metric.service}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;compute&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{metric.label.xxx}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the metric label value.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{metric.label.instance_name}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;grafana-1-prod&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;code&gt;{{resource.label.xxx}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;Returns the resource label value.&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;{{resource.label.zone}}&lt;/code&gt;&lt;/td&gt;
              &lt;td&gt;&lt;code&gt;us-east1-b&lt;/code&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;]]></content><description>&lt;h1 id="google-cloud-monitoring-query-editor">Google Cloud Monitoring query editor&lt;/h1>
&lt;p>This topic explains querying specific to the Google Cloud Monitoring data source.
For general documentation on querying data sources in Grafana, see &lt;a href="/docs/grafana/v10.1/panels-visualizations/query-transform-data/">Query and transform data&lt;/a>.&lt;/p></description></item><item><title>Google Cloud Monitoring template variables</title><link>https://grafana.com/docs/grafana/v10.1/datasources/google-cloud-monitoring/template-variables/</link><pubDate>Fri, 06 Mar 2026 08:18:51 +0000</pubDate><guid>https://grafana.com/docs/grafana/v10.1/datasources/google-cloud-monitoring/template-variables/</guid><content><![CDATA[&lt;h1 id=&#34;google-cloud-monitoring-template-variables&#34;&gt;Google Cloud Monitoring 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 lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
Grafana refers to such variables as template variables.&lt;/p&gt;
&lt;p&gt;For an introduction to templating and template variables, refer to the &lt;a href=&#34;/docs/grafana/v10.1/dashboards/variables/&#34;&gt;Templating&lt;/a&gt; and &lt;a href=&#34;/docs/grafana/v10.1/dashboards/variables/add-template-variables/&#34;&gt;Add and manage variables&lt;/a&gt; documentation.&lt;/p&gt;
&lt;h2 id=&#34;use-query-variables&#34;&gt;Use query variables&lt;/h2&gt;
&lt;p&gt;Variables of the type &lt;em&gt;Query&lt;/em&gt; help you query Google Cloud Monitoring for various types of data.
The Google Cloud Monitoring data source plugin provides the following &lt;strong&gt;Query Types&lt;/strong&gt;:&lt;/p&gt;
&lt;section class=&#34;expand-table-wrapper&#34;&gt;&lt;div class=&#34;button-div&#34;&gt;
      &lt;button class=&#34;expand-table-btn&#34;&gt;Expand table&lt;/button&gt;
    &lt;/div&gt;&lt;div class=&#34;responsive-table-wrapper&#34;&gt;
    &lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;List returned&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Metric Types&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Metric type names available for the specified service.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Labels Keys&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Keys for &lt;code&gt;metric label&lt;/code&gt; and &lt;code&gt;resource label&lt;/code&gt; in the specified metric.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Labels Values&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Values for the label in the specified metric.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Resource Types&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Resource types for the specified metric.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Aggregations&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Aggregations (cross-series reducers) for the specified metric.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Aligners&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Aligners (per-series aligners) for the specified metric.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Alignment periods&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;All alignment periods available in the query editor in Grafana.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Selectors&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Selectors for SLO (Service Level Objectives) queries.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;SLO Services&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;Service Monitoring services for SLO queries.&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;strong&gt;Service Level Objectives (SLO)&lt;/strong&gt;&lt;/td&gt;
              &lt;td&gt;SLOs for the specified SLO service.&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;
&lt;/section&gt;&lt;h2 id=&#34;use-variables-in-queries&#34;&gt;Use variables in queries&lt;/h2&gt;
&lt;p&gt;Use Grafana&amp;rsquo;s variable syntax to include variables in queries.
For details, refer to the &lt;a href=&#34;/docs/grafana/v10.1/dashboards/variables/variable-syntax/&#34;&gt;variable syntax documentation&lt;/a&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="google-cloud-monitoring-template-variables">Google Cloud Monitoring 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 lists these variables in dropdown select boxes at the top of the dashboard to help you change the data displayed in your dashboard.
Grafana refers to such variables as template variables.&lt;/p></description></item></channel></rss>