Configure alerts for scheduled snapshots

Linux Windows

You cancreate a custom metricto raise alerts or provide information to troubleshoot problems with scheduledsnapshots.

For example, to set up an alert for scheduled snapshot failures, use thefollowing procedure:

  1. Create a custom query to capture scheduled snapshotevents.
  2. Create a metric based off of the query thatcounts scheduled snapshot failures.
  3. Create an alert policy to send an alert when there isa scheduled snapshot failure.

Before you begin

Required roles and permissions

To get the permissions that you need to create a snapshot schedule, ask your administrator to grant you the following IAM roles on the project:

For more information about granting roles, seeManage access to projects, folders, and organizations.

You might also be able to get the required permissions throughcustom roles or otherpredefined roles.

Create a custom query

To capture scheduled snapshot events, create a custom query inLogs explorer.

  1. In the Google Cloud console, go to theLogging > Logs Explorer page.

    Go to the Logs Explorer page

  2. If the query editor isn't visible at the top of the page, click theShow query toggle.

  3. Enter the following text in the query editor, replacingPROJECT_ID with your project ID:

    resource.type="gce_disk"logName="projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fsystem_event"protoPayload.methodName="ScheduledSnapshots"severity>"INFO"
  4. ClickRun query.

Create a metric

After you create the custom query, create a metric thatcounts scheduled snapshot failures.

  1. At the top of the results table on theLogs Explorer page, click theActions drop-down.
  2. SelectCreate metric.
  3. In theCreate log-based metric window, provide the following details:

    • Metric type:Counter
    • Log-based metric name:scheduled_snapshot_failure_count
    • Description:count of scheduled snapshot failures

    TheFilter selection section is automatically populated with thequery from the previous step.

  4. UnderLabels, clickAdd label and enter the following:

    • Label name:status
    • Description:status of scheduled snapshot request
    • Label type:STRING
    • Field name:protoPayload.response.status
  5. ClickDone.

  6. ClickCreate Metric.

Create an alert policy

After you create the metric, create an alert policy to send an alert whenthere's a scheduled snapshot failure.

  1. In the Google Cloud console, go to theCloud Logging > Log-based metrics page.

    Go to the Log-based metrics page

  2. In theUser-defined Metrics section, find your new metric namedscheduled_snapshot_failure_count.

  3. Click theMoremenu button in this row and selectCreate alert from metric.

    TheCreate alerting policy page opens.

  4. In theNew condition tab, configure your alert signal:

  5. Set theRolling window to5 minutes or your preferredinterval.

  6. ForRolling window function, selectSum.

    ClickNext.

  7. In theConfigure trigger tab, enter the following:

    1. Condition type:Threshold
    2. Alert trigger:Any time series violates
    3. Threshold position:Above threshold
    4. Threshold value:0

      SettingThreshold value to0 triggers an alert ifany snapshotfailure occurs. You can modify this value as your workload requires.

    5. Condition name:Snapshot failure threshold exceeded

    ClickNext.

  8. In theNotifications and name tab, set yourAlert policy name.Optionally, you can add notification channels and documentation forthis policy.

    ClickNext.

  9. Review your alert.

  10. ClickCreate Policy.

To learn more about creating alert policies, seeCreate metric-threshold alerting policies.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-18 UTC.