prometheus / alertmanager

Prometheus Alertmanager
https://prometheus.io
Apache License 2.0
6.6k stars 2.15k forks source link

Alertmanagerconfig with Azure communication service #3756

Open sureshkachwa opened 7 months ago

sureshkachwa commented 7 months ago

I am trying to set Alertmanagerconfig with "Azure Communication Service" and through this service, you get the endpoint, key, and a connection string (combination of endpoint and key). Below is the alertmanagerconfig manifest, does this need to be modified?

apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
  name: prometheus-alertmanager-config
  namespace: prometheus
spec:
  route:
    receiver: alert-email-pagerduty-config
    groupBy: ['alertname', 'priority','severity']
    groupWait: 30s
    groupInterval: 5m
    repeatInterval: 15m
    continue: true
  receivers:
    - name: alert-email-azure-config
     emailConfigs:
    - to: {{.to_email}}
      sendResolved: true
      from: {{.az_from_email}}         ##sender user address created in azure email communication service
      smarthost: {{.az_smarthost}}  ## endpoint exposed by azure communication service
      authUsername: {{.az_mail_username}}  ##sender user address created in azure email communication service
      authPassword:
        name: 'az_alert-smtp-password'
        key: 'password'
      requireTLS: true

      ---
apiVersion: v1
kind: Secret
type: Opaque
metadata:
  name: az_alert-smtp-password
  namespace: prometheus
stringData:
  password: {{.az_mail_password}}   ##key exposed by azure communication service
Ron-NPX commented 3 months ago

I'm looking into if it's possible to set up alertmanager with Azure Communication Services. Did the above solution work for you?

ruimartinsptl commented 2 months ago

I'm also curious about this topic...

sureshkachwa commented 2 months ago

I'm looking into if it's possible to set up alertmanager with Azure Communication Services. Did the above solution work for you?

I haven't tested it yet, will surely let you know

jkroepke commented 2 months ago

We are using that in production, using the SMTP interface at Azure Communication Services. It just worked.