reference
Alert webhooks and Slack
An environment can send each alert to up to 3 endpoints besides email: a URL you own, which receives a signed JSON body, or a Slack channel, which receives a Slack message. An endpoint receives the same events as the email thread: open, update and all-clear.
Add an endpoint
An Admin of the cell adds endpoints in the Destinations card of the environment's Alerts page with the Add destination button. Adding and deleting an endpoint needs a signed-in person: an API token cannot do either.
| Field | Rule |
|---|---|
| Name | 1 to 80 characters. A name you recognise, such as on-call channel. |
| Format | Signed JSON (json) or Slack (slack) |
| Address | https only, with a host, up to 2048 characters, with no user name or password in it. For Slack, the incoming-webhook URL that Slack shows. |
| Limit | 3 endpoints per environment. A fourth is refused. |
For a json endpoint Glenr makes a signing secret and shows it once, in the response that creates the endpoint. Copy it then. Glenr stores the URL and the secret sealed and returns neither again. The endpoint list shows the name, the format, the host of the URL, and the time and short reason of the last delivery that failed or succeeded.
To rotate a secret, or to revoke a URL that leaked, delete the endpoint and add it again. A delete also removes the deliveries that were waiting for it.
What Glenr sends
Glenr sends an HTTPS POST for each event of an alert thread, once per endpoint. The thread and its events are described in Alerts.
POST /glenr HTTP/1.1 Content-Type: application/json User-Agent: Glenr-Alerts/1 Glenr-Signature: t=1795684350,v1=3f6c1d0a8e5b7a92c4d1e0f3b6a8c9d2e7f4a1b0c3d5e6f708192a3b4c5d6e7f
| Event | Sent when |
|---|---|
alert.opened | The first alert of a thread. |
alert.updated | Another resource joins the thread, or the severity rises. |
alert.resolved | The all-clear. |
The JSON body
The body is a JSON object, version 1. Fields that do not apply to an event are absent. Glenr may add fields to version 1, so ignore fields you do not know.
| Field | Content |
|---|---|
version | The number 1. |
event | alert.opened, alert.updated or alert.resolved. |
thread_id | The id of the thread. The same on every event of one thread. |
organisation | The organisation's slug. |
cell | The cell's slug. |
environment | The environment's name. |
severity | critical, warning or info (the all-clear). |
class | incident or deploy. Absent on alert.resolved. |
resource | The resource the event is about. Absent when the event covers the whole environment. |
resources | On an update, the resources mailed so far. On an all-clear, every resource of the thread. |
summary | What happened, in Glenr's sentence for the cause. On alert.updated it starts with Update:. |
next_step | What to do, or No action needed. |
still_serving | On a failed deploy: the earlier version that still serves, or the statement that none runs. |
started_at | On alert.resolved, when the thread began, in UTC (RFC 3339). |
ended_at | On alert.resolved, when the last resource recovered, in UTC. |
url | The console page of the resource, or of the environment when the event names no resource. |
The body of an open event for a failed deploy:
{
"version": 1,
"event": "alert.opened",
"thread_id": "5b0e6f1c-2f0a-4d57-9a41-6a1d0f6a9c11",
"organisation": "acme",
"cell": "shop",
"environment": "production",
"severity": "warning",
"class": "deploy",
"resource": "api",
"summary": "The deploy of api in shop / production failed. The new version of api did not become ready in time. The earlier version still serves.",
"next_step": "Check how long it takes to start; if it needs longer, raise its startup time (startup: in glenr.yaml).",
"still_serving": "Still serving: api at 4f9c2a1, deployed 22 Nov 2026 20:28 UTC.",
"url": "https://console.glenr.io/orgs/acme/cells/shop/environments/production/resources/api"
}The body of the all-clear of the same thread:
{
"version": 1,
"event": "alert.resolved",
"thread_id": "5b0e6f1c-2f0a-4d57-9a41-6a1d0f6a9c11",
"organisation": "acme",
"cell": "shop",
"environment": "production",
"severity": "info",
"resources": ["api"],
"summary": "api is serving again. It was affected from 09:12 to 09:31 UTC (19 min).",
"next_step": "No action needed.",
"started_at": "2026-11-26T09:12:00Z",
"ended_at": "2026-11-26T09:31:00Z",
"url": "https://console.glenr.io/orgs/acme/cells/shop/environments/production"
}summary and next_step are Glenr's sentences. The body never carries the raw reason or message that a zone or container runtime reports.
The signature
Every json delivery carries the header Glenr-Signature:
Glenr-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256>
t is the time Glenr signed the delivery, in seconds since 1 January 1970 UTC. v1 is the lower-case hexadecimal HMAC-SHA256, keyed with your endpoint's secret, of the text <t>.<body>: the value of t, a full stop, then the request body exactly as Glenr sent it.
To verify a delivery:
- Read the raw request body. Do not parse and re-serialise it: one changed byte changes the signature.
- Split the header at commas and read
tand everyv1. - Reject the delivery when
tis more than 5 minutes from your clock, in either direction. - Compute the HMAC-SHA256 of
t, a full stop and the body with your secret. - Compare it with each
v1in constant time. Accept the delivery when one matches.
Glenr signs each attempt at its own time, so a retry carries a new t and a new v1 with the same body.
import { createHmac, timingSafeEqual } from "node:crypto";
const TOLERANCE_SECONDS = 5 * 60;
// rawBody is the request body exactly as received, a Buffer or a string.
// Returns true when the Glenr-Signature header is valid and recent.
export function verifyGlenrSignature(secret, header, rawBody, nowSeconds = Math.floor(Date.now() / 1000)) {
const parts = header.split(",").map((part) => part.trim().split("="));
const t = parts.find(([key]) => key === "t")?.[1];
const candidates = parts.filter(([key]) => key === "v1").map(([, value]) => value);
if (!t || !/^\d+$/.test(t) || candidates.length === 0) return false;
if (Math.abs(nowSeconds - Number(t)) > TOLERANCE_SECONDS) return false;
const expected = createHmac("sha256", secret).update(`${t}.`).update(rawBody).digest();
return candidates.some((candidate) => {
const given = Buffer.from(candidate, "hex");
return given.length === expected.length && timingSafeEqual(given, expected);
});
}import hashlib
import hmac
import time
TOLERANCE_SECONDS = 5 * 60
def verify_glenr_signature(secret: str, header: str, raw_body: bytes, now=None) -> bool:
"""raw_body is the request body exactly as received."""
now = time.time() if now is None else now
fields = [part.strip().split("=", 1) for part in header.split(",") if "=" in part]
timestamps = [value for key, value in fields if key == "t"]
candidates = [value for key, value in fields if key == "v1"]
if not timestamps or not (timestamps[0].isascii() and timestamps[0].isdigit()) or not candidates:
return False
if abs(now - int(timestamps[0])) > TOLERANCE_SECONDS:
return False
signed = timestamps[0].encode() + b"." + raw_body
expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
return any(hmac.compare_digest(candidate.encode(), expected.encode()) for candidate in candidates)Delivery and retries
| Rule | Detail |
|---|---|
| Success | Your URL answers with a 2xx status within 10 seconds. |
| Attempts | 3. The first at the next delivery check after the alert is queued, the second about 1 minute after a failed first attempt, the third about 5 minutes after a failed second attempt. After the third failure the delivery is marked failed and is not sent again. |
| Failure | Any other status, a timeout or a connection error. A redirect (3xx) is a failure: Glenr follows none. |
| Protocol | HTTPS only. |
| Addresses | Glenr connects only to public internet addresses. It checks every address the name resolves to and refuses loopback, private, link-local and cloud-metadata ranges, for IPv4 and IPv6. An endpoint whose host resolves to one of them is accepted when you add it and fails at each delivery. |
| Order | Glenr does not guarantee that the events of a thread arrive in the order they happened. A retried event can arrive after a later one. |
A delivery can arrive more than once when your answer does not reach Glenr in time. Handle a repeated body safely.
The endpoint list shows the time of the last success and the last failure, and for a failure a short reason such as the receiver answered 500. The reason never contains your URL.
Slack
A slack endpoint takes a Slack incoming-webhook URL. Glenr posts Slack's text (the line a Slack notification shows) and blocks: a header with the subject, the summary with a severity badge (CRITICAL, WARNING or ALL CLEAR), the next step with, when the event has them, the resources affected so far and the earlier version that still serves, and a link to Glenr.
{
"text": "WARNING: Alert in shop / production. The deploy of api in shop / production failed. The new version of api did not become ready in time. The earlier version still serves.",
"blocks": [
{ "type": "header", "text": { "type": "plain_text", "text": "Alert in shop / production" } },
{ "type": "section", "text": { "type": "mrkdwn", "text": "*WARNING* The deploy of api in shop / production failed. ..." } },
{ "type": "section", "text": { "type": "mrkdwn", "text": "*What to do:* Check how long it takes to start; ..." } },
{ "type": "context", "elements": [ { "type": "mrkdwn", "text": "<https://console.glenr.io/orgs/acme/cells/shop/environments/production/resources/api|Open in Glenr>" } ] }
]
}A Slack delivery carries no Glenr-Signature header and has no secret. The incoming-webhook URL is its credential: delete the endpoint, and remove the webhook in Slack, if it leaks. Delivery follows the same rules as a json endpoint.
