Menu
Documentation
Grafana Cloud
Connect to data sources
Data sources
Google Cloud Monitoring
Template variables
Grafana Cloud
Google Cloud Monitoring template variables
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.
For an introduction to templating and template variables, refer to the Templating and Add and manage variables documentation.
Use query variables
Variables of the type Query help you query Google Cloud Monitoring for various types of data. The Google Cloud Monitoring data source plugin provides the following Query Types:
Name | List returned |
---|---|
Metric Types | Metric type names available for the specified service. |
Labels Keys | Keys for metric label and resource label in the specified metric. |
Labels Values | Values for the label in the specified metric. |
Resource Types | Resource types for the specified metric. |
Aggregations | Aggregations (cross-series reducers) for the specified metric. |
Aligners | Aligners (per-series aligners) for the specified metric. |
Alignment periods | All alignment periods available in the query editor in Grafana. |
Selectors | Selectors for SLO (Service Level Objectives) queries. |
SLO Services | Service Monitoring services for SLO queries. |
Service Level Objectives (SLO) | SLOs for the specified SLO service. |
Use variables in queries
Use Grafana’s variable syntax to include variables in queries. For details, refer to the variable syntax documentation.
Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
![Getting started with the Grafana LGTM Stack](/static/assets/featured/getting-started-with-grafana-lgtm-stack-amer_featured.png?w=200 200w, /static/assets/featured/getting-started-with-grafana-lgtm-stack-amer_featured.png?w=400 400w)
Getting started with the Grafana LGTM Stack
In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics.
![Intro to Kubernetes monitoring in Grafana Cloud](/media/webinar/Screenshot-2024-02-12-at-4.09.30-PM.png?w=200 200w, /media/webinar/Screenshot-2024-02-12-at-4.09.30-PM.png?w=400 400w)
Intro to Kubernetes monitoring in Grafana Cloud
In this webinar you’ll learn how Grafana offers developers and SREs a simple and quick-to-value solution for monitoring their Kubernetes infrastructure.
![Building advanced Grafana dashboards](/media/webinar/AMER_buildadv_notxt.png?w=200 200w, /media/webinar/AMER_buildadv_notxt.png?w=400 400w)
Building advanced Grafana dashboards
In this webinar, we’ll demo how to build and format Grafana dashboards.