🤯PagerDuty integration with Prometheus

  1. Öncelikle www.pagerduty.com adresine gidip, bir hesap oluşturuyoruz.

  1. Ardından service oluşturma ekranına gelip, "New Service" butonuna tıklıyoruz.

  1. Name kısmına bir isim verip, "integrations" kısmına kadar ilerliyoruz.

  1. integrations kısmında "prometheus" seçip, "create service" butonuna tıklıyoruz.

Böylelikle servisimiz oluşturuldu. En son gelen ekranda lazım olacak 2 kısım mevcut,

  1. Integration Key

  2. Integration URL

Bu bilgileri bir yere kaydediyoruz. Ardından alertmanager yapılandırma dosyamıza giriyoruz.

global:
  smtp_from: 'alert@example.com'
  smtp_smarthost: mail.example.com:587
  smtp_auth_username: 'alert@example.com'
  smtp_auth_identity: 'alert@example.com'
  smtp_auth_password: 'JhwhWAbVcWG3b734Zjq6U'
  resolve_timeout: 1m
  pagerduty_url: 'https://events.eu.pagerduty.com/generic/2010-04-15/create_event.json'

Service oluştururken aldığımız Integration URL bilgisini, alertmanager yapılandırma dosyası içerisinde bulunan global argümanının altına "pagerduty_url": parametresine yapıştırıyoruz.

- name: linux-team-manager
  pagerduty_configs:
  - service_key: 'fe5512dsadasd220bfbsss32236d'
    send_resolved: true

Ardından, alarmlarını pagerduty'e göndereceğimiz grubu yukarıdaki şekilde tanımlıyoruz. "service_key" kısmını, yukarıda kopyaladığımız Integration Key bilgisinden yapıştırıyoruz.

Görüldüğü üzere, alarmlar pagerduty hesabımıza ulaşıyor.

Last updated