Browse documentation

Pharos / Docs / v1.4.2

Alertmanager and Grafana

Updated 2026-12-04 · Pharos 1.4.2

Since 1.2.2 Prometheus Alertmanager and Grafana alerting can set component status directly, the way the Uptime Kuma endpoint does. Point a webhook at one of these addresses, with a Write token of the page as Authorization: Bearer <token>:

POST https://status.example.com/api/v1/alertmanager
POST https://status.example.com/api/v1/grafana

# another status page, with a token of that page
POST https://status.example.com/api/v1/pages/{slug}/alertmanager
POST https://status.example.com/api/v1/pages/{slug}/grafana

Every alert names its component with the label pharos_component: the component id, or its exact name, on the page of the token. The severity label sets how bad it is:

AlertThe component becomes
Firing, severity="critical"Major outage
Firing, severity="warning"Partial outage
Firing, severity="info"Degraded performance
Firing, no severity or another oneMajor outage
ResolvedOperational
  • When one notification carries several alerts for the same component, the worst one wins.
  • Alerts without the label, for a component Pharos does not know, or for a component with its own enabled check change nothing. The JSON answer lists them under ignored, with the reason (no_component_label, unknown_component or checked_component), next to what was applied.
  • Like the Kuma endpoint, these set the component only. They do not open or close incidents and do not notify anyone.
  • The component is marked as set from outside by that token, so its uptime is counted from the reported status.
  • The same limits as the other writing endpoints apply: 60 requests a minute, and a body of 256 KiB at most.

Alertmanager

Add a receiver and send the alerts for the status page to it. Alertmanager sends resolved alerts to webhooks by default.

route:
  receiver: pharos

receivers:
  - name: pharos
    webhook_configs:
      - url: https://status.example.com/api/v1/alertmanager
        send_resolved: true
        http_config:
          authorization:
            type: Bearer
            credentials: "<write token>"

Then give the alerting rules the labels Pharos reads:

- alert: ApiDown
  expr: probe_success{job="api"} == 0
  for: 2m
  labels:
    severity: critical
    pharos_component: "API"

Grafana

  1. In Grafana, open Alerting, Contact points and add a contact point with the integration Webhook.
  2. URL: https://status.example.com/api/v1/grafana, method POST.
  3. Under the optional webhook settings, set the authorization header scheme to Bearer and the credentials to the Write token. Save the contact point.
  4. In each alert rule that belongs on the status page, add the label pharos_component with the component id or name, and severity if it is not a full outage. Send the rule to the contact point, directly or through a notification policy.

Grafana's test button sends an alert without pharos_component: Pharos answers it, lists it under ignored and changes nothing. Going the other way, /api/v1/components needs no token, so the Infinity data source can chart the current status directly.