Jump to Content
Management Tools

Cloud Monitoring now offers PromQL alerting and importing dashboards from Grafana

February 12, 2024
https://storage.googleapis.com/gweb-cloudblog-publish/images/multicloud2022.max-2500x2500.jpg
Lee Yanco

Senior Product Manager

Try Gemini 1.5 models

Google's most advanced multimodal models in Vertex AI

Try it

The Cloud Monitoring team believes in the power of the open source community and open source interfaces. Our stance is that you should be able to get the near-unlimited scalability of our metrics platform without giving up the platform neutrality of open source projects or the battle-tested breadth of resources created by the community. This is why we’ve invested heavily in both the OpenTelemetry project and the Prometheus ecosystem with our Managed Service for Prometheus. Today, we’re excited to announce that Cloud Monitoring has achieved even greater compatibility with the open-source monitoring ecosystem with our GA release of PromQL-based alerting policies, and our command-line tool for importing dashboards from Grafana!

Cloud Monitoring’s PromQL querying has proven to be quite popular, with customers appreciating the tight integration with Google Cloud services and not having to run a separate application just to query metrics. However, until now, adopting the Cloud Monitoring UI meant manually porting over any pre-existing custom dashboards or alerts and sacrificing the ability to easily use the fantastic wealth of dashboards and alerts created by the community. With this release, you get the best of all worlds: your dashboard and alerting assets, the community’s recommended assets, and the power and scalability of Cloud Monitoring.

PromQL alerting in the console

While open-source PromQL alerting is very flexible and powerful, it traditionally suffers from usability issues. Writing alert expressions in YAML doesn’t provide you a good way to visually assert correctness, nor is there any way to write tests as an alternative to visual confirmation. Running the required standalone alertmanager instance inserts a potential infrastructure reliability risk into your critical alerting and notification routing path.

With Cloud Monitoring’s fully managed PromQL alerting, you get the universality of open-source alerting without having to run and manage your own open-source infrastructure. You can upload any alert rule written in standard Prometheus rule_files format using the gcloud command line migration tool or Terraform, you can create PromQL alerts from scratch in Cloud Monitoring’s alerting UI, or you can generate PromQL using the Metrics Explorer query builder and then copy-paste it into a new alerting policy.

https://storage.googleapis.com/gweb-cloudblog-publish/images/1_-_awesome_alert.max-1600x1600.png

Creating an alert on container high memory usage using standard cAdvisor metrics and a PromQL alert expression from samber’s Awesome Prometheus Alerts.

Fired alerts can be routed to any supported notification channel, including email, PagerDuty, Slack, SMS, and Pub/Sub. Other destinations can usually be supported by using Webhooks. Recording rules are not yet supported.

Import dashboards from Grafana

Cloud Monitoring provides a command-line tool that you can use to import dashboard files that use the Grafana JSON format. Most dashboards that are in Grafana’s dashboard library, that you find in a Github repo, or that you have created yourself can be displayed in the Cloud Monitoring UI.

Cloud Monitoring makes it even easier to pivot dashboards with automatically generated page-level filters. You can also add Cloud Logging widgets or charts that use Google Cloud system metrics to your dashboard for an even richer monitoring experience.

Getting started

PromQL is now generally available in Cloud Monitoring’s alerting. To learn more about creating policies using the API, UI, or Terraform, see the documentation for Alerting policies with PromQL or see the Public Preview blog post for a working example. You can also get started in the Cloud Console by navigating to the alert policy creation page, selecting Code editor, then selecting PromQL at the bottom of the code window.

Importing dashboards requires building and using a command-line tool. For instructions, see the documentation for Importing Grafana dashboards into Cloud Monitoring.

Posted in