STK-69Default Paid
Use PagerDuty for paging and keep schedules as code
Page people through PagerDuty, and keep its schedules, escalation policies and services in OpenTofu files in your repository.
Review by
2027-04-30
How to do it
Paging must work when your own servers are down, so a managed service fits here. No open source pager passes the tests today. The open source Grafana OnCall is archived, and GoAlert has never had a stable 1.0 release. A self-hosted pager also needs a paid SMS and voice provider. PagerDuty has run since 2009, so judge it by the exit test. Its REST API lists every schedule, escalation policy, service and incident. Its official Terraform provider also runs under OpenTofu, as Use OpenTofu for infrastructure as code recommends. It keeps the whole setup as code you can move to another tool. Route alerts to it from Alertmanager or Grafana. How to run the rota is in Share on-call fairly. Choose something else when your incident tool already includes on-call, such as Jira Service Management, and test its export first.
Examples
Terraform example
resource "pagerduty_schedule" "primary" {
name = "Orders primary"
time_zone = "Europe/Stockholm"
layer {
name = "Weekly"
start = "2026-11-02T09:00:00+01:00"
rotation_virtual_start = "2026-11-02T09:00:00+01:00"
rotation_turn_length_seconds = 604800
users = [pagerduty_user.ana.id, pagerduty_user.ben.id]
}
}
YAML example
# alertmanager.yml
receivers:
- name: on-call
pagerduty_configs:
- routing_key_file: /etc/alertmanager/pagerduty-key
route:
receiver: on-call
How to check
tofu plan shows 0 changes against the live account. A test alert reaches the person on call by phone within 5 minutes.
Sources
Related rules
- STK-54 Use OpenTofu for infrastructure as code in Software choices
- OPS-21 Share on-call fairly in Operations and observability
- STK-71 Avoid paging tools that are shutting down in Software choices
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/stack/operations-tools/pagerduty">Agent Wranglers software choices playbook</a>. In code you write, add a comment next to it with the same link.