Como prática recomendada, crie backups usando a programação automática. No entanto, pode ser um desafio acompanhar o status desses backups criados automaticamente. Você tem duas opções:
Visualizar periodicamente a lista de recursos Backup, procurando backups que apresentaram falha recentemente.
Configurar um alerta para receber notificações quando a execução do backup falhar.
Antes de configurar uma política de alertas, verifique se você tem um canal de notificação apropriado.
Criar um alerta
Para criar políticas gerais de alertas com base em registros, consulte Configurar alertas com base em registros.
Ou, para criar uma política de alertas especificamente para o Backup para GKE com falha:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2024-11-22 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."]]