Skip to content

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-sh

TIP

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

FieldTypeDescription
receiverstringAlertmanager receiver name.
statusstringGroup status: firing or resolved.
groupKeystringIdentifies this alert group.
groupLabelsobjectLabels used to group these alerts.
commonLabelsobjectLabels shared by all alerts in the group.
commonAnnotationsobjectAnnotations shared by all alerts.
alertsarrayList of individual alert instances.

Per-alert

FieldTypeDescription
statusstringfiring or resolved.
labelsobjectAlert labels. Include alertname and severity.
annotationsobjectInclude summary (used as incident title) and description.
fingerprintstringUnique fingerprint for deduplication.
startsAtstring (RFC3339)When the alert started firing.
endsAtstring (RFC3339)When the alert ended (if known).
generatorURLstringLink to the Prometheus expression graph.

Field mapping

Navi.sh incident fieldSource
Titleannotations.summarylabels.alertname"Prometheus Alert"
Descriptionannotations.description → auto-generated
Severitylabels.severity
Dedup keyfingerprintlabels.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.

Built by the Navi.sh team.