# PagerDuty integration with Prometheus

1. Öncelikle [*www.pagerduty.com*](https://www.pagerduty.com/) *adresine gidip, bir hesap oluşturuyoruz.*

<figure><img src="/files/VknZfJPq8XA9QNsktYwi" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/z2dg5X6MdqVxZlRoSDYm" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/WjYiuS7jzxYV6iXyhlUL" alt=""><figcaption></figcaption></figure>

4. 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.

```yaml
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.

```yaml
- 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.

<figure><img src="/files/Gb6GAM4vANqPNihq2pwx" alt=""><figcaption></figcaption></figure>

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://note.onurbolatoglu.com/prometheus/pagerduty-integration-with-prometheus.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
