Prometheus Alertmanager
Navi.sh acts as a native Alertmanager webhook receiver. Each alert in the batch is processed individually, and resolved alerts auto-close their corresponding incidents.
Endpoint: POST /api/v1/events/prometheus/{token}
Setup in Alertmanager
Add a webhook_config receiver to your Alertmanager configuration:
yaml
# alertmanager.yml
receivers:
- name: navi-sh
webhook_configs:
- url: "https://api.navi.sh/api/v1/events/prometheus/<token>"
send_resolved: true # required for auto-resolve
route:
receiver: navi-sh
# Or scope to specific alerts:
routes:
- match:
severity: critical
receiver: navi-shTIP
Set send_resolved: true so Navi.sh can automatically close incidents when alerts recover.
Auto-resolve
Each alert in the alerts[] array is processed independently. An alert with "status": "resolved" closes the incident matched by the alert's fingerprint (or alertname label as a fallback).
Payload schema
Top-level
| Field | Type | Description |
|---|---|---|
receiver | string | Alertmanager receiver name. |
status | string | Group status: firing or resolved. |
groupKey | string | Identifies this alert group. |
groupLabels | object | Labels used to group these alerts. |
commonLabels | object | Labels shared by all alerts in the group. |
commonAnnotations | object | Annotations shared by all alerts. |
alerts | array | List of individual alert instances. |
Per-alert
| Field | Type | Description |
|---|---|---|
status | string | firing or resolved. |
labels | object | Alert labels. Include alertname and severity. |
annotations | object | Include summary (used as incident title) and description. |
fingerprint | string | Unique fingerprint for deduplication. |
startsAt | string (RFC3339) | When the alert started firing. |
endsAt | string (RFC3339) | When the alert ended (if known). |
generatorURL | string | Link to the Prometheus expression graph. |
Field mapping
| Navi.sh incident field | Source |
|---|---|
| Title | annotations.summary → labels.alertname → "Prometheus Alert" |
| Description | annotations.description → auto-generated |
| Severity | labels.severity |
| Dedup key | fingerprint → labels.alertname |
Example payload
json
{
"receiver": "navi-sh",
"status": "firing",
"groupKey": "{}:{alertname=\"HighCPU\"}",
"groupLabels": { "alertname": "HighCPU" },
"commonLabels": { "alertname": "HighCPU", "severity": "critical" },
"commonAnnotations": { "summary": "High CPU usage detected" },
"alerts": [
{
"status": "firing",
"labels": {
"alertname": "HighCPU",
"severity": "critical",
"instance": "web-01:9090"
},
"annotations": {
"summary": "High CPU usage detected",
"description": "CPU usage is above 80% for the last 5 minutes"
},
"fingerprint": "abc123def456",
"startsAt": "2024-01-15T10:30:00Z",
"endsAt": "0001-01-01T00:00:00Z",
"generatorURL": "http://prometheus:9090/graph?g0.expr=..."
}
]
}Response
202 Accepted — all alerts in the batch were queued for processing.