Edit, list, and delete alerting policies

Stay organized with collections Save and categorize content based on your preferences.

This document describes how to edit, list, and view your alerting policies by using the Google Cloud console. It also describes how to view the JSON representation of a policy and how to add alerting policies to a custom dashboard. When you add policies to a custom dashboard, you can view your policies in the same context as your metric data.

This document doesn't describe how to edit, list, and view your alerting policies by using the Cloud Monitoring API. For more information, see Manage alerting policies by API.

Before you begin

  1. Ensure that your Identity and Access Management role includes the necessary permissions:

    • To get the permissions that you need to view alerting policies, ask your administrator to grant you the role of Monitoring Viewer (roles/monitoring.viewer).
    • To get the permissions that you need to create and edit alerting policies, and to edit dashboards, ask your administrator to grant you the role of Monitoring Editor (roles/monitoring.editor).

    For more information about roles, see Access control.

  2. Ensure that you're familiar with the general concepts of alerting policies. For more information, see Introduction to alerting.

Edit, list, or delete alerting policies

  1. In the Google Cloud console, select Monitoring or click the following button:
    Go to Monitoring

  2. In the navigation pane, select Alerting.

    The Alerting page displays panes that list summary information, incidents, and alerting policies.

  3. Click See all policies in the Policies pane.

    The Policies page lists all policies, includes a filter bar, and for each policy, options to edit, copy, or delete the policy:

    • To filter the list of alerting policies, do one of the following:

      • Enter a name on the filter bar. For example, to display only policies whose name contains Example, enter Example. A case-sensitive comparison tests whether a policy is listed.
      • Click Filter policies, select the filter property, and then either enter a value for the filter or select a value from the menu.

      When you add multiple filters, a logical AND joins the filters.

  4. Optional: To view the details of a policy, click the name of the policy. For information about the Policy details page, see View an alerting policy.

  5. Optional: To edit or copy a policy, click More options, and select the corresponding option. Editing and copying a policy is similar to creating a metric-based alerting policy. However, not all fields can be modified. When done, click Save policy.

  6. Optional: To delete a policy, click More options and select Delete. In the confirmation dialog, select Delete.

    If you delete the alerting policy associated with an alert chart, then the alert chart no longer displays any data. For more information, see Alert chart doesn't display any data.

View an alerting policy

  1. In the Google Cloud console, select Monitoring or click the following button:
    Go to Monitoring

  2. In the navigation pane, select Alerting.

  3. To list all policies, click See all policies in the Policies pane.

  4. Find the policy that you want to view, and then select it.

For example, the following screenshot illustrates the details for the alerting policy named Test staging:

Sample alert-policy details page.

As shown in the previous image, the details page provides you information about the alerting policy:

  • To view incidents created by the policy, see the Incidents section.

  • To view the configured notification channels, see the Notification Channels section.

  • To view the additional information that you specified to be included with a notification, see the Documentation section.

  • To view the user-defined labels, view the Labels section. For examples that illustrate how you can use labels to manage your alerts, see Add severity levels to an alerting policy.

  • To edit, copy, delete, download the JSON representation, or change the enabled state of the policy, use options in the toolbar. For example, to disable an alerting policy that is enabled, click Enabled and then select Disable in the confirmation dialog.

View the JSON representation of an alerting policy

When you create or modify an alerting policy by using the Cloud Monitoring API, you provide a JSON representation of that policy to the API method. You can create the JSON yourself by using the API documentation to guide the content. An alternative is to create a policy by using the Google Cloud console, and then download the policy to your local system. The JSON file that you downloaded can be edited and used as a template for other policies. For examples of policies described by JSON, see Sample policies.

To download the JSON representation of an alerting policy, do the following:

  1. In the Google Cloud console, select Monitoring or click the following button:
    Go to Monitoring
  2. In the navigation pane, select Alerting.
  3. Find the policy that you want to view, and then click the policy name to open the Policy details page.
  4. Click JSON.

To view the JSON representation of an alerting policy when you're editing it, click View code.

Add alerting policy to dashboard

To view your alerting policies in the same context as your metric data, add those policies to a custom dashboard. When you view that dashboard, it shows a chart for each alerting policy that you added. These charts display the monitored metric, the threshold, and the number of open incidents for the policy. These charts also contain links that let you view or edit the policy.

You can add policies with one condition to custom dashboards. Policies that contain multiple conditions can be viewed only from the alerting context.

To display a summary of an alerting policy on a custom dashboard, do the following:

  1. In the Google Cloud console, select Monitoring or click the following button:
    Go to Monitoring
  2. In the navigation pane, select Dashboards, then select the dashboard that you want to view or edit.
  3. If the Edit dashboard button is shown, then click it.

  4. Select Alert chart from the widget library, or click Add chart and then select Alert chart from the menu.

  5. In the configuration pane of the Alert chart, use the Alert policy menu to select an alerting policy. Only single-condition alerting policies can be selected from the Alert policy menu.

The following screenshot illustrates an alert chart:

Example of an alert chart.

In this example, the alerting policy is monitoring the CPU usage of two different virtual machines. The dashed line shows the condition threshold, which is set to 50%. The green chip with the label No incidents indicates that there are no open incidents for the alerting policy. If you place your pointer on the chip that shows the number of open incidents, then a dialog opens that links to the underlying alerting policy.

For more information, see Dashboards and charts.