What you will have at the end
Two alert rules in the Staging Environment: one that fires when more than half of a Route’s answers in the last five minutes were 5xx, and one that fires when the same Route’s p95 response time crosses 500 ms. Both rules are on one Route: the form offers a Service as a scope too, but Staging has no Service to put one on. Both tell two channels: a mail list through your relay and a webhook that your receiver can verify with an HMAC signature. The article fires them by stopping the Route’s backend, reads what arrived in the mailbox and at the webhook, and follows the episodes in History and on their own pages. Then it stops the Environment’s Prometheus to show the system alert that says so. Every number below is from the install; the times are the console’s, in its own zone, and the mails give the same moments in UTC.
Prerequisites
- An Environment with a Prometheus connected, as in Connect Prometheus to an Environment. Rules read their numbers there, so an Environment without one has nothing to evaluate.
- A Route with traffic you can break. Here it is
orders-v2-api,/v2/orders/*to the single-node Upstreamorders-v2, with theapi-breakerPlugin from A failing backend out of rotation still on it; the article stops that node. - A mail relay the server can reach and a receiver for the webhook. The lab has a mailbox container that offers STARTTLS on port 1025 with a self-signed certificate, and a small container that prints every request it receives, so the article can show what arrived.
- A role that may manage alerts. The screenshots below were taken as
nora.becker.
The channels first
Open Alerts in the Environment’s navigation and select Settings. The page has three parts: the relay the mail lists send through, the mail lists, and the webhooks.
The mail relay
Set up mail relay takes Host, Port and From address, and an Account that stays empty when the relay accepts mail without signing in. The line under the title is the rule the relay has to meet: STARTTLS is always used, so the relay must offer it on that port; the note under Port says 587 is the usual one. Select Send test mail before saving. On this install the first test was refused:

The relay’s certificate is checked against the Environment’s CA bundle and the system roots, so a relay with a certificate from your own CA needs that CA in Environment › CA certificates, the same bundle the Environment uses for its other HTTPS connections. With the lab relay’s certificate added there, the test mail was accepted and arrived in the mailbox as [g8] TEST · Staging · Test notification. Then Save.
A mail list and a webhook
Add list takes a name and the addresses; ops-oncall here with one address. Preview message on the same card shows the mail a list receives, exactly as the server writes it, with an example rule.
Add webhook takes a Name, the URL, and an optional Signing key. The help under the URL is the one to read: notifications are POSTed as JSON, and the address should carry no secret, because everyone who can view Alerts sees it; the signing key is how a receiver verifies the sender. The help under the key says what the receiver will get: X-G8-Timestamp and X-G8-Signature, the latter v1= and the hex HMAC-SHA256 of the timestamp, a dot and the body, under the key.

The Settings page after both are saved. Example request on the Webhooks card shows a whole delivery, headers and body, computed with an example key, so a receiver can be written and tested before any rule exists.

Two rules on one Route
Back under Rules, select New rule. The form has three sections and a Changes panel on the right that shows what will be sent when you save.
orders-v2 answering 5xx: under Watch, Scope is one of Environment, Route, Service, Upstream and Consumer; Route here, and Target finds orders-v2-api by name. Signal is Response share, Status 5xx, Threshold 50 %, Window 5 minutes. Under Notify, tick ops-chat and ops-oncall.

orders-v2 slow p95: the same scope and target, Signal Response time, Measured As the client sees it rather than In the backend, Threshold 500 ms, and the help under it says what is compared: the p95 over the window. Window 5 minutes.
Hold, the last field of the section, is the one this article did not set and should have. Its help: fires only when the condition holds this long, and resolves after it clears this long. None here, which is what the measurement below shows the consequence of.

Select Create rule. The list shows both with a state: No data · No requests in the window for the Route nobody is calling, Awaiting evaluation for a rule the evaluator has not seen yet. The page says when the last evaluation was; on this install one runs every minute.
The system alert
Under the rules, System alerts lists what the server watches on its own: the engine’s Admin API, requests of a Route not being counted, Prometheus unreachable, the daily cleanup of request records failing, a gateway node that stopped reporting and one that runs a configuration behind the others. Each is Off until it gets channels. The row menu of Prometheus unreachable offers Switch on…, which asks only for the channels:

Stop the backend and watch
The node orders-v2 is stopped at 02:37:27, and a loop sends a request to /v2/orders/ord-10421, waits two seconds and sends the next. The breaker on the Route answers 503 for the dead node; that is a 5xx the client got, and the share rule counts it:
### orders-v2 stopped at 02:37:27, a request, two seconds' pause, the next
02:37:28 503 0.222s
02:37:30 503 0.147s
02:37:32 503 0.193s
…
Twenty-three seconds after the stop, at the evaluator’s next minute, the share rule fired: every request in the window was a 5xx, 100 % against a threshold of 50 %. Two minutes later the p95 rule fired at 1,066.7 ms.
The Route’s records say what raised the p95. Every 5xx of the outage is a 503 with gateway as the Upstream node: the breaker answered and no node was asked, so there was no slow connection attempt. Most of those 503s took no measurable time at the gateway, but six between 02:38:55 and 02:39:29 took 0.45 to 1.7 s there, and the client waited up to 3.5 s for them. Those few slow answers are enough to lift the p95 of a window this small. The records do not say why the gateway was slow to refuse them.

What the mail list received
Subject: [g8] FIRING · Staging · orders-v2 answering 5xx
From: alerts@corp.example To: oncall@corp.example
Alert: orders-v2 answering 5xx
Status: FIRING
Environment: Staging (staging)
Scope: route 00000000000000010257
Summary: 5xx answers were 100% of all requests over the 5 min before 23:37:50 UTC, above the 50% threshold.
Condition: 5xx share above 50% over 5 min
Value: 100%
Started: 2026-10-13T23:37:50Z
Episode: 1
Delivery: bfdc00f9-82af-4483-bb3a-f31eec032552
Plain text, one fact per line, with the sentence a person on call needs first. The mail speaks UTC; 23:37:50 UTC is the 02:37:50 of the console.
What the webhook received
The receiver printed the headers and the body of the first delivery:
User-Agent: g8/0.1.0-dev
Content-Type: application/json
X-G8-Delivery: 7f487e35-3fae-4a71-a1ac-bfb5ac5f0309
X-G8-Status: fired
X-G8-Timestamp: 1791934680
X-G8-Signature: v1=935e76ace6b693e19375066989b223dff42d54ff2a0ba805a81445f7753781d1
{"schema": "g8.alert.v1", "delivery_id": "7f487e35-3fae-4a71-a1ac-bfb5ac5f0309",
"status": "fired", "reason": null, "at": "2026-10-14T02:37:50.340763+03:00",
"environment": {"id": "staging", "name": "Staging"},
"rule": {"id": "558f91f0-1eba-4221-998e-c9fad7fb4982", "name": "orders-v2 answering 5xx",
"kind": "share", "system": false},
"scope": {"kind": "route", "id": "00000000000000010257"},
"condition": {"status": "5xx", "measured": null, "direction": null,
"threshold": 50, "window_seconds": 300, "for_seconds": 0},
"value": 100, "detail": "", "detail_text": "", "subjects": [],
"started_at": "2026-10-14T02:37:50.340763+03:00", "ended_at": null,
"episode_id": 1, "event_id": 1}
The signature was checked the way the form described it: HMAC-SHA256 under the signing key over the timestamp, a dot and the body exactly as received. For this delivery, with the key in $KEY, the timestamp in ts and the body in body:
printf '%s.' "$(cat ts)" | cat - body | openssl dgst -sha256 -hmac "$KEY"
SHA2-256(stdin)= 935e76ace6b693e19375066989b223dff42d54ff2a0ba805a81445f7753781d1
The same value follows v1= in the header. Every later delivery was checked the same way and matched. X-G8-Delivery is the id a receiver can use to drop a repeated delivery, and X-G8-Status says fired or resolved without parsing the body. The User-Agent names the server’s build; the Staging server of this article is a development build, which calls itself 0.1.0-dev.
Bring the backend back
orders-v2 is started again at 02:40:51, and a second loop starts beside the first, so from then on about one request a second reaches the Route. The breaker had not closed yet: the first 200 is at 02:40:56, and the last 503 at 02:41:10, nineteen seconds after the node was back. In all, the records hold 98 requests answered 503 between 02:37:28 and 02:41:10, every one by the gateway. The share rule resolved at 02:43:50, when the 5xx of the outage had fallen to 30.54 % of the window, under the threshold, and both channels got a second notification with Status: RESOLVED, the ended time and the same episode number.
The p95 rule did something else. It resolved one minute after it fired, at 02:40:50, with the p95 read at 481.3 ms; fired again at 02:42:50 at 971.9 ms, as the slow 503s were still inside the five-minute window; and resolved at 02:47:50 at 275 ms. Two episodes, eight notifications, for one outage. That is what Hold is for: with Hold at 5 minutes the rule fires only once the condition has held for five minutes and resolves only once it has been clear that long, and the one-minute dip would not have reached anyone.
History and the episode’s page
History lists episodes: when each fired, the rule, the scope, the state, the value against the threshold, the duration and how many notifications were sent. The filters narrow it by rule and by state.

The fired time of a row opens the episode’s page. Why it fired is the sentence of the mail; under it the rule, the value, the window, when it fired and ended, and why it ended, here the condition cleared. Where to look links to the 5xx request records of the Route in Traffic Explorer and to its Analytics. Notifications is the delivery table: each channel, each notification, the result, the attempts and the last attempt. And Traffic around the alert draws the Route’s Analytics cards for the minutes around the episode: 367 requests between 02:32 and 02:48, 81 of them 5xx, every one a 503 and every one answered by the gateway, which is the breaker. The records hold 98 503s for the same minutes; the note under the chart says why the two differ here: this Prometheus gives estimates, not exact counts.



An episode starts when a rule fires and ends when the condition clears or the rule is changed, disabled or deleted; the page says episodes are kept for 90 days after they end.
When Prometheus cannot be read
The Environment’s Prometheus is stopped at 02:48:46. Within a minute every rule’s state reads Not measured · Prometheus could not be reached, and the system alert goes Pending: its condition is Prometheus unreachable for five minutes. It fired at 02:54:50.

The mail, [g8] FIRING · Staging · Prometheus unreachable, has the same lines as the one above, with Scope: environment, Summary: Prometheus could not be reached., Detail: metrics_store_unreachable and a Cause line with the connection error: dial tcp [::1]:9092: connect: connection refused. Its episode number is 7: episode numbers are not consecutive within one Environment’s History, which here lists 1, 2, 4 and 7.
The webhook got the same as JSON, with "rule": {"kind": "prometheus_unreachable", "system": true}, "scope": {"kind": "environment"} and the cause in detail_text, signed like the rest. The bell in the header lists it from any page of the Environment:

Prometheus is started again at 02:55:53. The system alert resolved at 03:02:50, once it had been readable for five minutes, with Status: RESOLVED, started and ended, to both channels; History shows the episode as 8 minutes, 4 sent. The rules went back to No data and then to OK as the requests resumed.
What to do next
- The counts the rules read, and the proof they equal Prometheus’s own: Connect Prometheus to an Environment.
- The records the episode page links to, and how to search them: Traffic Explorer: connect your log store, set retention and masks, search records.
- The breaker that answered the 503s: A failing backend out of rotation.
- Why the numbers live in your own Prometheus and your own log store: Why G8, the section on analytics and records in your own data stores; the supported versions and the retention in the Deployment and Security Brief.