Sebagai praktik terbaik, buat cadangan menggunakan penjadwalan otomatis. Namun,
melacak status untuk cadangan yang dibuat otomatis ini bisa menjadi
tantangan tersendiri. Anda memiliki dua pilihan:
Lihat daftar resource Backup secara berkala untuk mencari pencadangan yang baru gagal.
Siapkan pemberitahuan untuk memberi tahu Anda jika eksekusi pencadangan gagal.
Sebelum menyiapkan kebijakan pemberitahuan, pastikan Anda memiliki
saluran notifikasi yang sesuai.
Membuat pemberitahuan
Untuk membuat kebijakan pemberitahuan berbasis log yang umum, lihat Mengonfigurasi pemberitahuan berbasis log.
Atau, untuk membuat kebijakan pemberitahuan khusus pencadangan yang gagal di Pencadangan untuk GKE:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-01 UTC."],[],[],null,["# Set up alerts for failed backups\n\nAutopilot Standard\n\n*** ** * ** ***\n\nThis page describes how to configure the system so that you will receive alerts\nwhen Backup for GKE backups fail.\n\nYou can create backups in two different ways:\n\n- By [manually creating](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/backup#manual) a `Backup` resource.\n- By configuring a schedule when [creating your `BackupPlan` resource](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/backup-plan#create_a_backup_plan).\n\nAs a best practice, create backups using automatic scheduling. However, it can\nbe challenging to keep track of the status for these automatically created\nbackups. You have two choices:\n\n- Periodically [view](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/backup#view_a_backup) the list of `Backup` resources, looking for newly failed backups.\n- Set up an alert to notify you when backup execution fails.\n\nThis page describes how to configure an alert policy based on [log events emitted by Backup for GKE](/kubernetes-engine/docs/add-on/backup-for-gke/how-to/platform-logging-backup-for-gke) and viewable from the\n[Logs Explorer](/logging/docs/view/logs-explorer-interface).\n\nBefore you begin\n----------------\n\nBefore setting up an alert policy, ensure you have an\nappropriate [notification channel](/monitoring/support/notification-options).\n\nCreate an alert\n---------------\n\nTo create general log-based alert policies, see [Configure log-based alerts](/logging/docs/alerting/log-based-alerts).\nOr, to create an alert policy specifically for Backup for GKE failed backups:\n\n1. Go to the Logs Explorer page\n\n [Go to Logs Explorer](https://console.cloud.google.com/logs/query)\n2. Enter the following filter criteria in the **Query** pane:\n\n logName=\"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/logs/gkebackup.googleapis.com%2Fbackup_change\"\n resource.type=\"gkebackup.googleapis.com/BackupPlan\"\n resource.labels.backup_plan_id=\"\u003cvar translate=\"no\"\u003eBACKUP_PLAN\u003c/var\u003e\"\n resource.labels.location=\"\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\"\n jsonPayload.changeType=\"UPDATE\"\n jsonPayload.inputBackup.state=\"FAILED\"\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project.\n - \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the [compute region](/compute/docs/regions-zones#available) of the backup plan for which you want to generate alerts.\n - \u003cvar translate=\"no\"\u003eBACKUP_PLAN\u003c/var\u003e: the name of the backup plan for which you want to generate alerts.\n\n | **Note:** This creates an alert policy for any failed backups of a specific backup plan. If you want to create a single policy for all failed backups, omit the `resource.labels.backup_plan_id` and `resource.labels.location` fields.\n3. Click the **Create alert** label below the **Query** pane.\n\n4. Enter a meaningful name for your alert policy and any documentation you\n want to make available to recipients of alerts.\n\n5. Click **Next** twice.\n\n6. Set the appropriate notification frequency and autoclose duration. We\n suggest `5 min` and `7 days`.\n\n7. Click **Next**.\n\n8. Select the appropriate notification channels and save your alert\n policy.\n\nAfter you save the policy, you receive alerts to your notification channels when\na backup matching your filter fails."]]