Skip to content

Grafana

Navi.sh supports both the modern Grafana unified alerting format and the legacy single-alert format. Alerts with status: "resolved" automatically close the corresponding incident.

Endpoint: POST /api/v1/events/grafana/{token}


Setup in Grafana

  1. In Grafana, go to Alerting → Contact points.
  2. Click Add contact point.
  3. Set Integration to Webhook.
  4. Set the URL to your integration URL:
    https://api.navi.sh/api/v1/events/grafana/<token>
  5. Leave HTTP Method as POST and Content-Type as application/json.
  6. Click Test to send a test payload, then Save.
  7. Assign the contact point to your Notification policies or individual alert rules.

Auto-resolve

Each alert in the alerts[] array is processed independently. Grafana sets status: "resolved" when an alert recovers — Navi.sh matches it to the open incident by fingerprint (or labels.alertname as fallback).

Make sure the Send resolved notifications option is enabled in your contact point settings.


Payload schema

Unified alerting format

FieldTypeDescription
receiverstringContact point name.
statusstringOverall status: firing or resolved.
titlestringTop-level title (used if alerts[] is empty).
messagestringTop-level message (used if alerts[] is empty).
externalURLstringGrafana instance URL.
groupKeystringGroup identifier.
groupLabelsobjectLabels used for grouping.
commonLabelsobjectLabels common to all alerts.
commonAnnotationsobjectAnnotations common to all alerts.
versionstringPayload version.
alertsarrayList of individual alert instances.

Per-alert fields

FieldTypeDescription
statusstringfiring or resolved.
labelsobjectAlert labels. Include alertname and severity.
annotationsobjectInclude summary (title) and description.
fingerprintstringUnique fingerprint for deduplication.
valuesobjectCurrent metric values (name → number).
startsAtstring (RFC3339)Alert start time.
endsAtstring (RFC3339)Alert end time.
generatorURLstringLink to the Grafana alert expression.

Field mapping

Navi.sh incident fieldSource
Titleannotations.summarylabels.alertname → top-level title"Grafana Alert"
Descriptionannotations.descriptionannotations.message → top-level message
Severitylabels.severity
Dedup keyfingerprintlabels.alertname

Example payload

json
{
  "receiver": "navi-sh",
  "status": "firing",
  "groupKey": "alertname",
  "externalURL": "http://grafana:3000",
  "version": "1",
  "alerts": [
    {
      "status": "firing",
      "labels": {
        "alertname": "HighMemory",
        "severity": "warning"
      },
      "annotations": {
        "summary": "Memory usage above 85%",
        "description": "Pod memory is critically high"
      },
      "fingerprint": "xyz789abc",
      "startsAt": "2024-01-15T10:30:00Z",
      "endsAt": "0001-01-01T00:00:00Z",
      "values": { "memory_usage": 87.3 },
      "generatorURL": "http://grafana:3000/alerting/..."
    }
  ]
}

Legacy format

For older Grafana versions, a simple top-level payload is also supported:

json
{
  "title": "High Memory Usage",
  "message": "Memory usage exceeded the threshold on web-01",
  "state": "alerting"
}

Response

202 Accepted — all alerts in the batch were queued for processing.

Built by the Navi.sh team.