bitnamiprometheus-alertmanagerprometheus-operator

Bitnami Prometheus Operator : email alerts not triggered


I'm trying to setup the easiest email alerting using Bitnami Prometheus Operator.
Alerts seem to be triggered but no email is sent.

apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: prometheus-example-rules
  namespace: prometheus
spec:
  groups:
    - name: ./example.rules
      rules:
        - alert: ExampleAlert
          expr: vector(1)

Alertmanager configuration :

apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  name: config-example
  namespace: prometheus
spec:
  route:
    receiver: 'gmail-notifications'
  receivers:
    - name: 'gmail-notifications'
      emailConfigs:
        - to: xxx@gmail.com
          from: xxx@gmail.com
          smarthost: smtp.gmail.com:587
          authUsername: xxx@gmail.com
          authIdentity: xxx@gmail.com
          authPassword:
            name: alertmanager-email-secret
            key: authPassword
          sendResolved: true

Grafana Alertmanager overview Alerts are visible in Prometheus and Grafana, but no email is sent : Alertmanager UI Prometheus UI


Solution

  • When using the AlertmanagerConfig CRD to create alerting rules, it must be declared with the .alertmanager.configSelector Helm chart value.

    See : https://github.com/bitnami/charts/issues/17521#issuecomment-1635582380