Grafana
Grafana uyarılarını iPhone'unuzun kilitli ekranında zaman çizelgeli bir canlı etkinliğe dönüştürün. Uyarılar aktifken gerçek zamanlı güncellemelerle metrik geçmişini bir bakışta görün.


On Android, the alert timeline is a Live Update in the notification shade: the primary series on a bar, with the thresholds as points on it.
The Server Room card in this capture is a timeline.
Two ways to bring Grafana into PushWard. The app plugin below is the recommended path — it runs the timeline bridge and a widget engine inside Grafana, with one-click setup. For simple alert-style notifications (firing/resolved, no history), the Relay integration needs no plugin or container at all.
Grafana Cloud cannot load the plugin because it is unsigned. On Grafana Cloud, use the Relay integration.
Get Your Integration Key
PushWard uygulamasında Ayarlar → Entegrasyon Anahtarı altındaki varsayılan entegrasyon anahtarınızı kullanın veya bu entegrasyon için kapsamı sınırlı bir anahtar oluşturun.
Grafana App Plugin (Recommended)
The PushWard app plugin is the in-Grafana setup and management layer. One click wires up the webhook contact point, validates your key, and renders the live timeline sparkline inside Grafana using your existing datasource — no separate container and no extra Prometheus config. It can also poll PromQL on a schedule and publish the results as iOS Home and Lock Screen widgets.
Grafana doesn't let third parties add native contact-point types — every integration (including Grafana's own OnCall) delivers through a webhook contact point. The plugin makes that setup one-click; it doesn't replace the webhook.
Requirements
- Grafana 12.3 or newer (unified alerting plus app-plugin IAM service accounts)
- A PushWard integration key (
hlk_prefix) —notificationsatsendfor test pushes, andwidgetsatwriteto publish widgets - A Prometheus or VictoriaMetrics datasource in Grafana (for the timeline history)
1. Install the Plugin
Self-hosted today: download the release ZIP from the plugin repository,
unzip it into your Grafana plugins/ directory, and allowlist the unsigned plugin:
[plugins]
allow_loading_unsigned_plugins = pushward-alerts-appRestart Grafana, then enable the app under Administration > Plugins and data > Plugins > PushWard and open its Configuration page.
2. Connect
On the Connect page, one click creates the PushWard webhook contact point (no manual URL or header copying) along with a scoped Grafana service-account token, and validates your integration key against the PushWard API. Add that contact point to any alert rule's notification policy to start receiving timelines.
3. Configure
On the Configuration page (Admin only) you set:
- Integration key — your
hlk_key - Datasource — the Prometheus/VictoriaMetrics datasource the backend queries for metric history
- Severity mapping — which alert label drives the accent color and icon
- History window and poll interval — how far back to backfill and how often to refresh while firing
- Also send a push notification — off by default; sends a normal push alongside the quiet timeline when an alert fires and when it resolves, with a Notification priority of Silent, Normal, or Critical (Critical needs the critical-alert entitlement on your account, otherwise it falls back to time-sensitive). Plugin 0.6.0+
- Widgets — the widget definitions described below
Bu bölüm, App Store incelemesini bekleyen bir uygulama güncellemesindeki bir özelliği açıklar. Güncelleme yayınlanır yayınlanmaz burada otomatik olarak açılır.
Repeat until acknowledged
Plugin 0.10.0 adds Repeat until acknowledged under Also send a push notification. It is off by default. With it on, the firing push gets an Acknowledge button and comes back every Repeat every seconds until someone taps it on one of their devices, or until Stop repeating after runs out. When the alert resolves, the plugin stops the repeats before the resolved push goes out, and ending the activity from the Activities page stops them too.
| Setting | Default | Range |
|---|---|---|
| Repeat until acknowledged | Off | -- |
| Repeat every | 300 seconds | 30 to 3600 seconds |
| Stop repeating after | 3600 seconds | 60 to 10800 seconds |
- A Silent push never alerts, so it cannot repeat: the switch is greyed out when the notification priority is Silent.
- Turning the switch off does not stop repeats that are already running. Those stop when someone acknowledges them or when they expire.
- An account can have at most 25 repeating notifications at once, counting everything that sends them with
your keys. When it is full, or the server refuses the acknowledge for another reason, the plugin sends the
alert once without repeats, and the delivery log shows
ack refusedwith the reason.
How the button, the repeats and their limits work is covered on the acknowledged alerts page.
Take back on resolve
Plugin 0.15.0 adds Retract on resolve under Also send a push notification on the Configuration page, so you see it only while that switch is on or Live Activities is set to Only labeled alerts. It is off by default. With it on, when the last firing instance of an alert resolves, the plugin takes the alert's push back off your devices instead of sending a Resolved push over it. With Repeat until acknowledged on as well, the repeats still stop first.
- When the retract fails or reaches no device, the Resolved push goes out as before, so the alert is still replaced. Otherwise only the retract goes out: it is a delayed silent push and would take a Resolved sent after it down with the alert. Both go out only when PushWard took the retract but its answer did not arrive within 5 seconds: the plugin cannot tell that from a failure and sends the Resolved, which the retract may then take down too. From plugin 0.15.1, when the alert fires again in another webhook before the plugin starts the retract, the resolve sends neither: the new push replaces the old one. When it fires again while the retract is under way, a retract that fails or reaches no device is not followed by the Resolved, and one that goes through can still take the new push down.
- It also takes back the push of an alert that ends without a resolve: one the plugin stops tracking as stale, one whose activity you end on the Activities page, and one whose resolve arrives after a settings save restarted the plugin. These have no Resolved push to fall back on. In plugin 0.15.0 such a retract that fails or hits the rate limit is given up at once and the push stays up.
- From plugin 0.15.1 those retracts wait in a queue and go out one at a time, waiting out the rate limit. A queued retract is dropped once the alert fires again. One that already went out is a delayed silent push, so an alert that fires again seconds after it can still lose its new push to it. One that fails, or is still not through 2 minutes after it was queued, is given up and the push stays up, and so is one that finds 32 already waiting or one still queued when the plugin restarts; the delivery log shows each.
- From plugin 0.15.1 a resolve that arrives after the plugin already ended the alert changes nothing on your devices. The plugin's alertmanager check usually gets there before Grafana's resolved webhook, and a Resolved push it kept because the Live Activity could not be ended stays. When a queued retract of that end (the stale sweep, the Activities page, a resolve after a settings save) failed or found the queue full, the late resolve queues it again. In 0.15.0 the late resolve retracts again, which takes down that kept Resolved push too.
- A resolve that arrives after a settings save cannot tell whether other instances of the alert still fire, so it takes their push back too, and an alert that is still firing leaves your devices.
- It is best effort. Apple Watch, and PushWard on iPhone, iPad or Mac before 1.20, keep the alert; Android removes it from PushWard 1.1.0. PushWard allows 10 retracts a minute per account, shared with everything else that retracts with your keys.
- A retract reaches every notification of the account sent under the alert's collapse id, which is built from
the alert name. Two Grafana instances on one account that both have a
DiskFullalert take back each other's push, and so do alerts without a name, which all share one. From plugin 0.15.1, once one alert without a name is taken back, the resolves of the others send nothing until one of them fires again or a queued retract of that end fails; one that arrives while that retract still waits sends nothing, even if the retract then fails. A Resolved push one of them sends can go out ahead of a queued retract and be taken back with the rest. Give such instances their own account, or leave the switch off for them.
End-to-end encryption
Plugin 0.10.0 can encrypt the title, subtitle and body of the alert pushes it sends, so PushWard only stores and forwards an envelope it cannot open. Your devices open it with the same key.
- In the PushWard app (1.17.0 or later), open Settings > End-to-End Encryption, create a key and copy it.
- Paste the 64-character key into End-to-end encryption key on the plugin's Configuration page and save. The page shows the Key ID in use, which should match the one the app shows next to the key.
The test notification on the Connect page is encrypted as well and reports the Key ID it used. To go back to unencrypted pushes, press Reset next to the key and save.
- PushWard can still read the notification level, the Live Activity the push links to, its collapse id and the tag of a repeating push. The link, collapse id and tag are hashes, not the alert name.
- The timeline Live Activity is not encrypted, and it carries the alert name and summary. The key keeps the alert text out of your notification history, not out of PushWard entirely.
- A key that does not work never sends the alert text readable. The push still goes out, without its text: "Grafana alert firing" (or "resolved") and "Encryption key invalid, check the PushWard plugin settings". The plugin's Configuration page shows what is wrong with the key.
- With an integration key that belongs to an organization, paste the organization's encryption key, not your own key from the app: an admin creates it and hands it out, and members add it in PushWard 1.18.0 or later (see Organizations). While PushWard has encryption for organizations turned off, the push goes out without its text (plugin 0.10.1 and later), as it does for a key that does not work.
What exactly is covered, and what a device without the key shows, is on the end-to-end encryption page.
Widget Engine
Beyond timelines, the backend can poll PromQL on a schedule and publish the results as iOS widgets.
Declare value, progress, status, gauge, and stat_list widgets in the configuration; each runs on its own interval with an on_change or always trigger mode, and a multi-series query fans out into
one widget update per series.
Management and Dashboard
The Overview, Activities, and Widgets pages show current Live Activities, a recent delivery log, and your declared widgets, and let you send a test notification or fire a test timeline. The Overview page also shows delivery counters — alerts received, activities created, pushes sent, and errors. Alert rules and instances get a View in PushWard action too.
Standalone Container (Legacy)
The standalone pushward-grafana container will soon be deprecated in favor of the app plugin above, which covers the same timeline bridge plus widgets with no separate deployment. Use it only if you can't run an app plugin on your Grafana.
How It Works
- Webhook — Grafana fires an alert and sends the webhook to pushward-grafana
- Query — The service queries Prometheus or VictoriaMetrics for the metric's recent history
- Timeline — A Live Activity starts with a sparkline chart showing the metric over time
- Poll — While the alert is firing, the service polls for new data points and pushes updates
- Resolve — When the alert resolves, the activity ends with a final snapshot
Deploy the Service
services:
pushward-grafana:
image: ghcr.io/mac-lucky/pushward-grafana:latest
ports:
- "8090:8090"
environment:
PUSHWARD_URL: https://api.pushward.app
PUSHWARD_API_KEY: hlk_YOUR_INTEGRATION_KEY
PUSHWARD_METRICS_URL: http://prometheus:9090
# Optional: webhook secret (must match Grafana contact point)
# PUSHWARD_WEBHOOK_TOKEN: your-shared-secret
# Optional: Grafana API for auto-extracting PromQL from alert rules
# PUSHWARD_GRAFANA_URL: http://grafana:3000
# PUSHWARD_GRAFANA_API_TOKEN: glsa_...
restart: unless-stoppedConfigure the Grafana Contact Point
- Navigate to Alerts & IRM > Alerting > Notification configuration > Contact points
- Click + New contact point
- Select Webhook as the integration type
- Set URL to your pushward-grafana instance (e.g.
http://pushward-grafana:8090/webhook) - If you set
PUSHWARD_WEBHOOK_TOKEN, expand Optional settings and set Authorization header scheme toBearerwith the matching token - Click Test, then Save
Create a Notification policy that routes alerts to this contact point.
Configuration
| Ortam Değişkeni | Açıklama | Varsayılan |
|---|---|---|
PUSHWARD_URL | PushWard server URL | -- |
PUSHWARD_API_KEY | Integration key (hlk_ prefix) | -- |
PUSHWARD_METRICS_URL | Prometheus or VictoriaMetrics URL | -- |
PUSHWARD_WEBHOOK_TOKEN | Shared secret for webhook authentication | (none) |
PUSHWARD_SERVER_ADDRESS | HTTP listen address | :8090 |
PUSHWARD_PRIORITY | Activity priority (0-10) | 5 |
PUSHWARD_CLEANUP_DELAY | Delay before cleanup after resolved | 15m |
PUSHWARD_STALE_TIMEOUT | Ends activity if no updates received | 24h |
PUSHWARD_GRAFANA_URL | Grafana API URL for auto-extracting PromQL | (none) |
PUSHWARD_GRAFANA_API_TOKEN | Grafana service account token (Editor role) | (none) |
PUSHWARD_HISTORY_WINDOW | How far back to query on alert fire | 30m |
PUSHWARD_POLL_INTERVAL | How often to poll for fresh data points | 30s |
The sparkline visual settings have no environment-variable override — set them under the timeline: block in the config file: timeline.smoothing (curve smoothing,
default true), timeline.scale (linear or logarithmic, default linear), and timeline.decimals (value
precision, default 1).
Dashboard Links
The bridge forwards the alert's silenceURL, generatorURL, and panel
links straight through to the notification — both http:// and https:// schemes are accepted, so a self-hosted Grafana on a LAN (e.g. http://grafana.internal/d/abc) round-trips cleanly for users on VPN. URLs without an http(s):// scheme are dropped on the way in.
PromQL Resolution
The timeline needs a PromQL expression to query metric history. The app plugin reads the firing rule's query from your datasource automatically; the standalone container resolves the query in this order:
- Auto-extract (recommended) — If
PUSHWARD_GRAFANA_URLandPUSHWARD_GRAFANA_API_TOKENare set, the service reads the alert rule's PromQL expression via the Grafana API. No per-rule configuration needed. - Annotations — Add annotations to your Grafana alert rules to specify the query explicitly.
- Webhook values — Falls back to the numeric values included in the Grafana webhook payload (no history, just the current value).
Per-Rule Annotations
Add these annotations to your Grafana alert rules to override the query or tune the sparkline:
| Annotation | Description | Example |
|---|---|---|
pushward_query | PromQL expression for history backfill | avg(rate(http_requests_total[5m])) |
pushward_unit | Unit label shown on the sparkline | %, °C, ms |
pushward_threshold | Threshold value shown as dashed line | 80 |
pushward_ref_id | Which values key to use (default: first) | B |
Severity Colors
The sparkline accent color and icon are derived from the severity label on the alert rule:
| Severity Label | Color | Icon |
|---|---|---|
critical | Red | Alert octagon |
warning | Orange | Alert |
info | Blue | Information |
Add a severity label to your alert rules (e.g. severity = critical) for automatic color and icon theming.