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.

POST/v1/events/prometheus/{token}

Setup in Alertmanager ​

Your integration URL — including the token — is available in the Navi.sh dashboard → Integrations → Prometheus.

Add a webhook_config receiver to your Alertmanager configuration:

yaml
# alertmanager.yml
receivers:
  - name: navi-sh
    webhook_configs:
      - url: "https://api.navi.sh/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).

Field mapping ​

Navi.sh incident fieldSource
Titleannotations.summary → labels.alertname → "Prometheus Alert"
Descriptionannotations.description → auto-generated
Severitylabels.severity
Dedup keyfingerprint → labels.alertname

POST /v1/events/prometheus/{token}

Accepts Prometheus Alertmanager webhook payloads. Add this URL as a webhook_config receiver in your Alertmanager configuration.

Processes each alert in the batch individually. Alerts with status: "resolved" auto-resolve incidents via fingerprint matching. Deduplicates by fingerprint or alertname label.

The token is generated in your navi.sh workspace under Integrations.

Payload schema ​

FieldTypeDescription
alertsarray of PrometheusAlertList of individual alert instances.
commonAnnotationsobject<string, string>Annotations common to all alerts in the group.
commonLabelsobject<string, string>Labels common to all alerts in the group.
groupKeystringKey identifying this alert group. (example: {}/{}:{alertname="HighCPU"})
groupLabelsobject<string, string>Labels used to group these alerts.
receiverstringAlertmanager receiver name. (example: navi-sh)
statusstring (firing, resolved)Overall group status. (example: firing)

alerts fields:

FieldTypeDescription
annotationsobject<string, string>Alert annotations. Include summary (used as title) and description.
endsAtstringRFC3339 timestamp when the alert ended. (example: 0001-01-01T00:00:00Z)
fingerprintstringUnique fingerprint used for deduplication. (example: abc123def456)
generatorURLstringLink to the Prometheus expression graph. (example: http://prometheus:9090/graph?g0.expr=up%3D%3D0)
labelsobject<string, string>Alert labels. Include alertname and severity.
startsAtstringRFC3339 timestamp when the alert started firing. (example: 2024-01-15T10:30:00Z)
statusstring (firing, resolved)Alert status for this individual instance. (example: firing)

Examples ​

Alertmanager Firing ​

json
{
  "alerts": [
    {
      "annotations": {
        "description": "CPU above 80% for 5 minutes",
        "summary": "High CPU"
      },
      "fingerprint": "abc123def456",
      "labels": {
        "alertname": "HighCPU",
        "instance": "web-01:9090",
        "severity": "critical"
      },
      "startsAt": "2024-01-15T10:30:00Z",
      "status": "firing"
    }
  ],
  "commonLabels": {
    "alertname": "HighCPU",
    "severity": "critical"
  },
  "groupLabels": {
    "alertname": "HighCPU"
  },
  "receiver": "navi-sh",
  "status": "firing"
}

Response codes ​

  • 202 — Accepted — processing is asynchronous
  • 400 — Invalid request body (malformed JSON or wrong content type)
  • 401 — Invalid service token
  • 402 — Workspace suspended (trial ended or plan lapsed): new alerts are rejected; resolutions are still accepted
  • 500 — Unexpected server error

Built by the Navi.sh team.