Google Cloud Monitoring data source
Google Cloud Monitoring is Google Cloud Platform’s native monitoring and observability service that collects metrics, events, and metadata from GCP resources, hosted uptime probes, and application instrumentation. The Google Cloud Monitoring data source in Grafana allows you to query and visualize this data alongside metrics from other systems, creating unified dashboards for comprehensive infrastructure and application monitoring.
Grafana ships with the Google Cloud Monitoring data source preinstalled in both Grafana OSS and Grafana Enterprise, so there’s nothing for you to install. It’s packaged as a standalone plugin that updates independently of Grafana releases. For details, refer to Plugin updates.
Get started
The following documents help you get started with the Google Cloud Monitoring data source:
- Configure the data source - Set up authentication and connect to Google Cloud
- Query editor - Create and edit Metrics, SLO, and PromQL queries
- Template variables - Create dynamic dashboards with Google Cloud Monitoring variables
- Annotations - Overlay Google Cloud Monitoring events on graphs
- Alerting - Create alert rules based on GCP metrics and SLOs
- Google authentication - Configure authentication methods for GCP access
- Troubleshooting - Solve common configuration and query errors
Supported query types
The Google Cloud Monitoring data source supports the following query types:
Additional features
After you configure the Google Cloud Monitoring data source, you can:
- Create a wide variety of visualizations using GCP metrics.
- Configure and use template variables for dynamic dashboards.
- Add transformations to manipulate query results.
- Add annotations to overlay events on your graphs.
- Set up alerting based on GCP metrics.
- Use Explore to investigate your Google Cloud data without building a dashboard.
Import dashboards for GCP services
The Google Cloud Monitoring plugin no longer bundles pre-configured dashboards. Earlier versions shipped curated dashboards for popular GCP services that you imported from the data source’s Dashboards tab. As of plugin version 12.6.1, these dashboards are no longer included, so the Dashboards tab doesn’t list them.
To build equivalent dashboards, do one of the following:
- Browse the Grafana dashboards catalog for community and Grafana-authored dashboards that use the Google Cloud Monitoring data source.
- Reference the Google Cloud dashboard samples and recreate the panels using the query editor.
When you build dashboards for multiple GCP projects, add a template variable populated with the projects accessible by the configured service account so you can switch projects from a drop-down.
Plugin updates
Starting with Grafana v13.2, the Google Cloud Monitoring data source is a standalone plugin, preinstalled in both Grafana OSS and Grafana Enterprise. This enables more frequent updates independent of Grafana releases. Grafana automatically checks the plugin catalog and installs the latest version on each server restart.
To adjust this behavior:
- Opt out of auto-updates: Set
preinstall_auto_updatetofalsein your configuration file. - Update manually: Update at any time from the Administration > Plugins page without restarting Grafana.
The standalone plugin requires Grafana 12.3.0 or later. The Google Cloud Monitoring data source bundled with Grafana 12.2 and earlier continues to work as before. These versions are unaffected by the change.
Users running Grafana 12.3.x through 13.1.x can install the standalone plugin from the plugin catalog if they want the latest features before upgrading to Grafana 13.2. To use the standalone plugin with these versions, add the following to your configuration file:
[plugin.stackdriver]
as_external = true
[plugins]
; Install the latest version on startup:
preinstall_sync = stackdriver
; Or install a specific version:
; preinstall_sync = stackdriver@<version>Query with the Grafana CLI
You can query this data source from the command line and from AI coding agents using the Grafana CLI, gcx. gcx gives you and your agent structured, terminal-based access to your Grafana data sources, which is useful for automation and agent-driven investigations.
gcx supports Grafana Cloud and Grafana OSS or Enterprise v12 and later. Before you query, install and authenticate gcx. Refer to the
gcx CLI documentation for installation, configuration, and the full command reference.
For example, to explore and query your Google Cloud Monitoring data source, use the gcx datasources cloudmonitoring commands:
# List the projects and metrics available to the data source
gcx datasources cloudmonitoring list-projects -d <DATASOURCE_UID>
gcx datasources cloudmonitoring list-metrics -d <DATASOURCE_UID> --project my-project --service compute.googleapis.com
# Run a structured metrics query
gcx datasources cloudmonitoring query -d <DATASOURCE_UID> --project my-project \
--metric compute.googleapis.com/instance/cpu/utilization --since 1h
# Split the result into one series per instance with a cross-series reducer
gcx datasources cloudmonitoring query -d <DATASOURCE_UID> --project my-project \
--metric compute.googleapis.com/instance/cpu/utilization \
--reducer REDUCE_MEAN --group-by resource.label.instance_name --since 1hReplace <DATASOURCE_UID> with the UID of your Google Cloud Monitoring data source. You can omit the -d flag when datasources.cloudmonitoring is configured in your gcx context. Queries are structured rather than expression-based, so --project and --metric are required. The --group-by flag requires a --reducer other than REDUCE_NONE, and --filter matches are exact and case-sensitive, with no regular expression or wildcard support. The list-projects and list-metrics commands help you discover valid values.


