From grafana-app-sdk
Configures Grafana OnCall/IRM for on-call rotations, alert routing with Jinja2 templates, escalation chains, Slack/mobile notifications, and integrations with Alertmanager, Grafana Alerting, PagerDuty, webhooks. Use for incident management workflows.
npx claudepluginhub grafana/skills --plugin grafana-app-sdkThis skill uses the workspace's default tool permissions.
> **OnCall docs**: https://grafana.com/docs/oncall/latest/
Manages Rootly alerts including routing rules, escalation policies, integrations with Datadog, PagerDuty, Grafana, and automatic alert-to-incident creation.
Manages Better Stack on-call schedules, rotations, calendars, escalation/notification policies, and queries current on-call responders for incident response.
Configures Grafana Alerting, IRM, and SLOs: Grafana-managed/Prometheus/Loki alert rules, notification policies, Slack/PagerDuty/email contacts, silences, on-call rotations, incident workflows, YAML/API provisioning.
Share bugs, ideas, or general feedback.
OnCall docs: https://grafana.com/docs/oncall/latest/ IRM docs: https://grafana.com/docs/grafana-cloud/alerting-and-irm/
Note: Grafana OnCall OSS is in maintenance mode (archived March 2026). Grafana Cloud users should use IRM, which unifies OnCall + Incident management. The concepts (escalation chains, schedules, integrations) are identical.
| Concept | Description |
|---|---|
| Integration | Entry point for alerts (HTTP POST URL); one per alert source |
| Route | Jinja2 condition that maps alerts to an escalation chain (first True wins) |
| Escalation Chain | Ordered notification steps: wait, notify schedule, notify team, etc. |
| Schedule | Calendar-based on-call rotation (web, iCal import, or Terraform) |
| Alert Group | Aggregated related alerts (grouped by Grouping ID template) |
| Notification Policy | Per-user delivery channels (Slack, mobile push, SMS, phone, email) |
Alert arrives at Integration URL
→ Routing template (Jinja2, first True wins) selects escalation chain
→ Grouping ID template consolidates related alerts
→ Escalation chain fires: wait → notify schedule → wait → notify team lead
→ Users: acknowledge / resolve / silence from Slack, mobile, or web
# alertmanager.yml
receivers:
- name: grafana-oncall
webhook_configs:
- url: https://your-oncall.grafana.net/integrations/v1/alertmanager/[id]/
send_resolved: true
max_alerts: 100 # prevent oversized payloads
route:
receiver: grafana-oncall
group_by: [alertname, cluster]
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
# Send alert via formatted webhook
curl -X POST https://your-oncall.grafana.net/integrations/v1/formatted_webhook/[id]/ \
-H "Content-Type: application/json" \
-d '{
"alert_uid": "incident-123",
"title": "Database CPU High",
"state": "alerting",
"message": "db-prod-01 CPU at 95% for 10 minutes",
"link_to_upstream_details": "https://grafana.example.com/d/abc123"
}'
# Resolve the alert
curl -X POST https://your-oncall.grafana.net/integrations/v1/formatted_webhook/[id]/ \
-H "Content-Type: application/json" \
-d '{"alert_uid": "incident-123", "state": "ok"}'
Recognized fields: alert_uid, title, state (alerting/ok), message, image_url, link_to_upstream_details
Routing templates return True or False to select the escalation chain. First matching route wins.
{# Route critical alerts to PagerDuty escalation #}
{{ payload.labels.severity == "critical" }}
{# Route by team label #}
{{ payload.labels.team == "platform" }}
{# Route database alerts to DBA on-call #}
{{ "database" in payload.labels.get("component", "") }}
{# Default catch-all (always True) #}
{{ true }}
Grouping ID (consolidates related alerts into one alert group):
{{ payload.labels.alertname }}-{{ payload.labels.instance }}
Advanced template functions:
{{ payload.field | b64decode }} # Decode base64
{{ "pattern" | regex_match(payload.message) }} # Regex matching
{{ datetimeformat_as_timezone(payload.startsAt, "UTC") }} # Timezone display
{{ payload.values | tojson_pretty }} # Pretty-print JSON
Configure at OnCall → Escalation Chains → Create:
Step 1: Notify users from schedule "Primary On-Call" (Important Notifications)
Step 2: Wait 5 minutes
Step 3: Notify users from schedule "Primary On-Call" (Default Notifications)
Step 4: Wait 10 minutes
Step 5: Notify whole team "Platform"
Step 6: Trigger webhook (PagerDuty, ticket system, etc.)
Step types:
Create rotations with shifts, overrides, and gaps directly in the OnCall/IRM UI.
# API: create schedule from iCal
curl -X POST https://your-oncall.grafana.net/api/v1/schedules/ \
-H "Authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Platform On-Call",
"ical_url_primary": "https://calendar.example.com/platform-oncall.ics",
"ical_url_overrides": "https://calendar.example.com/overrides.ics",
"slack": {
"channel_id": "C123456ABC",
"user_group_id": "S123456ABC"
}
}'
resource "grafana_oncall_schedule" "platform" {
name = "Platform On-Call"
type = "calendar"
shifts = [
grafana_oncall_on_call_shift.weekday.id,
grafana_oncall_on_call_shift.weekend.id,
]
}
resource "grafana_oncall_on_call_shift" "weekday" {
name = "Weekday"
type = "rolling_users"
start = "2024-01-01T09:00:00"
duration = 3600 * 8 # 8 hours
frequency = "weekly"
users_per_slot = 1
rolling_users = [["user-id-1"], ["user-id-2"], ["user-id-3"]]
}
Slack actions on alert messages: Acknowledge, Resolve, Silence, Add responders, Add note
Slash commands: /escalate, /oncall
Base URL: https://your-oncall.grafana.net/api/v1/
TOKEN=your-api-key
# List integrations
curl "$BASE/integrations/" -H "Authorization: $TOKEN"
# Create escalation chain
curl -X POST "$BASE/escalation_chains/" \
-H "Authorization: $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Platform Critical", "team_id": "team-id"}'
# List schedules
curl "$BASE/schedules/" -H "Authorization: $TOKEN"
# List alert groups
curl "$BASE/alert_groups/?page=1&perpage=25" -H "Authorization: $TOKEN"
# Who is on-call right now
curl "$BASE/schedules/{schedule_id}/next_shifts/" -H "Authorization: $TOKEN"
Rate limits: 300 alerts/integration per 5 min, 500 alerts/org per 5 min, 300 API requests/key per 5 min
When an alert group becomes an incident:
/incident declare| Role | Access |
|---|---|
oncall-admin | Full access to all OnCall resources |
oncall-editor | Create/edit integrations, schedules, escalation chains |
oncall-viewer | Read-only |
oncall-notifications-receiver | Receive alerts; cannot modify configuration |
send_resolved: true in Alertmanager for auto-resolutionmax_alerts: 100 in Alertmanager webhook config