Display alerts and charts for alerting policies

You can add alerting policy charts and alert widgets to your Cloud Monitoring custom dashboards to monitor policy thresholds and track open alerts alongside your metric data. An alerting policy chart displays the monitored time series, the threshold, and the number of open alerts. An alert widget provides a tabular view of alerts, letting you investigate policy conditions and alert details directly from your dashboard.

The information in this document is for the Google Cloud console. For information about using the Cloud Monitoring API, see the following documents:

This feature is supported only for Google Cloud projects. For App Hub configurations, select the App Hub host project or management project.

Before you begin

Complete the following in the Google Cloud project where you want to create and manage dashboards:

Add alerting policies to a dashboard

To view the data that an alerting policy monitors alongside log, metric, and trace data, add the alerting policy's chart to your dashboard. The chart displays the monitored time series, the associated threshold, the number of open alerts, and whether the policy is disabled. You can also use options on the chart to get more information about the alerting policy.

The following screenshot illustrates a chart for an alerting policy:

Example of a chart for an alerting policy.

To display the chart for an alerting policy on a dashboard, do the following:

  1. In the Google Cloud console, go to the  Dashboards page:

    Go to Dashboards

    If you use the search bar to find this page, then select the result whose subheading is Monitoring.

  2. In the toolbar of the Google Cloud console, select your Google Cloud project. For App Hub configurations, select the App Hub host project or management project.
  3. Select a dashboard or click Create dashboard.
  4. In the toolbar, click  Add widget.
  5. In the Add widget dialog, select Alerting Policy.
  6. Click Alerting policy, and then select an alerting policy.
  7. To apply your changes to the dashboard, in the toolbar, click Apply. To discard your changes, click Cancel.

Inspect an alerting policy or explore chart metrics

When you are viewing a chart for an alerting policy, you might want more information about the alerting policy. For example, you might want to review the selected notification channels or what custom documentation is included with a notification. To get information about the alerting policy, try the following:

  • To access the alerting policy, click the alerts chip on the chart, and then select View alert policy.

  • To view details of the chart, place your pointer on the chart, click More chart options, and then select View in Metrics Explorer.

    Metrics Explorer displays a copy of the chart that is on your dashboard.

Charts for deleted alerting policies

If you delete an alerting policy, any charts associated with that policy stop displaying data. For more information, see Alerting policy widget doesn't display any data.

Display alerts on a dashboard

To view a table of alerts in the same context as your metric data, add an Alerts widget, which lists information about alerts using a tabular format. For each alert, the widget displays the names of the alerting policy and condition, and when the alert opened. The widget includes options that let you view the associated alerting policy and the alert details.

The following screenshot illustrates an Alerts widget:

Alerts widget." class="screenshot">

The remaining information in this section is for the Google Cloud console. For information about using the Cloud Monitoring API, see Dashboard with an Alerts widget.

An Alerts widget can list at most 20 alerting policies or at most 20 resources. An Alerts widget can't list both alerting policies and resources.

To display alerts on a dashboard, do the following:

  1. In the Google Cloud console, go to the  Dashboards page:

    Go to Dashboards

    If you use the search bar to find this page, then select the result whose subheading is Monitoring.

  2. In the toolbar of the Google Cloud console, select your Google Cloud project. For App Hub configurations, select the App Hub host project or management project.
  3. Select a dashboard or click Create dashboard.
  4. In the toolbar, click  Add widget.
  5. In the Add widget dialog, select  Alerts.
  6. Optional: Add a title.
  7. Optional: Select the criteria that define which alerts are shown. By default, all alerts in the Google Cloud project are listed. However, you can restrict the widget to display alerts for specific alerting policies or resource types:

    • To display all alerts, use the default settings.

    • To display only alerts for specific alerting policies, select Alert policy and then make selections from the Alert policies menu.

      There is a limit of 20 alerting policies per Alerts widget. If you exceed this limit, the Google Cloud console displays the error message "You must choose no more than 20 policies".

    • To display only alerts for specific resource types, select Resource type and then make selections from the Resource types menu.

      There is a limit of 20 resources per Alerts widget. If you exceed this limit, then saving your dashboard fails.

    You can't select specific alerting policies and specific resource types.

  8. To apply your changes to the dashboard, in the toolbar, click Apply. To discard your changes, click Cancel.

By default, only open alerts are shown. To show all alerts, including those that have closed within the time interval specified by the time-range selector, place your pointer on the Alerts widget to enable the toolbar, and then enable the Show closed alerts toggle.

You can sort the list of alerts by the date opened or closed. You can also search the list by using the Filter field.

Inspect an alert or explore alerting policy details

When you are viewing an Alerts widget, you might want information about the alert or the alerting policy:

  • To view the details of an alert, find that alert in the Alerts widget and click View.

  • To view the details of the alerting policy associated with the alert, find that alert in the Alerts widget and then select the policy name.

What's next

You can also add widgets to your custom dashboards that display the following:

For information about exploring charted data and filtering your dashboards, see the following documents: