Sending Alert emails through Grafana UI using prometheus-alertmanager

1/28/2019

I am trying to test sending email alerts through the grafana UI using the prometheus-alertmanager notification channel. I have added the stmp details in the config file of the alertmanager. When I try to test it says that the email has been sent but nothing really happens. When I add the same email configuration to the grafana.ini file and add the email notification channel in the UI, I am able to send the test notification. I am using the following helm chart to install it - > https://github.com/helm/charts/tree/master/stable/prometheus-operator Here is the alertmanager config file.

  config:
    global:
      resolve_timeout: 5m
      smtp_smarthost: 'email-smtp.us-east-1.amazonaws.com:587'
      smtp_from: 'redacted'
      smtp_auth_username: 'redacted'
      smtp_auth_password: 'redacted'

route:
  group_by: ['job']
  group_wait: 30s
  group_interval: 5m
  repeat_interval: 12h
  receiver: 'null'
  routes:
  - match:
      alertname: DeadMansSwitch
    receiver: 'null'
receivers:
- name: 'null'

This is the grafana log.

t=2019-01-28T16:57:38+0000 lvl=info msg="Request Completed" logger=context userId=0 orgId=0 uname= method=GET path=/ status=302 remote_addr=127.0.0.1 time_ms=0 size=29 referer=
t=2019-01-28T16:59:07+0000 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/alerts/test status=422 remote_addr=127.0.0.1 time_ms=36 size=82 referer="http://localhost:8000/d/6581e46e4e5c7ba40a07646395ef7b23/k8s-compute-resources-pod?refresh=10s&panelId=0&fullscreen&edit&orgId=1&tab=alert"
t=2019-01-28T16:59:56+0000 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=POST path=/api/alerts/test status=422 remote_addr=127.0.0.1 time_ms=37 size=82 referer="http://localhost:8000/d/a6e7d1362e1ddbb79db21d5bb40d7137/k8s-use-method-cluster?refresh=10s&panelId=0&fullscreen&edit&orgId=1&tab=alert"
t=2019-01-28T17:01:30+0000 lvl=info msg="Sending Alertmanager alert" logger=alerting.notifier.prometheus-alertmanager ruleId=0 notification=Alert
t=2019-01-28T17:02:30+0000 lvl=info msg="Sending Alertmanager alert" logger=alerting.notifier.prometheus-alertmanager ruleId=0 notification=Alert
t=2019-01-28T17:06:40+0000 lvl=info msg="Sending Alertmanager alert" logger=alerting.notifier.prometheus-alertmanager ruleId=0 notification=Alert

What am I doing wrong here ?

-- Anshul Tripathi
grafana
kubernetes
kubernetes-helm
prometheus
prometheus-alertmanager

1 Answer

2/7/2019

The log output from Prometheus AlertManager is missing. If the alert manager config is full, then you miss 2 more lines after

  • name: 'null'
email_configs:
  - to: 'myemail@test.com'
-- Oleg Mayko
Source: StackOverflow