Benachrichtigungen für Aufgaben im Dataplex Universal Catalog einrichten
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite wird beschrieben, wie Sie Benachrichtigungen für fehlgeschlagene Jobausführungen einer Dataplex Universal Catalog-Aufgabe einrichten.
Zum Einrichten von Benachrichtigungen können Sie den Log-Explorer in der Google Cloud Console oder die Monitoring API verwenden.
Terminologie
Dauer bis zur automatischen Schließung von Vorfällen: Sie können einen Vorfall automatisch schließen, wenn innerhalb dieses Zeitraums keine entsprechenden Logeinträge vorhanden sind.
Zeit zwischen Benachrichtigungen: Sie können die Häufigkeit wiederholter Benachrichtigungen verringern, indem Sie eine Zeit zwischen denselben Benachrichtigungen festlegen. Logeinträge, die einem Filter entsprechen, werden in diesem Zeitraum übersprungen. Die Mindestzeit, die Sie festlegen können, beträgt 5 Minuten.
Benachrichtigungen mit dem Log-Explorer einrichten
Rufen Sie in der Google Cloud Console die Seite Log-Explorer auf.
Wenn Sie eine Benachrichtigung für eine fehlgeschlagene Jobausführung einer beliebigen Dataplex Universal Catalog-Aufgabe in einem Projekt einrichten möchten, geben Sie die folgende Abfrage ein:
Wenn Sie eine Benachrichtigung für eine fehlgeschlagene Jobausführung einer bestimmten Dataplex Universal Catalog-Aufgabe in einem Projekt einrichten möchten, geben Sie die folgende Abfrage ein:
Geben Sie im Feld Name der Benachrichtigungsrichtlinie einen Namen für die neue Benachrichtigung ein.
Geben Sie im Feld Dokumentation die Beschreibung ein, die in die Benachrichtigung aufgenommen werden soll. Weitere Informationen zum Inhalt, den Sie in das Dokumentationsfeld einer Benachrichtigungsrichtlinie einfügen können, finden Sie unter Markdown und Variablen in Dokumentationsvorlagen verwenden.
Klicken Sie auf Weiter.
Wählen Sie die Logs aus, die in die Benachrichtigung aufgenommen werden sollen, und klicken Sie auf Weiter.
Legen Sie die Zeit zwischen Benachrichtigungen und die Dauer bis zur automatischen Schließung von Vorfällen fest und klicken Sie auf Weiter.
Optional: Wählen Sie einen Benachrichtigungskanal aus. Weitere Informationen zum Konfigurieren von Benachrichtigungskanälen mit der Google Cloud Console finden Sie unter Benachrichtigungskanäle verwalten.
Klicken Sie auf Speichern.
Benachrichtigungen mit der Monitoring API einrichten
Optional: Aktivieren Sie die Monitoring API und autorisieren Sie Nutzer für den Zugriff darauf. Weitere Informationen finden Sie unter Monitoring API aktivieren.
So richten Sie eine Benachrichtigung für eine fehlgeschlagene Jobausführung für eine bestimmte Dataplex Universal Catalog-Aufgabe in einem Projekt ein:
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eThis guide outlines how to configure alerts for failed Dataplex task executions using either the Logs Explorer or the Monitoring API.\u003c/p\u003e\n"],["\u003cp\u003eAlerts can be customized to monitor for failures across all Dataplex tasks or be configured to monitor a specific task by using the appropriate log filters.\u003c/p\u003e\n"],["\u003cp\u003eThe Logs Explorer method involves creating alerts through the Google Cloud console by defining log queries that trigger notifications based on specific error conditions.\u003c/p\u003e\n"],["\u003cp\u003eThe Monitoring API method uses a JSON configuration to define the alert policy, including log filters, notification rate limits, incident autoclose duration, and notification channels, offering a programmatic approach to alert setup.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize alerts by setting the time between notifications and the duration for automatically closing incidents.\u003c/p\u003e\n"]]],[],null,["# Set up alerts and notifications for Dataplex Universal Catalog tasks\n\nThis page describes how to set up alerts for failed job executions of a\n[Dataplex Universal Catalog task](/dataplex/docs/schedule-custom-spark-tasks).\n\nTo set up alerts, you can use the Logs Explorer in the Google Cloud console\nor the Monitoring API.\n\nTerminology\n-----------\n\n- **Incident autoclose duration**: You can close an incident automatically if there are no matching log entries within this duration.\n- **Time between notifications**: You can lower the frequency of repeated notifications by setting a time between the same notification. Log entries that match a filter are skipped during this time. The minimum time you can set is 5 minutes.\n\nSet up notifications using Logs Explorer\n----------------------------------------\n\n1. In the Google Cloud console, go to the **Logs Explorer** page.\n\n\n [Go to Logs explorer](https://console.cloud.google.com/logs/query)\n\n \u003cbr /\u003e\n\n2. Click the **Show query** toggle.\n\n 1. To set up an alert for a failed job execution of any\n Dataplex Universal Catalog task in a project, type the following query:\n\n severity=ERROR\n resource.type = \"dataplex.googleapis.com/Task\"\n logName = \"projects/\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e/logs/dataplex.googleapis.com%2Fprocess\"\n jsonPayload.state = \"FAILED\"\n\n 2. To set up an alert for a failed job execution of a specific\n Dataplex Universal Catalog task in a project, type the following query:\n\n severity=ERROR\n resource.type = \"dataplex.googleapis.com/Task\"\n resource.labels.task_id = \u003cvar translate=\"no\"\u003eTASK_ID\u003c/var\u003e\n logName = \"projects/\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e/logs/dataplex.googleapis.com%2Fprocess\"\n jsonPayload.state = \"FAILED\"\n\n3. Click **Create alert**.\n\n4. In the **Alert Policy Name** field, enter a name for the new alert.\n\n5. In the **Documentation** field, enter the description you want to include in\n the notification. For more information about the content you can include in\n the documentation field of an alerting policy, see\n [Using Markdown and variables in documentation templates](/monitoring/alerts/doc-variables).\n\n6. Click **Next**.\n\n7. Choose the logs you want to include in the alert, and click **Next**.\n\n8. Set the **Time between notifications** and the **Incident autoclose duration** ,\n and click **Next**.\n\n9. Optional: Select a notification channel. For more information about configuring notification\n channels using the Google Cloud console, see [Manage notification channels](/monitoring/support/notification-options).\n\n10. Click **Save**.\n\nSet up notifications using Monitoring API\n-----------------------------------------\n\n1. Optional: Enable the Monitoring API and authorize users to access it. For more information, see [Enable the Monitoring API](/monitoring/api/enable-api#cloud-console).\n2. Optional: Set the roles or permissions needed to create an alerting policy. For more information, see [Authorization required to create alerting policies](/monitoring/alerts#permissions).\n3. Create a notification channel by using either [Google Cloud console](/monitoring/support/notification-options#creating_channels) or [Google Cloud CLI](/monitoring/alerts/using-channels-api#api-create-channels).\n4. Get the `channel_id`:\n\n gcloud beta monitoring channels list\n\n5. Create a `policy.json` file with the following content for\n log-based-alerting-policy:\n\n 1. Set up an alert for a failed job execution of any\n Dataplex Universal Catalog task in a project:\n\n {\n \"displayName\": \"Alert Using Monitoring API\",\n \"documentation\": {\n \"content\": \"Log-based alert in project \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e.\",\n \"mimeType\": \"text/markdown\"\n },\n\n \"conditions\": [\n {\n \"displayName\": \"Log match condition: Failed Job Execution\",\n \"conditionMatchedLog\": {\n \"filter\": \"severity=\\\"ERROR\\\" resource.type = \\\"dataplex.googleapis.com/Task\\\" logName = \\\"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/logs/dataplex.googleapis.com%2Fprocess\\\" jsonPayload.state = \\\"FAILED\\\"\",\n },\n }\n ],\n \"combiner\": \"OR\",\n\n \"alertStrategy\": {\n \"notificationRateLimit\": {\n \"period\": \"300s\"\n },\n \"autoClose\": \"604800s\",\n },\n\n \"notificationChannels\": [\n \"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/notificationChannels/\u003cvar translate=\"no\"\u003eCHANNEL_ID\u003c/var\u003e\"\n ]\n }\n\n 2. Set up an alert for a failed job execution for a specific\n Dataplex Universal Catalog task in a project:\n\n {\n \"displayName\": \"Alert Using Monitoring API\",\n \"documentation\": {\n \"content\": \"Log-based alert in project \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e.\",\n \"mimeType\": \"text/markdown\"\n },\n\n \"conditions\": [\n {\n \"displayName\": \"Log match condition: Failed Job Execution\",\n \"conditionMatchedLog\": {\n \"filter\": \"severity=\\\"ERROR\\\" resource.type = \\\"dataplex.googleapis.com/Task\\\" logName = \\\"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/logs/dataplex.googleapis.com%2Fprocess\\\" jsonPayload.state = \\\"FAILED\\\" resource.labels.task_id = \\\"\u003cvar translate=\"no\"\u003eTASK_ID\u003c/var\u003e\\\"\",\n },\n }\n ],\n \"combiner\": \"OR\",\n\n \"alertStrategy\": {\n \"notificationRateLimit\": {\n \"period\": \"300s\"\n },\n \"autoClose\": \"604800s\",\n },\n\n \"notificationChannels\": [\n \"projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/notificationChannels/\u003cvar translate=\"no\"\u003eCHANNEL_ID\u003c/var\u003e\"\n ]\n }\n\n6. Pass the `policy.json` file to the `gcloud` CLI:\n\n gcloud alpha monitoring policies create --policy-from-file=\"policy.json\"\n\n If successful, the command returns the resource name of the new policy. For\n example:\n\n `Created alert policy [projects/PROJECT_ID/alertPolicies/*POLICY_ID*].`\n\nWhat's next\n-----------\n\n- Learn more about [Cloud Logging](/logging/docs).\n- Learn about [monitoring Dataplex Universal Catalog metrics](/dataplex/docs/monitoring)."]]