Beacon: end-to-end monitoring for Frappe Cloud V2
Report of 14 November 2026, updated the same day after an audit of the reporting path. Beacon is the incident manager, SLO panel and public status page. This note records what changed, what the audit found, what was tested on a local region, and what is still open.
Atlas #607Pilot #828Central #714Cargo #141Datum #20Beacon
The problem
Beacon reads telemetry from Datum, the regional ClickHouse store. It raises an alert when a rule query returns a row. A person sees an incident, and customers see the status page.
Before tonight, many failures did not reach Beacon. Atlas sent no Error Logs to Datum. The Atlas error gauge was always 0. Two SLI queries read metrics that no service sent. Central had no telemetry at all. Pilot sent no site states and kept no record of failed deliveries to Central.
A failure that does not reach Datum cannot become an alert. So the first job was to close those gaps, then to write rules, then to break things and look at the result.
How data reaches an incident
What changed
Producers
| App | Change | Why |
|---|---|---|
| Atlas | GET /api/atlas/beacon/resources, Central only, with an ETag. It lists Atlas itself, hosts, VMs, service nodes and Cargo. | Beacon must match telemetry to a resource. Alerts about Atlas now land on the atlas resource, not on every resource of the region. |
| Atlas | The Error Log gauge counts through the Error Log controller. | Error Log is a virtual DocType in its own log database. The old count read a stale table and was always 0. |
| Atlas | The Error Log publisher cursor uses the stored time form. | The log store compares time as text. The ISO cursor with a T excluded every new row, so nothing was ever sent. After the fix, 81 lines reached Datum in the first run. |
| Atlas | service_proxy_requests_total gets an origin label from upstream_header_time. | A site can send its own 502. Only a 5xx that the proxy made counts against the Networking SLO. |
| Pilot | pilot_sites{state} after each round of uptime pings, with zeroes. | The Sites SLI read a metric that did not exist. |
| Pilot | notifications.json.log: one line for each delivery to Central, with delivered and error. | Beacon can now alert when Pilot events do not reach Central. |
| Central | Each minute, new Error Logs and health gauges go to the Datum of the Region with Central Telemetry Region set, as resource central. Only one Region can have the checkbox. | Central is global and has no Datum. Its errors, stuck work, failed payments and failed webhooks were visible only in Desk. |
Beacon
- 54 rules and 4 services as files in the repository of the app that sends the data, with a runbook for each High and Critical rule. Areas: Atlas control plane, hosts, regional services, Cargo builds, object storage, Central health and webhooks, Pilot sites, backups and delivery.
- Incident subscriptions. A visitor subscribes to one incident by email (confirm link first) or reads its RSS feed. A public update sends one email to each confirmed subscriber. A replayed job sends nothing, because the update row records that subscribers were told.
- SLO paging. A burn alert pages only when, in one minute of its short window, 3 reporters were bad, or every reporter when fewer than 3 reported. Before, a service with 2 proxies could never page.
- Resource Source paths are relative to an API root, and Beacon signs in with a Frappe API key.
- Links in customer emails come from the configured status page domain, never from the request host, which a guest controls.
Reporting path audit
A second pass checked the whole path: the producers, the Datum API, the ClickHouse schema, datum_client and every rule. Three Codex audits (gpt-6.1-sol, high effort) read the code. Each finding below was checked on a local ClickHouse 26.10 before the fix.
What would have stopped all alerts
| Finding | Effect | Fix |
|---|---|---|
samples_recent, latest_value and counter_increase existed only in the local ClickHouse. | No Beacon rule could run on a deployed Datum. | Datum migration 006_beacon.sql (Datum #20), with a backfill of the last 2 days on its first run. |
| No ClickHouse user for Beacon. | Beacon had no safe way to read. | A select-only beacon user with a fixed profile: 20 s, 4 GB, 4 threads, 100,000 rows. Cargo generates its password and sends it to the migration (Cargo #141). |
| Pilot posts Fluent Bit logs as a bare array. | Datum refused every Pilot log batch. | Already fixed on Datum main (Datum #19). It needs a deploy of each Datum host. |
What would have given wrong alerts
| Finding | Fix |
|---|---|
| Atlas marked any stopped VM as Suspended, so a crashed VM lost its alerts. | Only a sleeping VM is Suspended. |
cargo-silent: the alias 'cargo' AS resource_id replaced the column in its filter. | Filter in a subquery. The rule fired always unless the token id was exactly cargo. |
| Central gauges: a cleared problem kept its old value for 5 minutes. | Each collection has one timestamp, and the rules read only the newest one. |
| Central request counts were lost when a push failed. | They go back to Redis and leave with the next push. |
| A sample from a fast clock stayed the newest value. | The views and the Pilot queries leave out samples more than 1 minute in the future. |
| One broken site on each of 5 servers looked like a regional backup failure. | A server counts only when half or more of its sites failed. |
| One new Atlas exception opened an alert for an hour. | A new error must repeat 3 times. |
New coverage
- Central health: API requests by group and status, resource actions, payments, gateway webhooks, billing runs, proxy routes, snapshots, emails, queues and late scheduled jobs. 7 rules with runbooks.
- Outgoing webhooks:
frappe_webhook_requests_last_day{webhook,status}.central-webhooks-failingpages when 10 requests of one webhook gave up after their retries, and they are 20% of its requests. - Object Storage SLO: 99.9% of S3 requests succeed. A 5xx is bad; 403 and 404 are normal answers. It reports the region as one reporter,
cargo, because Beacon drops rows whose resource ID is not in its registry, and the Garage node IDs are not. - Docs: Beacon now has a telemetry page and a developer guide, with diagrams, for a team that connects a new service. Codex (gpt-6-luna) reviewed them against the code.
Verification: 58 rule and SLI definitions pass the Beacon header check, and all 58 queries run on ClickHouse. Datum, Cargo, Central, Atlas and Pilot tests pass.
Rule fixes from review
Codex (gpt-6.1-sol, high effort) reviewed every rule and every code change. These are the defects that would have hidden a real outage:
| Rule | Defect | Fix |
|---|---|---|
host-down | Atlas stops sending sync age after one hour, so a dead host resolved itself after about 75 minutes. | Start from the host inventory. A Running host with no report stays failing. |
object-storage-unavailable | When every Garage node went silent, the alert resolved. | A node that reported in the last hour and stopped counts as down. Only a fresh healthy report resolves it. |
proxy-error-spike | max - min on a counter is wrong after a restart. | Reset-aware counter_increase. |
atlas-public-ips-exhausted | Atlas makes allocations lazily, so a large healthy pool looked empty. | Free = capacity minus allocations that are not Available, at one collection time. |
atlas-service-nodes-failed, cargo-build-stuck | The last Failed or stuck sample stayed after recovery. | Read only the latest collection. |
Tests on the local region
| Scenario | Result |
|---|---|
| Real Atlas job failures and Error Logs | Alerts fired and opened incident "Atlas jobs failing" |
| Garage cluster unavailable (synthetic) | Critical alert, severity of the incident raised, chat post sent |
| All Garage nodes silent (synthetic) | Rule stays failing; one fresh healthy node clears it |
| Cargo build failed and stuck (synthetic) | Alerts fired and joined the incident |
| Simulated Central failure, 6 Error Logs | Lines reached Datum; central-errors went Pending |
| Pilot deliveries to Central fail with HTTP 502 (synthetic logs) | pilot-central-delivery returned the row |
| Subscribe, confirm, publish, replay, unsubscribe | One email per public update, none on replay, none after unsubscribe; RSS valid |
| Proxy origin label, 10 log lines in Vector 0.46.1 | All correct, also for old proxy images |
| Host sync loss on one host (synthetic sample) | No new alert: a real Atlas sample in the same window reset the latest value. A real test needs the host stopped. |
Unit and integration tests: Atlas route, error log and router tests pass; Pilot 41 tests and mypy pass; Central 3 new tests pass. Ruff passes in every changed app. Beacon has no tests yet, by its own rule.
Real findings
- Atlas job
delete_virtual_machine_imagefails about 140 times in 15 minutes on the local region. - Atlas logs each expected guest 403 on
/as an unhandled Error Log, about 165 in 15 minutes. This is noise that hides real errors.
Still open
Decisions for the team
- Silence alerts as outage evidence. A stale reporter counts as bad under any firing non-burn alert, also
pilot-silent. A crashed Pilot can burn the Sites budget while the sites are up. Proposal: a rule headeris_outage_evidence: 0for silence rules. It changes the Beacon Alert Rule DocType, so it needs a mockup first. - A Dashboard and API SLO for Central. The data is there (
central_requests). The global service needs the Beacon name of the Central telemetry region. - Datum delivery signals. Rejected, throttled and failed inserts leave no data that Beacon can read. Proposal: a small per-minute ingest outcome table in Datum.
Known gaps
- Datum returns 400 for some ClickHouse server errors, so a sender drops a batch that it could send again.
datum_client.flush()reports samples as sent when the post failed.- The Sites SLI drops a server that is silent for more than 30 minutes.
- Pilot does not report a stopped bench process as 0, and its uptime pings run one site at a time.
- Data-plane probes: a request through the proxy, traffic through the WireGuard gateway, and routed IPv6.
- The site ping runs app request hooks, so an app fault can count against the Sites SLO.