Configure a Simple Mail Transfer Protocol (SMTP) notification channel for Prometheus alerts
Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to set up and configure a Simple Mail Transfer Protocol (SMTP) notification channel for Prometheus alerts. If you choose not to set up this notification channel, you can still view alerts at infra-obs or platform-obs.
Work through the following steps to configure Slack or email notification channels:
To create a custom alert notification channel, host the SMTP server in your network and have the SMTP configuration details (IP, username, password, receiver email) ready to create the alertmanager config. You can validate the correctness of the SMTP host IP by pinging it from bm03.
Create a file cm.yml with the following content:
The smtp_smarthost must have the IP address of the SMTP server hosted by the customer.
apiVersion:v1kind:ConfigMapmetadata:# The name must match the ConfigMap name specified in the ObservabilityPipeline custom resource.name:appl-alert-notification# The namespace must match the project namespacenamespace:PROJECT_NAMESPACEdata:# The file name must be alertmanager.ymlalertmanager.yml:|global:smtp_smarthost: SMTP HOST IP ADDRESSsmtp_from: FROM_EMAIL_ADDRESS# Give empty string for unsecured smtp server in username and password and false in smtp_require_tls.smtp_auth_username: USERNAMEsmtp_auth_password: PASSWORDsmtp_require_tls: trueroute:group_by: ['alertname', 'cluster', 'service']group_wait: 30sgroup_interval: 5mrepeat_interval: 3hreceiver: team-X-mailsreceivers:- name: 'team-X-mails'email_configs:- to: **RECIEVER_EMAIL_ID**
Update the required fields with the correct content.
Run kubectl apply -f cm.yaml.
Create an ObservabilityPipeline custom resource with the following:
# Configure observability pipelineapiVersion:observability.gdc.goog/v1kind:ObservabilityPipelinemetadata:# Choose namespace that matches the project's namespacenamespace:PROJECT_NAMESPACEname:observability-configspec:# Configure Alertmanageralerting:# Permission: PA and AO# The alerts configuration must be in the key "alertmanager.yml" of the configMapalertmanagerConfig:CUSTOMIZED_CONFIGMAP_NAME...
Replace the following:
PROJECT_NAMESPACE: The namespace of your project.
CUSTOMIZED_CONFIGMAP_NAME: The name you used for your configuration file in the ConfigMap object must match exactly with the name of the ConfigMap object. For example in step 2, if you used appl-alert-notification as the ConfigMap name, then use the same name for your configuration file in the ObservabilityPipeline object.
Update the namespace to the value used in the previous step.
Run kubectl apply -f ob.yaml.
All the alerts visible on the Grafana dashboard of the GDC trigger an email if they are in a firing state. Launch Grafana for the namespace which you used in the previous steps and check for alerts in a firing state. The alerts come to your email.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Configure a Simple Mail Transfer Protocol (SMTP) notification channel for Prometheus alerts\n\nThis page describes how to set up and configure a Simple Mail Transfer Protocol (SMTP) notification channel for Prometheus alerts. If you choose not to set up this notification channel, you can still view alerts at infra-obs or platform-obs.\n\nWork through the following steps to configure Slack or email notification channels:\n\n1. To create a custom alert notification channel, host the SMTP server in your network and have the SMTP configuration details (IP, username, password, receiver email) ready to create the alertmanager config. You can validate the correctness of the SMTP host IP by pinging it from [bm03](/distributed-cloud/hosted/docs/latest/appliance/admin/setup#ssh-bm03).\n\n | **Note:** Perform the following steps for both of the namespaces (`infra-obs` and `platform-obs`) and any additional namespaces created by the user.\n2. Create a file `cm.yml` with the following content:\n\n The `smtp_smarthost` must have the IP address of the SMTP server hosted by the customer. \n\n apiVersion: v1\n kind: ConfigMap\n metadata:\n # The name must match the ConfigMap name specified in the ObservabilityPipeline custom resource.\n name: appl-alert-notification\n # The namespace must match the 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 global:\n smtp_smarthost: \u003cvar translate=\"no\"\u003eSMTP HOST IP ADDRESS\u003c/var\u003e\n smtp_from: \u003cvar translate=\"no\"\u003eFROM_EMAIL_ADDRESS\u003c/var\u003e\n # Give empty string for unsecured smtp server in username and password and false in smtp_require_tls.\n smtp_auth_username: \u003cvar translate=\"no\"\u003eUSERNAME\u003c/var\u003e\n smtp_auth_password: \u003cvar translate=\"no\"\u003ePASSWORD\u003c/var\u003e\n smtp_require_tls: true\n route:\n group_by: ['alertname', 'cluster', 'service']\n group_wait: 30s\n group_interval: 5m\n repeat_interval: 3h\n receiver: team-X-mails\n receivers:\n - name: 'team-X-mails'\n email_configs:\n - to: \u003cvar translate=\"no\"\u003e**RECIEVER_EMAIL_ID**\u003c/var\u003e\n\n3. Update the required fields with the correct content.\n\n4. Run `kubectl apply -f cm.yaml`.\n\n5. Create an `ObservabilityPipeline` custom resource with the following:\n\n # Configure observability pipeline\n apiVersion: observability.gdc.goog/v1\n kind: ObservabilityPipeline\n metadata:\n # Choose namespace that matches the project's 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: observability-config\n spec:\n # Configure Alertmanager\n alerting:\n # Permission: PA and AO\n # The alerts configuration must be in the key \"alertmanager.yml\" of the configMap\n alertmanagerConfig: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eCUSTOMIZED_CONFIGMAP_NAME\u003c/span\u003e\u003c/var\u003e\n ...\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_NAMESPACE\u003c/var\u003e: The namespace of your project.\n - \u003cvar translate=\"no\"\u003eCUSTOMIZED_CONFIGMAP_NAME\u003c/var\u003e: The name you used for your configuration file in the `ConfigMap` object must match exactly with the name of the `ConfigMap` object. For example in step 2, if you used `appl-alert-notification` as the `ConfigMap` name, then use the same name for your configuration file in the `ObservabilityPipeline` object.\n\n | **Note:** You must create a CR for both the namespaces, `infra-obs` as well as `platform-obs`. There must be a separate configmap and `ObservabilityPipeline` for each namespace.\n6. Update the namespace to the value used in the previous step.\n\n7. Run `kubectl apply -f ob.yaml.`\n\n8. All the alerts visible on the Grafana dashboard of the GDC trigger an email if they are in a `firing` state. Launch Grafana for the namespace which you used in the previous steps and check for alerts in a `firing` state. The alerts come to your email.\n\n| **Note:** Refer to [Configure notification channels for alerts](/distributed-cloud/hosted/docs/latest/appliance/admin/configure-notification-channels) for more information on configuring notification channels for the alerts you set up."]]