This page describes how to configure the system so that you will receive alerts when Backup for GKE backups fail.
You can create backups in two different ways:
- By manually creating a
- By configuring a schedule when creating your
As a best practice, create backups using automatic scheduling. However, it can be challenging to keep track of the status for these automatically created backups. You have two choices:
- Periodically view the list of
Backupresources, looking for newly failed backups.
- Set up an alert to notify you when backup execution fails.
Before you begin
Before setting up an alert policy, ensure you have an appropriate notification channel.
Create an alert
To create general log-based alert policies, see Configure log-based alerts. Or, to create an alert policy specifically for Backup for GKE failed backups:
Go to the Logs Explorer page
Enter the following filter criteria in the Query pane:
logName="projects/PROJECT_ID/logs/gkebackup.googleapis.com%2Fbackup_change" resource.type="gkebackup.googleapis.com/BackupPlan" resource.labels.backup_plan_id="BACKUP_PLAN" resource.labels.location="LOCATION" jsonPayload.changeType="UPDATE" jsonPayload.inputBackup.state="FAILED"
Replace the following:
PROJECT_ID: the ID of your Google Cloud project.
LOCATION: the compute region of the backup plan for which you want to generate alerts.
BACKUP_PLAN: the name of the backup plan for which you want to generate alerts.
Click on the Create alert label below the Query pane.
Enter a meaningful name for your alert policy and any documentation you want to make available to recipients of alerts.
Click Next twice.
Set the appropriate notification frequency and autoclose duration. We suggest
Select the appropriate notification channels and save your alert policy.
After you save the policy, you receive alerts to your notification channels when a backup matching your filter fails.