Skip to main content
Cloud DevOps Solutions
Get a quote Talk to an engineer

Monitoring & Observability

Alert Routing to PagerDuty, OpsGenie or Slack from Prometheus

We connect Alertmanager to PagerDuty, OpsGenie or Slack so critical alerts page the on-call engineer and everything else lands in a team channel. We set integration keys safely, shape the notification content, and align escalation policies with how your team actually works.

Key takeaways

  • Paging tools wake people up; Slack informs them. Mixing the two up is the most common design error.
  • One service integration per team or service keeps ownership and escalation clear.
  • Notifications include summary, impact, dashboard and runbook links, so no one has to hunt.
  • Integration keys live in a secret store, never in Git.
  • Resolved notifications and acknowledgement behaviour are configured on purpose.

Routing is where alerts become people

A perfectly tuned alert is worthless if it reaches nobody, or reaches everybody. We have seen companies where critical alerts landed in a Slack channel muted by half the team, and others where every warning triggered a phone call. Both are routing problems, not rule problems.

This page covers the last mile of the monitoring and observability service: connecting Alertmanager to the tools your people use. For reading on the underlying component, see the Alertmanager glossary entry.

What good looks like

  • Right channel for the urgency. Pages for critical, chat for warnings, tickets for the slow burn.
  • Clear ownership. Each service has one team that is paged, and an escalation path if they do not respond.
  • Rich notifications. A responder can see what broke, how bad it is, and where to look, without opening a laptop first if possible.
  • Closed loop. Resolved alerts close the incident or message automatically.
  • No secrets in Git.
  • Tested end to end before it is needed.

Choosing the destination

DestinationBest forLimits
PagerDutyPaging, escalation, schedules, incident workflowLicence cost per user
OpsgenieSame, with tight Atlassian integrationConfirm current product roadmap before committing
SlackWarnings, awareness, team discussionNo guaranteed delivery to a person, easy to mute
Microsoft TeamsSame role as Slack for Microsoft shopsFormatting differs
Grafana OnCallOpen-source style scheduling inside the Grafana stackSee our on-call page

We do not push a vendor. If your team is two people and a phone number, a simple chat and SMS arrangement may be enough, and we will tell you if paying for a platform is premature.

How it works in practice

PagerDuty receiver

receivers:
  - name: pagerduty-platform
    pagerduty_configs:
      - routing_key_file: /etc/alertmanager/secrets/pagerduty-platform
        send_resolved: true
        severity: '{{ if eq .CommonLabels.severity "critical" }}critical{{ else }}warning{{ end }}'
        description: '{{ .CommonAnnotations.summary }}'
        details:
          cluster: '{{ .CommonLabels.cluster }}'
          service: '{{ .CommonLabels.service }}'
          runbook: '{{ .CommonAnnotations.runbook_url }}'
          dashboard: '{{ .CommonAnnotations.dashboard_url }}'
        links:
          - href: '{{ .CommonAnnotations.runbook_url }}'
            text: Runbook

The routing_key_file option reads the integration key from a mounted file, so the key never appears in your configuration repository.

Opsgenie receiver

  - name: opsgenie-backend
    opsgenie_configs:
      - api_key_file: /etc/alertmanager/secrets/opsgenie-backend
        message: '{{ .CommonAnnotations.summary }}'
        priority: '{{ if eq .CommonLabels.severity "critical" }}P1{{ else }}P3{{ end }}'
        responders:
          - name: backend-team
            type: team
        send_resolved: true

Opsgenie priorities are P1 to P5 in its own system; they are unrelated to any incident severity numbering inside your company, so we map them explicitly.

Slack receiver

  - name: team-slack
    slack_configs:
      - api_url_file: /etc/alertmanager/secrets/slack-webhook
        channel: "#alerts-platform"
        send_resolved: true
        title: '[{{ .Status | toUpper }}] {{ .CommonLabels.alertname }}'
        text: |-
          {{ range .Alerts }}
          *{{ .Annotations.summary }}*
          Impact: {{ .Annotations.impact }}
          <{{ .Annotations.runbook_url }}|Runbook>  <{{ .Annotations.dashboard_url }}|Dashboard>
          {{ end }}

Slack messages are for people to read, so we keep them short and link out. A wall of labels teaches the channel to be ignored.

Secrets handling

On Kubernetes we sync integration keys from your cloud secret manager using External Secrets Operator, or store them encrypted with Sealed Secrets, and mount them into the Alertmanager pod. Rotation is a secret update plus a config reload. The general pattern is the same one described for ConfigMaps and Secrets.

Escalation design

Routing to a tool is half the job. The escalation policy inside it matters just as much. A typical policy pages the primary on-call, waits a defined interval for acknowledgement, then pages the secondary, then an engineering manager. We agree those intervals with you, enter them, and test a real escalation by letting one test page go unacknowledged.

Decisions and trade-offs

One integration per team or per service. Per service gives sharp ownership but many objects to manage. Per team is simpler. We usually choose per team with a service label for context.

Resolved messages. Auto-resolve is convenient but can hide flapping alerts. We enable it for paging tools so incidents close, and keep Slack resolved messages short.

Follow-the-sun and holidays. These are properties of schedules, not of Alertmanager. They need schedule hygiene in the paging tool, or an outsourced rotation. Our Managed DevOps service covers that where you want it.

Failure modes

  • Wrong integration key for the wrong environment, so staging pages production on-call.
  • Webhook rate limits from alert storms. Grouping prevents most of this.
  • Muted channel. Review channel membership and notification settings.
  • Unreachable endpoint. Egress rules blocking Alertmanager from the vendor. We check network policy and proxy settings.
  • Test never run. The first real alert should not be the first test.

Testing routes safely

Routing changes are risky because a mistake produces silence rather than an error. We test every change in two ways. First, amtool is run in your pipeline to confirm that representative label sets reach the intended receiver. Second, a non-production Alertmanager sends real test notifications to a sandbox service and a test Slack channel, so formatting, links and escalation can be checked without waking anyone.

We also keep a short list of canonical test alerts, one per severity and team, that can be fired on demand. After any change to the tree, those alerts are replayed and the results compared with what was expected. This habit turns routing from something people are afraid to touch into something that can be improved routinely, which matters because your teams, services and ownership will keep changing.

Planned changes

When a team is added, renamed or merged, update the labels on its alerts and the route together in one pull request. Changing only one half is how pages end up in the default channel.

Delivery and handover

You receive working receivers for every route, templates, a secrets approach, a diagram of who is reached for each severity, and the results of an end-to-end test for each path. We keep the documentation next to the Alertmanager configuration so changes stay in sync.

How to tell it is working

Fire a synthetic critical alert monthly and time how long it takes someone to acknowledge. Review missed or duplicate pages, channels with unread alert backlog, and the percentage of pages with a runbook link. To get routing sorted out, contact us.

References

How we deliver it

  1. 01

    Map services to owners

    We list services, owning teams and who should be reached at what severity, including out-of-hours expectations.

  2. 02

    Create integrations

    A PagerDuty service, OpsGenie team or Slack channel is set up for each owner with an Events API or webhook key.

  3. 03

    Wire Alertmanager receivers

    Receivers are written with custom payloads that carry labels, links and context.

  4. 04

    Align escalation

    Escalation policies, schedules and timeouts are agreed and entered in the paging tool.

  5. 05

    Secure the keys

    Secrets are stored in your secret manager and mounted into Alertmanager.

  6. 06

    Run end-to-end tests

    Test alerts are fired through every route and acknowledged and resolved to confirm behaviour.

Tools and technologies

AlertmanagerPagerDutyOpsgenieSlackMicrosoft TeamsGrafana OnCallExternal Secrets OperatorSealed SecretsamtoolPrometheus

Frequently asked questions

How do I send Prometheus alerts to PagerDuty?
Create a service in PagerDuty with a Prometheus or Events API v2 integration, copy the routing key, then add a pagerduty_configs receiver in Alertmanager that uses it. Route critical alerts to that receiver. Include a description, severity and links in the payload so the responder has context in the page itself.
Should alerts go to Slack or to a paging tool?
Use a paging tool for anything that needs a person to act now, because it provides escalation, acknowledgement and phone or push delivery. Use Slack for warnings and awareness. Slack alone is easy to miss at night and has no built-in escalation if nobody reacts.
PagerDuty versus OpsGenie: which is better?
Both handle schedules, escalation and multi-channel delivery well. The better choice is usually the one your team already uses, or the one that fits your wider tooling, for example Atlassian users often prefer Opsgenie. Check current product and pricing status before committing, as vendors change plans.
How do I keep API keys out of Git?
Store integration keys in a secret manager and mount them into Alertmanager as files, using the *_file options such as routing_key_file or api_url_file. On Kubernetes, tools like External Secrets Operator or Sealed Secrets sync them. The Alertmanager config then references paths rather than values.
Why do I get duplicate pages?
Common causes are several Alertmanager replicas not clustered together, several Prometheus servers sending the same alert to different Alertmanagers, or the same rule defined in both Prometheus and Grafana alerting. Clustering Alertmanager and keeping one source of truth per alert removes the duplicates.

Talk to an engineer about prometheus alerts to pagerduty

Book a free 30-minute call. We review your current setup and tell you honestly whether and how we can help.

Written by Saddique Khan, DevOps / SRE / Cloud Consultant Engineer. Last updated 2026-10-08.