Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questa pagina descrive la procedura per configurare i canali di notifica per ricevere
avvisi.
I canali di notifica sono i meccanismi di distribuzione degli avvisi configurati.
Il sistema invia una notifica ai destinatari designati tramite questi canali quando un evento
attiva un avviso. Questa procedura garantisce che gli avvisi critici raggiungano il
personale appropriato tramite i suoi metodi di comunicazione preferiti.
Negli ambienti con air gap di Google Distributed Cloud (GDC), i canali di notifica predefiniti
come Slack o l'email non sono disponibili. Per ricevere avvisi, devi configurare almeno un canale di notifica personalizzato. Modifica le risorse personalizzate ObservabilityPipeline nello spazio dei nomi del progetto per applicare le configurazioni del canale.
Personalizzando i canali di notifica, gli amministratori possono:
Target specifici: invia avvisi diretti a persone, team o
turni di reperibilità responsabili della risoluzione dei problemi.
Utilizza i metodi di comunicazione preferiti: invia avvisi tramite canali come
SMS, PagerDuty, webhook o integrazioni personalizzate, in base alle preferenze
individuali e ai flussi di lavoro operativi.
Evita l'eccesso di avvisi: riduci il rumore e assicurati che gli avvisi vengano ricevuti da chi deve intervenire.
L'implementazione dei canali di notifica in GDC richiede
che gli amministratori definiscano la configurazione del canale all'interno del sistema. Questa
procedura in genere prevede la specifica di parametri quali:
Tipo di canale: il tipo di canale utilizzato.
Destinazione: l'endpoint a cui il sistema deve inviare le notifiche.
Autenticazione: tutte le credenziali richieste per accedere alla destinazione.
Configurando i canali di notifica, gli amministratori possono garantire che la piattaforma di monitoraggio fornisca in modo efficace avvisi critici, consentendo risposte rapide a potenziali problemi e mantenendo la stabilità e le prestazioni degli ambienti GDC.
Prima di iniziare
Per ottenere le autorizzazioni necessarie per gestire le risorse personalizzate ObservabilityPipeline, chiedi all'amministratore IAM dell'organizzazione o all'amministratore IAM del progetto di concederti uno dei ruoli ObservabilityPipeline associati.
Inoltre, per ottenere le autorizzazioni necessarie per gestire gli oggetti ConfigMap nello spazio dei nomi del progetto richiesto per definire le regole di configurazione, chiedi all'amministratore IAM dell'organizzazione o all'amministratore IAM del progetto di concederti il ruolo di creatore di ConfigMap.
A seconda del livello di accesso e delle autorizzazioni di cui hai bisogno, potresti ottenere i ruoli di creatore, editor o visualizzatore per queste risorse in un'organizzazione o in un progetto. Per maggiori informazioni, vedi Preparare le autorizzazioni IAM.
Configurare i canali di notifica
Configura i canali di notifica per gli avvisi nello spazio dei nomi del progetto:
Definisci la configurazione personalizzata per i canali di notifica in un file YAML
denominato alertmanager.yml. Devi seguire la stessa sintassi della
specifica Alertmanager:
Crea un oggetto ConfigMap e includi la configurazione personalizzata dal file
alertmanager.yml nel campo data.
L'esempio seguente mostra l'aspetto dell'oggetto ConfigMap con il file
alertmanager.yml:
apiVersion:v1kind:ConfigMapmetadata:name:CONFIGMAP_NAME# The namespace must match your project namespace.namespace:PROJECT_NAMESPACEdata:# The file name must be alertmanager.ymlalertmanager.yml:|# Define your notification channels.# Add the custom configuration in the following lines of this file.# Follow the same syntax as in https://prometheus.io/docs/alerting/latest/configuration[...]
Sostituisci quanto segue:
CONFIGMAP_NAME: il nome del file di definizione
ConfigMap. Utilizzerai questo nome in un secondo momento nella risorsa personalizzata ObservabilityPipeline.
PROJECT_NAMESPACE: lo spazio dei nomi del progetto.
Applica l'oggetto ConfigMap al server dell'API Management all'interno dello stesso spazio dei nomi degli avvisi configurati:
KUBECONFIG_PATH: il percorso del file kubeconfig
per il server dell'API di gestione.
CONFIGMAP_NAME: il nome del file di definizione
ConfigMap.
Modifica la specifica della risorsa personalizzata ObservabilityPipeline per importare
la configurazione nel campo alertmanagerConfig:
# Configure the observability pipeline.apiVersion:observability.gdc.goog/v1kind:ObservabilityPipelinemetadata:# The namespace must match your project namespace.namespace:PROJECT_NAMESPACEname:OBSERVABILITY_PIPELINE_NAMEspec:# Configure alerts.alerting:# The alerting configuration must be in the ConfigMap.# The value must match the ConfigMap name exactly.alertmanagerConfig:CONFIGMAP_NAME[...]
Sostituisci quanto segue:
PROJECT_NAMESPACE: lo spazio dei nomi del progetto.
OBSERVABILITY_PIPELINE_NAME: il nome della risorsa personalizzata ObservabilityPipeline.
CONFIGMAP_NAME: il nome che hai utilizzato per il file di definizione
ConfigMap. Il nome deve corrispondere esattamente.
Salva il file.
Applica le modifiche della risorsa personalizzata ObservabilityPipeline al server dell'API Management all'interno dello stesso spazio dei nomi degli avvisi configurati:
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThis guide outlines how to configure custom notification channels in Google Distributed Cloud (GDC) air-gapped environments, where predefined channels like Slack or email are not available.\u003c/p\u003e\n"],["\u003cp\u003eCustom notification channels allow for alerts to be delivered to specific recipients via preferred methods such as SMS, PagerDuty, or webhooks, helping to target the correct personnel and avoid alert fatigue.\u003c/p\u003e\n"],["\u003cp\u003eConfiguration requires creating a \u003ccode\u003eConfigMap\u003c/code\u003e object with an \u003ccode\u003ealertmanager.yml\u003c/code\u003e file defining the custom notification channels, adhering to the Alertmanager specification.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eObservabilityPipeline\u003c/code\u003e custom resource must be edited to import the \u003ccode\u003eConfigMap\u003c/code\u003e's configuration to the \u003ccode\u003ealertmanagerConfig\u003c/code\u003e field, enabling the use of defined channels for alerts.\u003c/p\u003e\n"],["\u003cp\u003eBefore setting up notification channels, ensure alert rules are already created within your project namespace, and that you have the correct IAM permissions to manage \u003ccode\u003eObservabilityPipeline\u003c/code\u003e and \u003ccode\u003eConfigMap\u003c/code\u003e objects.\u003c/p\u003e\n"]]],[],null,["# Configure notification channels for alerts\n\nThis page outlines the process for configuring notification channels to receive\nalerts.\n\nNotification channels are the delivery mechanisms for your configured alerts.\nThe system notifies designated recipients through these channels when an event\ntriggers an alert. This process ensures that critical alerts reach the\nappropriate personnel through their preferred communication methods.\n\nIn Google Distributed Cloud (GDC) air-gapped environments, predefined notification channels\nlike Slack or email are unavailable. To receive alerts, you must configure at\nleast one custom notification channel. You edit `ObservabilityPipeline` custom\nresources in your project namespace to apply channel configurations.\n\nBy customizing notification channels, administrators can achieve the following:\n\n- **Target specific recipients**: Direct alerts to individuals, teams, or on-call rotations responsible for addressing issues.\n- **Use preferred communication methods**: Deliver alerts through channels like SMS, PagerDuty, webhooks, or custom integrations, catering to individual preferences and operational workflows.\n- **Prevent alert fatigue**: Reduce noise and ensure that alerts are received by those who need to take action.\n\nImplementing notification channels in GDC requires\nadministrators to define the channel configuration within the system. This\nprocess typically involves specifying parameters like:\n\n- **Channel type**: the type of channel being used.\n- **Destination**: the endpoint where the system should send notifications.\n- **Authentication**: any required credentials for accessing the destination.\n\nBy configuring notification channels, administrators can ensure that the\nmonitoring platform effectively delivers critical alerts, enabling prompt\nresponses to potential issues and maintaining the stability and performance of\nGDC environments.\n\nBefore you begin\n----------------\n\nTo get the permissions that you need to manage `ObservabilityPipeline` custom\nresources, ask your Organization IAM Admin or Project IAM Admin to grant you one\nof the associated `ObservabilityPipeline` roles.\n\nAdditionally, to get the permissions that you need to manage `ConfigMap` objects\nin your project namespace required to define configuration rules, ask your\nOrganization IAM Admin or Project IAM Admin to grant you the ConfigMap Creator\nrole.\n\nDepending on the level of access and permissions you need, you might obtain\ncreator, editor, or viewer roles for these resources in an organization or a\nproject. For more information, see [Prepare IAM permissions](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/obs-iam-permissions).\n\nConfigure notification channels\n-------------------------------\n\n| **Important:** Before configuring notification channels, ensure you have created alert rules in your project namespace. For more information, see [Create alert rules](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/create-alert-rules).\n\nConfigure notification channels for alerts in your project namespace:\n\n1. Define your custom configuration for notification channels in a YAML file\n named `alertmanager.yml`. You must follow the same syntax as the\n Alertmanager specification:\n\n \u003chttps://prometheus.io/docs/alerting/latest/configuration/\u003e.\n2. Create a `ConfigMap` object and include your custom configuration from the\n `alertmanager.yml` file in the `data` field.\n\n The following example shows how the `ConfigMap` object must look with the\n `alertmanager.yml` file: \n\n apiVersion: v1\n kind: ConfigMap\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eCONFIGMAP_NAME\u003c/span\u003e\u003c/var\u003e\n # The namespace must match your project namespace.\n namespace: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003ePROJECT_NAMESPACE\u003c/span\u003e\u003c/var\u003e\n data:\n # The file name must be alertmanager.yml\n alertmanager.yml: |\n # Define your notification channels.\n # Add the custom configuration in the following lines of this file.\n # Follow the same syntax as in https://prometheus.io/docs/alerting/latest/configuration\n\n [...]\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCONFIGMAP_NAME\u003c/var\u003e: the name of the `ConfigMap` definition file. You use this name later in the `ObservabilityPipeline` custom resource.\n - \u003cvar translate=\"no\"\u003ePROJECT_NAMESPACE\u003c/var\u003e: your project namespace.\n3. Apply the `ConfigMap` object to the Management API server within the\n same namespace as your configured alerts:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e apply -f \u003cvar translate=\"no\"\u003eCONFIGMAP_NAME\u003c/var\u003e.yaml\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e: the path to the kubeconfig file for the Management API server.\n - \u003cvar translate=\"no\"\u003eCONFIGMAP_NAME\u003c/var\u003e: the name of the `ConfigMap` definition file.\n4. Edit the `ObservabilityPipeline` custom resource specification to import\n your configuration to the `alertmanagerConfig` field:\n\n # Configure the observability pipeline.\n apiVersion: observability.gdc.goog/v1\n kind: ObservabilityPipeline\n metadata:\n # The namespace must match your project namespace.\n namespace: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003ePROJECT_NAMESPACE\u003c/span\u003e\u003c/var\u003e\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eOBSERVABILITY_PIPELINE_NAME\u003c/span\u003e\u003c/var\u003e\n spec:\n # Configure alerts.\n alerting:\n # The alerting configuration must be in the ConfigMap.\n # The value must match the ConfigMap name exactly.\n alertmanagerConfig: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eCONFIGMAP_NAME\u003c/span\u003e\u003c/var\u003e\n\n [...]\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_NAMESPACE\u003c/var\u003e: your project namespace.\n - \u003cvar translate=\"no\"\u003eOBSERVABILITY_PIPELINE_NAME\u003c/var\u003e: the name of the `ObservabilityPipeline` custom resource.\n - \u003cvar translate=\"no\"\u003eCONFIGMAP_NAME\u003c/var\u003e: the name you used for the `ConfigMap` definition file. The name must match exactly.\n\n | **Note:** In the `alerting` field of the `ObservabilityPipeline` custom resource, you can also define other configurations for the project namespace such as volumes (`volumes`) and volume mounts (`volumeMounts`). You reference volume mount names in the `alertmanager.yml` file.\n5. Save the file.\n\n6. Apply the changes of the `ObservabilityPipeline` custom resource to the\n Management API server within the same namespace as your configured alerts:\n\n kubectl --kubeconfig \u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e apply -f \u003cvar translate=\"no\"\u003eOBSERVABILITY_PIPELINE_NAME\u003c/var\u003e.yaml\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eKUBECONFIG_PATH\u003c/var\u003e: the path to the kubeconfig file for the Management API server.\n - \u003cvar translate=\"no\"\u003eOBSERVABILITY_PIPELINE_NAME\u003c/var\u003e: the name of the `ObservabilityPipeline` definition file."]]