Mengonfigurasi saluran notifikasi untuk pemberitahuan
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menguraikan proses untuk mengonfigurasi saluran notifikasi guna menerima
pemberitahuan.
Saluran notifikasi adalah mekanisme pengiriman untuk pemberitahuan yang dikonfigurasi.
Sistem akan memberi tahu penerima yang ditentukan melalui saluran ini saat peristiwa
memicu pemberitahuan. Proses ini memastikan bahwa pemberitahuan penting menjangkau personel yang tepat melalui metode komunikasi pilihan mereka.
Di lingkungan air gap Google Distributed Cloud (GDC), saluran notifikasi yang telah ditentukan sebelumnya seperti Slack atau email tidak tersedia. Untuk menerima pemberitahuan, Anda harus mengonfigurasi setidaknya satu saluran notifikasi kustom. Anda mengedit resource kustom ObservabilityPipeline
di namespace project untuk menerapkan konfigurasi channel.
Dengan menyesuaikan saluran notifikasi, administrator dapat melakukan hal berikut:
Menargetkan penerima tertentu: Mengarahkan pemberitahuan langsung ke individu, tim, atau rotasi petugas yang bertugas yang bertanggung jawab untuk mengatasi masalah.
Menggunakan metode komunikasi pilihan: Kirimkan pemberitahuan melalui saluran seperti SMS, PagerDuty, webhook, atau integrasi kustom, yang disesuaikan dengan preferensi individu dan alur kerja operasional.
Mencegah kelelahan merespons peringatan: Kurangi gangguan dan pastikan bahwa peringatan diterima oleh
orang yang perlu mengambil tindakan.
Penerapan saluran notifikasi di GDC mengharuskan administrator menentukan konfigurasi saluran dalam sistem. Proses
ini biasanya melibatkan penentuan parameter seperti:
Jenis saluran: jenis saluran yang digunakan.
Tujuan: endpoint tempat sistem harus mengirim notifikasi.
Autentikasi: kredensial yang diperlukan untuk mengakses tujuan.
Dengan mengonfigurasi saluran notifikasi, administrator dapat memastikan bahwa platform pemantauan secara efektif menyampaikan pemberitahuan penting, sehingga memungkinkan respons cepat terhadap potensi masalah dan menjaga stabilitas serta performa lingkungan GDC.
Sebelum memulai
Untuk mendapatkan izin yang Anda perlukan untuk mengelola ObservabilityPipelineresource kustom, minta Admin IAM Organisasi atau Admin IAM Project Anda untuk memberi Anda salah satu ObservabilityPipelineperan terkait.
Selain itu, untuk mendapatkan izin yang diperlukan guna mengelola objek ConfigMap di namespace project Anda yang diperlukan untuk menentukan aturan konfigurasi, minta Admin IAM Organisasi atau Admin IAM Project Anda untuk memberi Anda peran Pembuat ConfigMap.
Bergantung pada tingkat akses dan izin yang Anda perlukan, Anda mungkin mendapatkan
peran pembuat, editor, atau pelihat untuk resource ini dalam organisasi atau
project. Untuk mengetahui informasi selengkapnya, lihat Menyiapkan izin IAM.
Mengonfigurasi saluran notifikasi
Konfigurasi saluran notifikasi untuk pemberitahuan di namespace project Anda:
Tentukan konfigurasi kustom untuk saluran notifikasi dalam file YAML
bernama alertmanager.yml. Anda harus mengikuti sintaksis yang sama dengan spesifikasi Alertmanager:
Buat objek ConfigMap dan sertakan konfigurasi kustom Anda dari file
alertmanager.yml di kolom data.
Contoh berikut menunjukkan tampilan objek ConfigMap dengan 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[...]
Ganti kode berikut:
CONFIGMAP_NAME: nama file definisi ConfigMap. Anda akan menggunakan nama ini nanti di resource kustom ObservabilityPipeline.
PROJECT_NAMESPACE: namespace project Anda.
Terapkan objek ConfigMap ke server Management API dalam
namespace yang sama dengan pemberitahuan yang dikonfigurasi:
KUBECONFIG_PATH: jalur ke file kubeconfig
untuk server Management API.
CONFIGMAP_NAME: nama file definisi ConfigMap.
Edit spesifikasi resource kustom ObservabilityPipeline untuk mengimpor
konfigurasi Anda ke kolom 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[...]
Ganti kode berikut:
PROJECT_NAMESPACE: namespace project Anda.
OBSERVABILITY_PIPELINE_NAME: nama resource kustom
ObservabilityPipeline.
CONFIGMAP_NAME: nama yang Anda gunakan untuk file definisi ConfigMap. Nama harus sama persis.
Simpan file.
Terapkan perubahan resource kustom ObservabilityPipeline ke server Management API dalam namespace yang sama dengan pemberitahuan yang Anda konfigurasi:
[[["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-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."]]