Beacon: incident manager and status page for Frappe Cloud V2
A design for one small Frappe app. It reads the health that each layer of Frappe Cloud already reports, finds problems before customers do, groups them into root-cause incidents, calls the on-call engineer, tracks SLOs and error budgets, and publishes a status page.
- Latest operator review and response flows
- Situation
- Goals, non-goals, scale
- Architecture
- Key decisions
- Who watches what
- One problem, end to end
- Concepts and DocTypes
- DocType reference
- Resource registry
- Rules and evaluation
- SLOs and error budgets
- Incidents and impact
- Maintenance and muting
- Service status and uptime
- On-call and paging
- State handling
- Scenarios
- Integrating a V2 service
- REST API
- Status page
- Desk control panel and roles
- Changes in Datum and other services
- Scale numbers
- Rollout and checks
- What we do not build
- Open questions
- Sources
1. Situation
Frappe Cloud V2 sends telemetry to Datum. Datum is a write-only service in front of ClickHouse. There is one Datum and one ClickHouse in each region. Readers query ClickHouse directly with a read-only account.
Today, alerts are temporary. A script in frappe/atlas makes three Insights Alerts: P1 every 5 minutes, and two P2 alerts every hour. Each one is a large SQL query that joins about 50 checks. When it returns rows, Insights posts a Markdown message to a chat webhook. The problems:
- There is no state. The same problem posts on every run, and nothing says "resolved".
- There is no acknowledgement, paging or escalation.
- You cannot mute one host or one check, or schedule maintenance.
- One failing check hides in a long message. There is no history for each resource.
- The Insights SQL size limit splits one logical alert into two.
Frappe Cloud V1 (frappe/press) had a full incident system: Prometheus rules, Alertmanager webhook logs, an Incident with Validating → Confirmed → Acknowledged → Resolved, Twilio calls, night shifts and silenced alerts. We keep its ideas. We drop three things: a second alerting stack to operate, "the call was answered" as acknowledgement, and mute flags spread across many DocTypes.
2. Goals, non-goals, scale
Goals
- Find platform problems before a customer reports them, and page the right person once, with the root cause attached.
- Measure each customer-facing service with an SLI and an SLO, show the error budget, and report SLA attainment.
- Alerts that are easy to write and have state: Pending → Firing → Resolved, one episode per problem, no duplicates.
- Root-cause incidents with paging, acknowledgement, updates and a root cause analysis (RCA).
- A status page with regions, one status for each service, 90-day uptime bars, incidents and maintenance. Unlisted incidents with a private link, like Hetzner does.
- Maintenance windows that stop paging and, when announced in advance, do not count against the SLO.
- A short integration path, so every V2 service can use it.
Non-goals for v1
- A staff web app. Staff use Desk.
- Checks for a single site or a single VM. The layer that owns it already watches it and tells its owner.
- Customer alert rules and incidents in the Central dashboard. That is phase 4, and Central owns that UI.
- Python rule scripts, probes of public URLs, anomaly detection, SLA credits, email subscriptions, several on-call teams.
Scale target
Up to 100,000 resources per region (most are sites), about 10 regions. Sites reach Beacon only as counts, so Beacon stores about 10,000 infrastructure resources per region and a few alerts. We do not design for millions.
3. Architecture
Beacon is one Frappe site. It runs outside the regions it watches. It pulls the infrastructure list from Atlas in each region, and the map from Central server IDs to Atlas VM IDs from Central. It reads each region's ClickHouse with a read-only user and writes nothing there. Beacon serves the status page itself at /, and caches each response in Redis for one minute, so outage traffic peaks do not reach ClickHouse.
| Part | Job |
|---|---|
| Datum + ClickHouse (per region) | Stores samples, logs and traces. Owns telemetry. |
| Registry sync | Every minute, pulls each Resource Source (Atlas in each region, and Central's server ID map) and writes the changed rows to MariaDB. |
| Beacon evaluator | Scheduler jobs and an RQ queue named beacon. Runs rule and SLI queries and writes transitions. |
| Beacon tick | One job every minute for time-based work: SLO burn rates, maintenance start and end, silence expiry, escalation steps, the heartbeat. |
| Desk | Staff work incidents and configure everything. The Beacon workspace is the control panel. |
| Status page | A Vue app served at / of the Beacon site. It loads its data from guest API methods. Each response stays in Frappe's Redis cache for one minute. |
| Notifiers | Twilio voice, email (Frappe Email Account), a chat webhook. |
4. Key decisions
resource_id, alert_key, value, detail. An SLI returns good, valid for each reporter, such as a VM. A read-only profile limits time, memory, threads and concurrency. No Python safe_exec.5. Who watches what
Frappe Cloud is a stack: a host runs VMs, a VM runs a bench, a bench serves sites. Each layer already checks the layer below. The table shows what exists today and the one small addition that Beacon needs.
| Layer | Watched by | Signal in Datum | One failure | Beacon acts when |
|---|---|---|---|---|
| Site | Pilot in the VM. It pings /api/method/ping on loopback every few seconds. | pilot_sites{state} per VM, summed over its benches: up, app_error, platform_down, maintenance. New, small. | Pilot tells the site owner (site_down). An app error is the site's own problem. | The Sites SLO burns. |
| VM and its Pilot | metald on the host: desired against observed state, and guest pings (3 missed = unreachable). | metal_vm_wanted_running, metal_vm_unavailable{reason} per host. Exists. | metald and Atlas act. The owner sees it in the dashboard. | 3 or more VMs (and 20%) on one host are unavailable, or the Servers SLO burns. |
| Host (metald) | Atlas: syncs each host every few seconds and pushes the age every minute. BMC telemetry. | atlas_host_sync_age_seconds{server}. Exists, but today it drops hosts with no sync in the last hour. Small fix. | No other owner. | Sync older than 5 minutes and metald silent: host down, one incident with everything under it. Sync old but metald alive: Atlas cannot sync (High). |
| Service node (proxy, gateway, storage) | Atlas: readiness URL. The IPv6 router has none. | atlas_service_ready{service, node}. Exists. | No other owner. | Not ready for 3 minutes. |
| Requests through the proxy | The proxy's JSON access log | proxy_requests_total{class}: ok, app_error, platform_error. New, Vector config only. | A bad upstream for one site is that site's problem. | The Networking SLO burns. |
| Atlas, Datum, region network | Beacon | A ClickHouse probe, and Atlas's newest sample. | Not applicable | The probe fails, or Atlas is silent for 5 minutes. |
| Beacon | An external dead-man switch | Heartbeat | Not applicable | The heartbeat stops. |
Beacon ──watches──> Atlas, Datum ──> hosts ──> VMs ──> sites
reads the counts of: Atlas (hosts, nodes) · metald (VMs) · Pilot (sites)
one item fails -> its owner layer handles it, Beacon stays quiet
many items fail -> SLO burn (symptom) pages; a cause rule names the host or node
a watcher fails -> Beacon alerts on the watcher (Atlas silent, host down, region probe)
Why this works. A failure is always visible one level up. A dead site shows in Pilot's counts. A dead VM shows in metald's counts. A dead host shows in Atlas, and its metald goes silent. A failing proxy shows in its request counts. A dead Atlas or Datum shows in Beacon's probe. So Beacon never needs a "not reporting" rule for each leaf. A silent Pilot on a healthy VM is left out of the Sites SLI, and the control panel shows the coverage.
Why Pilot splits app errors. A site that fails because of its own code is the customer's problem, and Pilot already tells them. If it counted as down, 100 broken customer apps among 100,000 sites would use the whole budget of a 99.9% SLO. So Pilot asks one question for each failed ping: is the cause inside this site, or outside it?
| Ping result (loopback to the bench's gunicorn) | State | Why |
|---|---|---|
| 200 | up | The site answers. |
| 503 with the site in maintenance mode | maintenance | Down on purpose, for example during an update. Left out. |
| Connection refused or reset | platform_down | gunicorn is not running. Pilot runs the bench, so this is ours. |
| Any failure while the bench's MariaDB health check fails | platform_down | Frappe answers 500 when it cannot reach the database. Pilot runs the database, so this is ours. |
| Timeout (5 s) on every site of the bench | platform_down | The bench is hung or out of workers. Even when one busy site causes it, the other sites suffer, and we own that. |
| Timeout on some sites only | app_error | That site's own requests are slow. |
| 500 or another status, database healthy | app_error | A broken app, a bad site config or a failing hook in that site. |
The rule in one line: a failure is platform_down when its cause is outside the site (process, database, or the whole bench), and app_error when only that site shows it. Pilot notifies the owner in both cases, as it does today. Only platform_down uses the Sites budget.
6. One problem, end to end
Follow a host failure in Mumbai. The host bom-h12 has 30 VMs and 400 sites.
- 07:12. The host loses power. Its metald stops reporting, and so do the Pilots in its VMs.
- 07:15. The Pilots have been silent for 3 minutes. No cause alert covers them yet, so the Sites SLI leaves them out. A Pilot restart looks the same, and must not page.
- 07:17. Atlas's sync for bom-h12 is older than 300 s and metald has been silent for 5 minutes. The cause rule "Host down" returns bom-h12. With
pending_for60 s it fires at 07:18. Beacon creates an Internal incident with scope "bom-h12, include descendants", severity Critical. The host has no parent, so it pages at once. - 07:18. Now a cause alert covers the silent reporters, so the SLIs count them as bad. Sites: 400 of 50,000 sites is 0.8% bad, a burn rate of 8 for 99.9%. Servers: 30 of 3,000 VMs is 1% bad, a burn rate of 10. Neither passes the fast page (14.4). The Servers 6-hour alert would fire after about 3.6 hours, and it would join this incident because the incident has a firing cause alert.
- The primary responder does not press 1. After 2 minutes (Critical), Beacon calls the second responder, who presses 1. The incident moves to Investigating.
- The engineer uses Publish: Unlisted, first public update, affected services "Servers · bom" and "Sites · bom", impact Partial Outage. Support copies the private link and the VM list from "Export affected resources".
- 07:50. The power supply is replaced. The host syncs, VMs boot, Pilots report. The cause alert recovers after
resolve_after. The incident is Unlisted, so Beacon posts "all alerts resolved" to chat. The engineer posts a final update and resolves it. The control panel shows the cost: about 0.6% of the month's Sites budget and 0.8% of the Servers budget.
7. Concepts and DocTypes
A new engineer needs seven ideas: Rule (a query that finds a cause), SLI and SLO (how good a service is, and how good it must be), Alert (one problem on one resource), Incident (what people work on, and what customers may see), Silence (mute paging for a time), Service (one line on the status page, with its SLO) and Registry (which infrastructure exists in a region). v1 has 14 DocTypes. All times are UTC.
| DocType | One row per | Written by | Name |
|---|---|---|---|
| Incident | Incident or maintenance | Beacon and staff | INC-00412 |
| Alert | Alert episode | Beacon only | random |
| Silence | Mute | Staff | SIL-00042 |
| Alert Rule | Cause rule, or the SLO burn rule of a service | Git sync, an admin, or Beacon | rule_key |
| Rule Evaluation | Rule and region | Beacon | random |
| Resource | Region, host, VM or service node | Registry sync (admins: monitoring fields) | bom:bom-h12 |
| Resource Source | Regional service that serves a list | Admin | bom-atlas |
| Region | Region | Admin | bom |
| Service | Line on the status page, with SLI and SLO | Git sync or an admin | sites |
| Service State | Service and region | Beacon | random |
| Service Minute | Service, region and minute (kept 3 days) | Beacon | random |
| Service Day | Service, region and UTC day | Beacon | random |
| Beacon Settings | Single | Admin | n/a |
| Notification | Call, email or chat post | Beacon | random |
Child tables: Incident Scope, Incident Service, Incident Update, Beacon Responder, and Region Item (for region pickers). Phase 4 adds Beacon Event (an outbox to Central).
Region ── Resource Source (Atlas) ── fills ──> Resource ──> Resource (parent)
└──── Rule Evaluation <── Alert Rule ──> Alert ──> Incident
^ ^ ├── Incident Scope ──> matches Resource
Service ── SLO burn rule ────┘ Silence ─────┘ mutes ├── Incident Service ──> Service
└──> Service State, Service Minute, Service Day ├── Incident Update
└── Notification ──> Beacon Responder
8. DocType reference
Original design layouts. Every implemented DocType now has the Beacon prefix in the single Beacon module. The operator review gives the latest proposed form and tab order. These older diagrams do not certify that each evidence panel or action is complete.
Each card shows one Desk form from top to bottom. Tabs come in order, and sections stack inside a tab. Columns sit side by side, and the field order in a column is the position on the form. A grey field is read-only: Beacon sets it, or an action changes it. A red star marks a required field. Below each form, the table lists its buttons. Permissions use the two roles from "Desk workflow and roles".
Two rules keep the forms safe. First, a field that drives a state machine (status, visibility, escalation, paging paused) is read-only, and only an action changes it, so every change runs the same checks. Second, a document that Beacon writes (Alert, Rule Evaluation, Resource, Service State, Service Minute, Service Day, Notification) has no New button and no delete permission.
titletypeIncident · Maintenance. Set once.severityLow · Medium · High · Critical. Beacon raises it, never lowers it.statusTriggered · Investigating · Identified · Monitoring · Resolved · MergedMaintenance: Scheduled · In Progress · Completed · Cancelled. Changed only by actions.
visibilityInternal · Unlisted · Public. Changed only by Publish.merged_intoShown when Mergedacknowledged_byacknowledged_atresolved_atscheduled_startLocked when it startsscheduled_endCan be extended until it passesmute_slo_burnOn by default. Suppresses burn alerts of the regions in scope.excluded_from_slo1 only if Public and created before the startscopeColumns: region*, resource_type, resource_id, include_descendants. Blank = any. Locked when a maintenance starts.alerts_htmlCounts by status, the 50 newest Firing alerts, a link to the full Alert listcreated_by_beacongroup_keysOne per line. A manual merge adds the merged keys.share_tokenHidden. Read by "Copy private link".affected_servicesColumns: service*, region, impact* (Degraded · Partial Outage · Major Outage · Maintenance). The status page uses it only when visibility is not Internal.updatesColumns: posted_at, status, message, is_public, posted_by. Added only by "Post update". Rows are read-only.escalationNone · Waiting · Calling · Donepage_roundpage_indexPosition in the responder listnext_page_atThe tick acts at this timenotifications_htmlCalls, emails and chat posts for this incident, newest firstrcaStaff onlypublic_rcaShown on the incident page when it is published and resolved| Action | Shown when | Role | What it does |
|---|---|---|---|
| Acknowledge | Triggered, or paging is active | Responder | Stops paging (escalation Done). Sets acknowledged_by and acknowledged_at. Triggered → Investigating. Any other staff action on a Triggered incident does the same. |
| Post update | Not Resolved or Merged | Responder | Dialog: next status (Investigating, Identified, Monitoring or Resolved), message*, public (on by default when not Internal). Adds an Incident Update row. Resolved runs the Resolve check. |
| Publish | Internal | Responder | Dialog: Unlisted or Public, affected services with impact, first public message*. Unlisted creates the 32-character share_token. |
| Change visibility | Unlisted or Public | Responder | Public ↔ Unlisted, or back to Internal. Internal asks for confirmation, takes the page down and clears the token. |
| Copy private link | Unlisted | Responder | Copies https://status…/i/<token>/. The link of a merged incident redirects to the target. |
| Regenerate private link | Unlisted | Responder | Creates a new token. The old link stops working at once, and its cached response is cleared. |
| Page on-call | Escalation None or Done | Responder | Starts paging at round 1, without page_delay. |
| Merge into | Open incident (not Maintenance) | Responder | Pick an open incident. Alerts, scope rows and group keys move to it. Status → Merged. A published incident cannot merge into an Internal one. |
| Export affected resources | Always | Responder | CSV of the scope, expanded from the registry (hosts and VMs). |
| Resolve | Open incident | Responder | Dialog: final message, public. Refused while unsuppressed alerts fire, and offers "Silence the remaining N alerts for 4 hours and resolve". |
| Reopen | Resolved less than 7 days ago | Responder | → Investigating. Paging stays off until "Page on-call". |
| Start now | Maintenance, Scheduled | Responder | → In Progress. Locks the start and the scope. |
| Extend | Maintenance, In Progress | Responder | Sets a later scheduled_end. |
| Complete | Maintenance, In Progress | Responder | → Completed. After a 10-minute grace, alerts that still fail go into one incident. |
| Cancel | Maintenance, Scheduled | Responder | → Cancelled. |
On save. type and created_by_beacon cannot change. A maintenance needs start < end. A Public maintenance with no Maintenance impact row shows a warning.
Indexes. (status, type), (visibility, status), and an is_open check for the list filter and the invariant.
List view. name, title, type, status, severity, visibility, modified. Default filter: open only. The list has a "New maintenance" button. Colors: Triggered red, Investigating and Identified orange, Monitoring blue, Resolved green, maintenance purple.
statusPending · Firing · ResolvedresolutionCleared · Recovered · Resource removed · DisabledseverityruleregionincidentNULL or an open incident, never a closed oneresourceresource_typealert_keyFor example a mount point, or fast/slow for an SLO burnfirst_valuevalueWritten on transitions only. The form shows the live value from ClickHouse.detailstarted_atfired_atclean_sinceresolved_atsuppressedsuppressed_bySIL-00042, a maintenance, or a held removal| Action | Shown when | Role | What it does |
|---|---|---|---|
| Silence | Pending or Firing | Responder | Dialog with region, resource, rule and alert_key filled in. Duration 1 h, 4 h, 1 day, 7 days or custom (at most 30 days). Reason*. Creates a Silence. |
| Open runbook | The rule has a runbook URL | Responder | Opens it. |
Hidden. open_key (unique, NULL once resolved).
Indexes. (region, status, suppressed, incident) for the invariant, (rule, region, status), (incident, status), (resource, status), (status, resolved_at) for cleanup. Track changes off.
List view. resource, rule, severity, status, incident, started_at. Default filter: Pending or Firing. Sidebar filters: region, rule, resource_type, suppressed. Colors: Firing red, Pending orange, suppressed grey, Resolved green.
regionresource_typeresource_idinclude_descendantsA silenced host also mutes its VMsrulealert_keyexpires_atAt most 30 days from now. A silence starts when it is saved; use a maintenance for future work.revoked_atrevoked_byreasonmatching_htmlHow many open alerts it matches now| Action | Shown when | Role | What it does |
|---|---|---|---|
| Revoke | Active | Responder | Ends it now. At the next tick, matching alerts are no longer suppressed and join an incident. |
| Extend | Active | Responder | Sets a later expires_at, at most 30 days from now. |
| Show matching alerts | Always | Responder | Opens the Alert list with the same filters. |
State. Not stored. The list shows Active, Expired or Revoked from expires_at and revoked_at.
On save. The match fields cannot change after save. Create a new silence instead.
List view. name, reason, resource_id, rule, expires_at. Default filter: not expired.
titlerule_keyFile path in Beacon, or desk:<slug>severityLow · Medium · High · Criticalresource_typeHost, Server, Proxy Server, Region, …enabledkindSQL · SLO burn. Set once.serviceSLO burn rules onlyowner_teamrunbook_urlis_from_filequeryReturns resource_id, alert_key, value, detail. Hidden for SLO burn rules.interval60. pending_for must be at least the interval, except for SLO burn rules.pending_for300resolve_after120regionsEmpty = all regionsevaluations_htmlOne row per region: state, last success, duration, rows, last error, Run now| Action | Shown when | Role | What it does |
|---|---|---|---|
| Test | Kind SQL | Admin | Runs the query in every region. Shows rows, duration, 20 sample rows and contract errors. Saves nothing. |
| Silence rule | Always | Responder | Opens a new Silence with this rule. |
On save. A rule loaded from a file is read-only except enabled. Save runs the contract check in one region and refuses an error. It creates or disables the Rule Evaluation rows.
SLO burn rules. Beacon creates one per Service. The tick computes them from Service Minute and Service Day, with alert keys fast, medium and slow.
List view. title, kind, severity, resource_type, enabled. Red when an evaluation is Broken, orange when Erroring.
ruleregionstateHealthy · Erroring · Brokennext_run_atlast_run_atlast_success_atlast_duration_mslast_row_countunknown_rowsRows for resources not in the registryconsecutive_errorslast_error| Action | Shown when | Role | What it does |
|---|---|---|---|
| Run now | The rule is enabled | Admin | Queues this evaluation now. |
Index. (next_run_at) for the scheduler.
List view. rule, region, state, last_success_at, last_duration_ms. Sorted by state, Broken first.
resource_idresource_typeRegion · Host · Server · Proxy Server · …statusPending · Active · Suspended · Terminatedregionparent_resourcesourceEmpty for Region rows made by Beacontitletelemetry_idCentral server ID, from Central's map. Pilot's rows use it.active_sinceStart of the 10-minute graceterminated_atis_checkedActive, ancestors Active, monitoring on, removal not held. The grace is applied at filter time.path/bom-h12/server-a, for ancestor queriesrow_hashHidden. Lets the sync write only changed rows.monitoring_disabledNever check this resourcedisabled_reasondisabled_byremoval_heldMissing from a list that was heldnow_htmlOpen alerts on this resource, and open incidents that affect it through an ancestor| Action | Shown when | Role | What it does |
|---|---|---|---|
| Disable monitoring | Monitoring on | Admin | Dialog: reason*. Open alerts resolve as Disabled. |
| Enable monitoring | Monitoring off | Admin | Checks start again after the grace. |
| Silence | Always | Responder | Opens a new Silence for this resource. |
| Children | Always | Responder | Opens the Resource list filtered by parent. |
Cleanup. Beacon deletes a Terminated row after 90 days, the same as resolved alerts, so no alert link dangles.
Indexes. (region, path), (region, telemetry_id), (parent_resource), (source, status).
List view. resource_id, resource_type, status, region, parent. Sidebar filters: region, type, status, checked.
kindResources · Telemetry IDsregionRequired for Resources. Empty for Central.source_keyatlas, centraltitleAtlasenabledbase_urlBeacon calls /api/beacon/resources or /api/beacon/telemetry-idstokenlast_attempt_atlast_success_atrow_countorphan_countRows whose parent is unknownetaglast_errorheld_removalsheld_since| Action | Shown when | Role | What it does |
|---|---|---|---|
| Fetch now | Enabled | Admin | Fetches now without the ETag. Shows added, changed and removed rows. |
| Apply held removals | Removals held | Admin | Confirm dialog with the count and the first 20 IDs. Removes them, and their alerts resolve as "Resource removed". |
Telemetry IDs. A full fetch without the ETag every 15 minutes. It only writes telemetry_id on matching Resources, and never adds, removes or holds anything.
List view. kind, title, region, enabled, row_count, last_success_at. Red when no good fetch for 15 min, orange when removals are held.
regionbom. Set once.titleMumbaistatusActive · Disabledwildcard_domainbom.frappe.cloudclickhouse_urlclickhouse_databasedatumclickhouse_userbeacon (read-only)clickhouse_passwordtelemetry_stateOK · Unreachable · Suspecttelemetry_checked_atreporting_percentHosts that Atlas synced and that have a metald sample in 5 min. Under 50%: Suspect.show_on_status_pagesort_order| Action | Shown when | Role | What it does |
|---|---|---|---|
| Check connection | Always | Admin | Runs SELECT 1 as the beacon user and shows the latency and the profile limits. |
| Disable / Enable | Always | Admin | Disabled: no evaluation. The tick closes its open alerts as Disabled. |
On insert. Beacon creates a Resource of type Region for it. Region-wide alerts, such as SLO burns, use that resource.
List view. title, region, status, telemetry_state (green OK, orange Suspect, red Unreachable).
titleSitesservice_keyRead-only when loaded from a filescopeRegion · Globalshow_on_status_pagesort_orderis_from_fileregionsRegion scope. Empty = all.query_regionGlobal scope: the ClickHouse that has its telemetrydescriptionPublic. Shown under the service name.sli_queryReturns resource_id, good, valid, last_ts for each reporter seen in 30 minutesslo_targetDefault 99.9, over 30 days. Admins can change it.sla_targetOptional. The contract, lower than the SLO.page_on_burnOff: burn alerts are Medium (chat and email)| Action | Shown when | Role | What it does |
|---|---|---|---|
| Test | Always | Admin | Runs the SLI query in each region. Shows good, valid, the ratio and the status it would get. |
| View status | Always | Responder | Opens Service State for this service: status, budget left and burn rates per region. |
List view. title, scope, slo_target, show_on_status_page.
serviceregionchecked_atstatusOperational · Degraded · Partial Outage · Major Outage · Maintenance · Unknowncandidate_statusBecomes status after 3 minutes (worse) or 2 minutes (better)candidate_sincelast_ratiobudget_leftburn_rates14.4 and 6 pageHidden. last_counted_minute, so a minute is never counted twice.
List view. service, region, status (colored), budget_left, burn_rates, checked_at. This list is the control panel table on the workspace.
serviceregionminuteUTC, start of the minutestatusgoodvalid0 for an unknown minutebad_reportersA burn alert pages only with 3 or moreWhy. The burn windows up to 3 days sum these rows. About 40 rows a minute for 4 services in 10 regions, about 170,000 rows kept.
serviceregiondateUTC daygoodvaliddegraded_minutesoutage_minutesPartial or Majormaintenance_minutesExcluded maintenance onlyobserved_minutesDerived, not stored. Day SLI = good / valid. Unknown minutes = elapsed − observed. The status API and the SLO report compute them.
List view. Report view grouped by service and region. The status page reads 90 days, the 30-day budget reads 30 days.
respondersColumns: user*, phone, email (fetched from the user), active. Row order is the call order.primary_overrideChanged by "Set primary override"override_untilpage_delay_seconds90repeat_every_minutes15backup_after_minutes_critical2backup_after_minutes_high5max_rounds3, for High. Critical repeats until acknowledged.phone_calls_enabledtwilio_account_sidtwilio_auth_tokentwilio_from_numberemail_enabledemail_accountchat_enabledchat_webhook_urlstatus_page_titleFrappe Cloud Statusstatus_page_domainpaging_pausedChanged only by the actionspaused_reasonheartbeat_urlDead-man switchreopen_window_minutes30| Action | Shown when | Role | What it does |
|---|---|---|---|
| Set primary override | Always | Responder | Dialog: active responder and until. Paging calls this person first. |
| Pause paging / Resume paging | Always | Admin | Dialog: reason*. While paused, the tick sends no call or email. Escalations continue when paging resumes. |
| Send test page | Always | Admin | Dialog: responder and channel. Sends a test call, email or chat post. |
On save. Phone calls need at least one active responder with a phone number.
Constants, not settings. Retention: resolved alerts 90 days, cleared alerts 7 days, notifications 180 days, Service Minute 3 days. New-resource grace 10 minutes. Status thresholds 99.5 / 95 / 80 %.
incidentresponderchannelCall · Email · ChatstatusQueued · Sent · Answered · No answer · Acknowledged · Failedpage_roundprovider_refTwilio CallSidsent_atanswered_aterrorIndexes. (incident, sent_at), (provider_ref).
List view. incident, responder, channel, status, sent_at. The escalation step reads it.
9. Resource registry
Beacon needs to know which infrastructure exists, and how it nests: a host has VMs, and a VM can be a proxy node. It uses this to skip archived or stopped resources, to build incident scope, and to export who is affected. Sites are not in the registry. Pilot reports them as counts per VM.
The registry has one source in most regions: Atlas. It knows every host, VM and service node. A Resource Source row in Desk points Beacon at it. Another regional service that owns infrastructure can be added the same way. A region has about 10,000 rows.
GET {base_url}/api/beacon/resources Authorization: Bearer <token>
If-None-Match: "<etag>" -> 304 when nothing changed
200 ETag: "<count>-<max modified>" one gzip response, no paging
{"resources": [{"resource_id": "bom-h12", "resource_type": "Host", "parent_id": "",
"title": "bom-h12", "status": "Active"},
{"resource_id": "vm-7f3a", "resource_type": "Server", "parent_id": "bom-h12",
"title": "server-a", "status": "Active"}, ...]}
Server IDs from Central. Central mints and renews Pilot's Datum token with Central's server ID, so Pilot's rows in Datum carry that ID, not the Atlas VM ID. Central already knows the map from server ID to Atlas VM ID and region. It serves the map, and Beacon pulls it like a resource list. Atlas stores nothing extra.
GET {central_url}/api/beacon/telemetry-ids Authorization: Bearer <token> (ETag, as above)
{"telemetry_ids": [{"telemetry_id": "srv-a91c", "region": "bom", "resource_id": "vm-7f3a"}, ...]}
- Beacon writes
telemetry_idon the matching Resource. Rule and SLI rows match onresource_idortelemetry_id. - Every 15 minutes Beacon fetches the map without the ETag, so an entry that arrived before Atlas listed its VM is applied. Until then, that VM's rows count as
unknown_rows. A new VM is inside its 10-minute grace for most of that time. - If Central is down, the last map stays. Central decides nothing about which resources exist.
Contract for a source. The list is the current state from one read. The ETag comes from the row count and the newest modified time, so an unchanged list costs one cheap query. Rows have no fields that change on their own, such as usage numbers. A source sets a resource to Suspended or Terminated before it starts to tear it down.
- Poll and diff. Every minute, Beacon calls each enabled source with its last ETag. On a 200, it compares a hash of each row with the stored
row_hashand bulk-writes only the changed rows. It also updatespath(for example/bom-h12/server-a) andis_checked. - Removal needs two fetches. A row that is missing from two good fetches in a row becomes Terminated. One missing fetch changes nothing, so a short glitch in the source cannot close a real outage.
- Removal closes alerts at once. When a resource stops being checked (Terminated, Suspended, an ancestor not Active, monitoring disabled), the sync resolves its open alerts as "Resource removed" in the same transaction. That is not a recovery, and it pages no one.
- A failed fetch changes nothing. A timeout, a 5xx, bad JSON or a schema error keeps the last list. The Resource Source turns red on the control panel after 15 minutes.
- Large removals are held. If a list would uncheck more than 10% of the source's checked resources (descendants included), or if it is empty, Beacon applies the additions and changes but holds the removals. Held resources stay checked as before, with their alerts suppressed but not resolved. Beacon posts one chat message. An admin clicks "Apply held removals" when the removal is real.
- Unknown parent. A row whose parent is not in the registry keeps its last known parent, else it is a root. The source shows an orphan count.
- One owner for each resource. If a second source lists an ID that another source owns, Beacon ignores the row and shows a conflict on the source.
- What Beacon checks. A resource is checked if it is Active, all its ancestors are Active, monitoring is not disabled, and its removal is not held. The sync stores this as
is_checked. The 10-minute grace afteractive_sinceis applied when rows are filtered. A suspended host therefore also stops checks on its VMs. - ClickHouse does not get a copy. Rules and SLI queries return resource IDs. Beacon filters the rows with its own copy. So Beacon only reads ClickHouse.
10. Rules and evaluation
The standard cause rules
Cause rules name the broken thing. They are few on purpose. Each one points to one fix. They live in Beacon's repository under beacon/rules/.
| Rule | Signal | Fires when | Severity | Incident scope |
|---|---|---|---|---|
| Host down | atlas_host_sync_age_seconds{server} and the host's own metald samples | Sync over 300 s and no metald sample for 5 min, for 60 s | Critical | The host, with descendants |
| Atlas cannot sync host | The same | Sync over 300 s, metald still reports | High | The host only |
| VMs unavailable on host | metal_vm_unavailable, metal_vm_wanted_running | 3 or more and at least 20% of wanted VMs, for 5 min | High | The host, with descendants |
| Service node not ready | atlas_service_ready{node} | 0 for 3 min | High | The node |
| Host resources | metald system metrics | One rule per family (disk, memory, ZFS, failed units, …) ported from alerts.py. The check name is the alert_key. Interval 300 s. | Medium | The host |
| Atlas silent (built in) | Newest Atlas sample | Older than 5 min | Critical | The region |
| Region unreachable (built in) | ClickHouse probe | Fails 2 times in a row | Critical | The region |
-- beacon/rules/host-down.sql
-- severity: Critical resource_type: Host interval: 60 pending_for: 60 resolve_after: 120
SELECT a.server AS resource_id, '' AS alert_key, a.age AS value,
concat('no host sync for ', toString(round(a.age)), ' s, metald silent') AS detail
FROM (SELECT labels['server'] AS server, value AS age
FROM datum.latest_value(metric = 'atlas_host_sync_age_seconds', window = 900)) AS a
LEFT JOIN (SELECT resource_id, max(ts) AS last_ts FROM datum.samples_recent
WHERE metric = 'metal_build_info' AND ts > now() - INTERVAL 15 MINUTE
GROUP BY resource_id) AS m ON m.resource_id = a.server
WHERE a.age > 300 AND m.last_ts < now() - INTERVAL 5 MINUTE
Atlas reports an age for every Running host, so the rule needs no list of expected hosts. A host's Datum token uses the host name, so resource_id and the server label match. A missing metald row reads as the epoch, which counts as silent. If Atlas itself stops, the ages stop too, and "Atlas silent" fires instead.
One evaluation
Every minute, the scheduler queues each due Rule Evaluation as a job with ID evaluate:{rule}:{region}. A region runs at most 2 jobs at a time, so one slow region cannot hold every worker. Each job does this:
1. Region Unreachable? -> skip, and count the skip as a run. The region alert covers it.
2. Run the SQL as the beacon user. HTTP timeout = max_execution_time + 5 s.
Error, duplicates, or over 50,000 rows? -> consecutive_errors += 1; stop. Nothing changes.
3 errors in a row -> Broken: red on the control panel, in one chat digest per region per hour.
3. Gap since last_success_at > 3 x interval? -> reset started_at (Pending) and clean_since.
4. Drop rows for unknown or unchecked resources (count unknown_rows).
5. Diff with open alerts:
new row -> Pending (Firing at once if pending_for = 0), suppression computed now
row, alert Pending -> Firing once failing for pending_for
row, alert Firing -> clear clean_since
no row, alert Pending -> Resolved (Cleared)
no row, alert Firing -> set clean_since; Resolved (Recovered) after resolve_after
6. Write the changes with bulk SQL, in chunks of 1,000 rows. The open_key makes a retry safe.
7. If this run wrote a transition, enforce the incident invariant for this region.
Timers measure continuous time. pending_for must be at least the interval. Suppression is computed when an alert is created, and when a silence or maintenance starts, ends or changes (in the tick). It is not recomputed on every run.
11. SLOs and error budgets
This follows the Google SRE book and workbook. An SLI (service level indicator) is the share of good events: good ÷ valid. An SLO (service level objective) is the target for that share over 30 days. It is a field on each Service, 99.9% by default, and an admin can change it. The error budget is what the SLO allows to fail: 0.1% of the valid events. An SLA is a promise to customers, so it is lower than the SLO and has a contract behind it. It is an optional field on the Service, and Beacon only reports on it.
The v1 SLIs
| Service | Good | Valid | From | SLO |
|---|---|---|---|---|
| Sites (per region) | Sites up | Up + platform_down. App errors and maintenance are left out. | Pilot, each minute, summed per VM (site-minutes) | 99.9% |
| Networking (per region) | Requests the proxy did not fail | All requests. platform_error = 502, 503 or 504 made by the proxy, or an upstream connect error. | Proxy access-log counters | 99.9% |
| Servers (per region) | Wanted VMs that are available | Wanted running VMs | metald, each minute (VM-minutes) | 99.9% |
| Object storage (per region) | Gateway requests without a 5xx | All gateway requests | Storage gateway counters | 99.9% |
| Dashboard and API (global, phase 4) | Requests without a 5xx | All requests | Central counters, when Central ships them | 99.9% |
Every target in the table is the default. Change it on the Service; the burn rates and budgets use the new value from the next minute.
An SLI query returns one row per reporter seen in the last 30 minutes: resource_id, good, valid, last_ts. Beacon drops the rows of resources that are not checked, or that are inside a Public maintenance announced in advance. A reporter with no sample for 3 minutes counts its last valid as bad only while it or an ancestor has a Firing cause alert, such as "Host down". Otherwise it is left out. So a dead host counts its VMs and sites as down, and a Pilot restart, a sleeping VM or a Datum ingest gap never looks like an outage.
-- beacon/services/sites.sql (one row per VM seen in the last 30 minutes)
-- Pilot ships all four states with one timestamp, summed over the VM's benches.
SELECT resource_id,
argMaxIf(value, ts, labels['state'] = 'up') AS good,
good + argMaxIf(value, ts, labels['state'] = 'platform_down') AS valid,
max(ts) AS last_ts
FROM datum.samples_recent
WHERE metric = 'pilot_sites' AND ts > now() - INTERVAL 30 MINUTE
GROUP BY resource_id
Burn-rate alerts
The burn rate is how fast the budget goes: (1 − good ÷ valid) ÷ (1 − SLO). A burn rate of 1 uses the whole 30-day budget in 30 days. Beacon uses the three alerts from the SRE workbook. An alert fires only if both its long and short window are over the rate. The long window proves the problem is real. The short window makes the alert resolve a few minutes after the fix.
| Budget used | Long window | Short window | Burn rate | Alert |
|---|---|---|---|---|
| 2% | 1 hour | 5 min | 14.4 | High, pages |
| 5% | 6 hours | 30 min | 6 | High, pages |
| 10% | 3 days | 6 hours | 1 | Low, chat and email |
- A window with fewer than 100 valid events does not alert. A burn alert pages only when 3 or more reporters are bad in its short window. With fewer, it is Low. So one VM in a small region, or one bench of 30 sites, never pages.
- A burn alert is a normal Alert. Its rule is the service's built-in "SLO burn" rule, its resource is the Region resource, and its
alert_keyisfast,mediumorslow. It haspending_for0 andresolve_after5 minutes. A service withpage_on_burnoff gets Medium instead of High. A global service uses the Global resource, which Beacon creates. A minute with no valid data changes nothing, the same as a query error. - Each minute, Beacon writes good, valid and the number of bad reporters to Service Minute, kept 3 days, and adds good and valid to Service Day. Windows up to 3 days sum Service Minute. The 30-day budget sums Service Day. An unknown or excluded minute adds nothing.
On the control panel
The workspace shows one row per service and region: status, the SLI of the last hour, budget left for 30 days, and the 1-hour and 6-hour burn rates. The "SLO and SLA" report shows each month: SLI, budget used, and whether the SLA was met. We do not automate SLA credits or release freezes. The budget is the input for that conversation.
12. Incidents and impact
The invariant
After every evaluation and every tick, Beacon takes one advisory lock for the region. It finds Firing, unsuppressed alerts with no incident (indexed: incident IS NULL). An open alert's incident is always empty or an open incident, because resolve and merge clear or move it. For each alert, in order:
- Ancestor. An open incident has a scope row that covers the alert's resource through its path. Join it.
- Cause. The alert is an SLO burn. Join the newest open incident in its region that has a Firing cause alert. Else join the newest incident in the region opened in the last 30 minutes.
- Group. An open incident has the alert's group key (rule and region) in its
group_keys, and it is Triggered or less than 30 minutes old. Join it. An older, acknowledged incident does not swallow a second outage. - Reopen. An Internal incident made by Beacon with that group key was resolved less than 30 minutes ago. Reopen it to Triggered and clear the acknowledgement.
- Create. Create an Internal incident in Triggered. If the resource has no parent, paging starts at once. Otherwise it waits
page_delay(90 s), so a parent incident can take it.
A new cause alert in a region whose open incident has only burn alerts joins that incident and adds its scope row.
Joining is never silent. Every alert that joins posts to the incident's chat thread. A higher severity notifies again. An incident in Monitoring goes back to Investigating and pages again.
Merging. When an incident opens with a scope that covers alerts of another open, unacknowledged, Internal incident, only the covered alerts move. The other incident becomes Merged only when it is empty. Staff can merge by hand. A manual merge also moves the group keys, so the next alert of a merged region joins the target.
Scope. "Host down" and "VMs unavailable on host" incidents get the scope row "this host, include descendants". Other incidents start with the scope of their alerts. Staff can add rows.
Host bom-h12 fails Proxy bom-proxy-2 fails
host bom-h12 <- scope row, proxy node bom-proxy-2 <- scope row
├── vm server-a include descendants affected service: Sites · bom = Degraded
└── vm server-b (shown to customers once published)
1 incident, 1 update stream, 1 private link. No row for each VM or site.
Who is affected? "Export affected resources" lists the hosts and VMs in scope. The sites on those VMs come from Central in phase 4.
Closing and publishing
- An Internal incident made by Beacon resolves itself when all its alerts are resolved.
- An Unlisted or Public incident waits for a person. Beacon posts "all alerts resolved" to chat after 30 minutes.
- Staff cannot resolve an incident while unsuppressed alerts fire. The Resolve dialog offers "Silence the remaining alerts for N hours and resolve".
- The Publish action is one dialog: Unlisted or Public, affected services with impact, and the first public message. Unlisted creates a 32-character token.
13. Maintenance and muting
| Use | When | Alerts | SLO |
|---|---|---|---|
| Maintenance | Planned work with a start and an end | Recorded, suppressed in its scope. With mute_slo_burn (on by default), the burn alerts of its regions are suppressed too. | Reporters in its scope are left out only if it is Public and created before it starts |
| Silence | A mute for a known problem, from now, up to 30 days, with a reason. It can include descendants. | Recorded, suppressed | Counted |
monitoring_disabled | A resource we never want to check, with a reason | Not evaluated | Its rows are dropped |
- A maintenance's start and scope lock when it starts. Its end can be extended until it passes.
- An Internal maintenance never changes the public page. Its downtime counts in the SLO, because customers felt it.
- No storm after a window. Suppression continues for 10 minutes after the end, so rebooted hosts can come back. Then Beacon takes the alerts in its scope that still fire and are not covered by another silence or maintenance, and puts them into one incident, "Still failing after <maintenance title>".
14. Service status and uptime
A service is one line on the status page, such as "Sites · bom". Its status comes from the SLI of the last minute: good ÷ valid over the checked reporters.
Checked in this order:
region Unreachable or Suspect, or no valid data, for 3 minutes -> Unknown
Public In Progress maintenance with this service (impact Maintenance) -> Maintenance
ratio >= 99.5% Operational, >= 95% Degraded, >= 80% Partial Outage, else Major Outage
Damping: a worse status must hold for 3 minutes, a better one for 2 minutes.
Shown on the page: worst(status, impact of open Public incidents)
Unknown: grey "Status unavailable", never the last green state.
- Uptime on the page is the measured SLI: good ÷ valid for the day and for 90 days. Days with less than 90% coverage show it.
- Bars show the worst status of the day, published incident impact included. Hover shows the minutes in Degraded and in outage.
- Health counts platform failures only. A site with a broken app is up for the platform. Pilot handles it with the owner.
15. On-call and paging
| Severity | Chat | Email to responders | Phone call | Backup after |
|---|---|---|---|---|
| Critical | Yes | Yes | Yes | 2 min |
| High | Yes | Yes | Yes | 5 min |
| Medium | Yes | Yes | No | n/a |
| Low | Yes | No | No | n/a |
- Who is called. The primary override until
override_until, if that person is an active responder, else the first active responder, then down the list. A new round starts every 15 minutes. High stops after 3 rounds and turns red on the control panel. Critical repeats until someone acknowledges. - Acknowledgement is a key press. Twilio
<Gather>asks for 1. OnlyDigits=1counts. Beacon checks the Twilio signature, matches the CallSid to the Notification, followsmerged_intoto the open incident, and ignores repeated callbacks. Any staff action on a Triggered incident also acknowledges it. - Escalation state is on the incident (
escalation,page_round,page_index,next_page_at). The tick and the Twilio callback lock the incident row before they change it. - Paging pause.
paging_pausedstops all calls and emails, for example after a database restore. The workspace shows it in red. - Desk buttons: "Page on-call" on an incident, and "Send test page" in Beacon Settings.
16. State handling
Alert
| From | Event | To | Side effects |
|---|---|---|---|
| none | Row for a checked resource | Pending, or Firing if pending_for = 0 | Suppression computed |
| Pending | Failing for pending_for | Firing | Invariant: join or create an incident |
| Pending | No row after a good query | Resolved (Cleared) | Deleted after 7 days |
| Firing | No row for resolve_after | Resolved (Recovered) | Incident may resolve itself |
| Firing | Row again before resolve_after | Firing | clean_since cleared |
| Pending, Firing | Query error, region Unreachable | No change | Gap rule at the next success |
| Pending, Firing | Resource no longer checked (registry sync) | Resolved (Resource removed) | Not a recovery. One summary line on the incident. |
| Pending, Firing | Rule or region disabled, monitoring disabled | Resolved (Disabled) | The tick or the sync |
| Pending, Firing | Removal held | No change | Suppressed until applied |
Incident
| From | Event | To | Side effects |
|---|---|---|---|
| none | Invariant creates it | Triggered | Paging starts, or waits page_delay |
| Triggered | Acknowledge, key press, or any staff action | Investigating | Escalation Done |
| Investigating, Identified, Monitoring | Post update | Investigating, Identified, Monitoring or Resolved | Resolved runs the resolve check |
| Monitoring | An alert joins | Investigating | Pages again |
| Any open | All alerts resolved, Internal, made by Beacon | Resolved | Chat post |
| Any open | All alerts resolved, Unlisted or Public | No change | Chat post after 30 min |
| Any open | Resolve with unsuppressed alerts firing | Refused | Dialog offers a silence |
| Any open | Merged by scope (emptied) or by hand | Merged | merged_into set; group keys move on a manual merge |
| Resolved | New alert in its group within 30 min, Internal, made by Beacon | Triggered | Acknowledgement cleared, paging restarts |
| Resolved | Reopen by staff, within 7 days | Investigating | No paging until "Page on-call" |
Maintenance
| From | Event | To | Side effects |
|---|---|---|---|
| none | Created | Scheduled | excluded_from_slo set if Public and before the start; mute_slo_burn on by default |
| Scheduled | scheduled_start, or Start now | In Progress | Scope and start lock. Alerts in scope suppressed. |
| Scheduled | Cancel | Cancelled | None |
| In Progress | scheduled_end, or Complete | Completed | 10-minute grace, then "Still failing after…" |
Silence
| From | Event | To | Side effects |
|---|---|---|---|
| none | Created | Active | Matching alerts suppressed |
| Active | expires_at reached, or Revoke | Expired, Revoked | Alerts unsuppressed, invariant runs |
Escalation (on the incident)
| From | Event | To | Side effects |
|---|---|---|---|
| None | Incident created, resource has a parent | Waiting | next_page_at = now + page_delay |
| None, Waiting | Time reached, or no parent, or Page on-call | Calling | Call the first responder |
| Calling | No key press after "backup after" | Calling | Next responder; a new round after the last |
| Calling | Key press, Acknowledge, staff action | Done | Notification Acknowledged |
| Calling | 3 rounds without an answer, severity High | Done | Red on the control panel, chat post. Critical keeps calling. |
| Waiting, Calling | Incident merged or resolved | Done | None |
| Calling | paging_paused | Calling | No call while paused; continues on resume |
Registry resource
| From | Event | To | Side effects |
|---|---|---|---|
| none | Listed | Its status | Active sets active_since |
| Pending, Suspended, Terminated | Listed as Active | Active | New active_since, so the grace applies again |
| Active | Listed as Suspended | Suspended | Its alerts and its descendants' alerts resolve as "Resource removed" |
| Any | Listed as Terminated, or missing from 2 good fetches | Terminated | Same. Row kept 90 days. |
| Any | The list would uncheck over 10%, or is empty | No change | removal_held, chat post, admin applies |
| Any | Fetch fails | No change | Source red after 15 min |
Rule evaluation and region telemetry
| Item | From | Event | To |
|---|---|---|---|
| Rule Evaluation | Healthy | Query error | Erroring |
| Rule Evaluation | Erroring | 3 errors in a row | Broken (control panel, one chat post) |
| Rule Evaluation | Erroring, Broken | A good query | Healthy |
| Region | OK | ClickHouse probe fails 2 times | Unreachable: one Critical alert, rules skipped, status Unknown |
| Region | OK | Over 50% of hosts that Atlas synced are silent in Datum | Suspect: rules run, status Unknown after 3 minutes, silent reporters left out |
| Region | Unreachable, Suspect | 2 good checks | OK |
Service status
| From | Event | To |
|---|---|---|
| Any | A worse computed status for 3 minutes | That status |
| Any | A better computed status for 2 minutes | That status |
| Any | Region Unreachable or Suspect, or no valid data, for 3 minutes | Unknown (grey) |
| Any | Public maintenance In Progress with this service | Maintenance at once |
17. Scenarios
Each row is an acceptance test. The game day in phase 2 runs the rows without SLOs. Phase 3 runs the rest.
| Scenario | What happens |
|---|---|
| Leaves: the owner layer handles it | |
| One customer site returns 500 from its own code | Pilot counts app_error and tells the owner. Not in the Sites SLI. No Beacon alert. |
| One site's bench refuses connections | Pilot counts platform_down and tells the owner. One bad reporter: at most a Low burn alert, no page. |
| One VM crashes and does not restart | metald counts it unavailable. The Servers SLI drops a little. One bad reporter: no page. |
| A customer stops their VM, or a Sleepy VM sleeps | Not wanted running, so not in the Servers SLI. Its Pilot goes silent with no cause alert, so it is left out of the Sites SLI. |
| A Pilot release restarts every Pilot in bom | Pilots silent for a minute are left out. No burn, no page. |
| One level up: Beacon acts | |
| A host loses power (30 VMs, 400 sites) | "Host down" fires after about 6 minutes: one Critical incident with the host and descendants, one call. The Sites and Servers burns stay under the fast page. If the outage lasts 3.6 hours, the Servers 6-hour alert joins this incident. |
| A host's storage stalls and its VMs hang | metald counts them stuck or unavailable. "VMs unavailable on host" fires after 5 minutes over 20%: one High incident for the host. |
| A bad bench update breaks 3% of benches in bom | No cause rule matches. The Sites SLO burns at 30: the fast alert pages after about 30 minutes, when the 1-hour window passes 14.4. The incident has region scope. |
| A slow leak: 0.3% of sites fail all week | Burn rate 3. No page. After about a day the 3-day window passes 1, and a Low alert goes to chat and email. |
| The proxies in bom fail 20% of requests | Pilot pings on loopback stay green. The Networking SLO burns at 200 and pages after about 4 minutes. |
| One proxy node stops being ready | "Service node not ready" after 3 minutes: High incident for the node. If requests fail, the Networking burn alert joins it, because it has a firing cause alert. |
| Object storage gateways return 5xx for 10% of requests | The Object Storage SLO burns at 100: the fast alert pages after about 9 minutes. |
| A small region: 1 VM of 100 is down | The Servers burn rate is 10, and only 1 reporter is bad: a Low alert, no page. |
| A second host dies an hour after the first, whose incident is acknowledged | The group join only works within 30 minutes or while Triggered. A new incident and a new call. |
| Watchers fail | |
| Atlas in bom stops (job queue dead) | Host ages stop updating. "Atlas silent" fires after 5 minutes: one Critical region incident. Host-down cannot fire without data, which is correct. |
| Atlas's host sync job is stuck, but metald reports | "Atlas cannot sync host" (High) for each host, in one incident through the group key. No Critical, no descendants. |
| Datum or ClickHouse in bom is down | Region Unreachable: one Critical alert. Rules skipped. bom shows grey "Status unavailable" after 3 minutes. |
| Datum ingest lags, ClickHouse is up | Hosts that Atlas syncs are silent in Datum: region Suspect. Silent reporters are left out, so no burn alert. |
| A slow ClickHouse makes 8 rules time out | Those evaluations turn Erroring, then Broken. One chat digest. No page. |
| Central is down | The last server ID map stays. Rules and SLIs keep working. Only VMs created during the outage are unmatched until it returns. |
| Atlas's resource endpoint fails | The registry keeps its last list. The source turns red after 15 minutes. No false alerts. |
| A bug makes Atlas return an empty list | Removals held. Alerts keep firing. One chat post. An admin checks before applying. |
| Beacon's site is down | The heartbeat stops. The dead-man switch calls the on-call engineer. |
| Lifecycle and muting | |
| A host is archived in Atlas | Terminated after 2 fetches, or at once when listed as Terminated. Its alerts resolve as "Resource removed". |
| Kernel update on 3 hosts, internal | Internal maintenance with the hosts and descendants, mute_slo_burn on. No pages. Public page unchanged. The downtime counts in the SLO. |
| Announced object storage upgrade in sin | Public maintenance with Object Storage · sin = Maintenance. Purple on the page. Reporters in scope are left out of the SLO. |
| Hosts still reboot when a maintenance ends | 10-minute grace. Only what still fails after that goes into one incident. |
| A host is silenced for a disk swap | The silence includes descendants, so its VMs' alerts are muted too. |
| Paging and incidents | |
| Nobody answers the call | Backup after 2 or 5 minutes, then a round every 15 minutes. High stops after 3 rounds and turns red. Critical keeps calling. |
| Someone presses 1 just after a merge | The callback follows merged_into and acknowledges the target. |
| An incident in Monitoring gets a new alert | It goes back to Investigating and pages again. |
| Staff merge the fra incident into the bom one | The group keys move. The next fra alert joins the bom incident while it is young. |
| An engineer tries to resolve while alerts fire | Refused. The dialog offers a silence for the remaining alerts. |
| An Unlisted link is regenerated | The old link stops working at once. The action clears its cached response. |
18. Integrating a V2 service
A service team does up to three small things. Most services need only the first.
1. Report what you watch, as counts
If your service watches things below it, report how many there are and how many fail, each minute. Do not add a label for each item. A site, a VM or a request is never a label value. A host or a service node can be one, because there are few of them.
# Pilot, once a minute per VM (datum_client)
batch = Batch("pilot", "sites") # counts summed over every bench on the VM
for state in ("up", "app_error", "platform_down", "maintenance"):
batch.gauge("", counts[state], ts=when, state=state) # -> pilot_sites{state}, one ts
Go services expose Prometheus /metrics on localhost. A service that only writes an access log can turn it into counters with Vector's log_to_metric, as the proxy does. The Vector on the node scrapes it and sends it with remote write to /v1/ingest/remote. Use one Datum sink per machine, because Datum allows 12 requests a minute per token.
# /etc/vector/conf.d/http-proxy.toml
[sources.http_proxy]
type = "prometheus_scrape"
endpoints = ["http://127.0.0.1:9180/metrics"]
scrape_interval_secs = 15
# add "http_proxy" to the inputs of the node's existing Datum sink
2. If customers use it, define an SLI
Add beacon/services/<name>.sql. It returns one row per reporter seen in the last 30 minutes: resource_id, good, valid, last_ts. The header sets the title, scope and slo_target. Count only failures that the platform causes.
3. Add a cause rule only if it points to one fix
Add beacon/rules/<name>.sql. A family of checks is one rule, with the check name as alert_key. It returns only failing rows: resource_id, alert_key, value, detail. Do not add a rule for a single leaf that your own layer already handles. Use the views that Datum provides, so that counters and freshness are right:
| View | Returns |
|---|---|
counter_increase(metric, window) | resource_id, labels, increase, with counter resets handled for each series |
latest_value(metric, window) | resource_id, labels, value, ts, the newest sample in the window |
CREATE VIEW datum.counter_increase AS -- parameterized view, shipped by Datum
SELECT resource_id, labels, length(vals) AS samples,
arraySum(arrayMap((d, v) -> if(d >= 0, d, v), arrayDifference(vals), vals)) AS increase
FROM (
SELECT resource_id, labels, arrayMap(x -> x.2, arraySort(groupArray((ts, value)))) AS vals
FROM datum.samples_recent
WHERE metric = {metric:String} AND ts > now() - toIntervalSecond({window:UInt32})
GROUP BY resource_id, labels
);
-- A drop means a reset: the new value is growth. Tested in clickhouse local 26.10.
Where the files live
In v1, rules and SLIs live in Beacon's repository. A team opens a pull request there. Beacon loads the files on bench migrate, and a loaded rule is read-only in Desk except enabled. The Test button on the Alert Rule and Service forms runs a query in every region and checks the contract. Sync from each team's own repository can come later, when more teams write rules.
19. REST API
Desk forms call whitelisted methods on their DocType with frm.call. Internal scripts call the same methods through native Frappe document routes. There is no custom internal /api/beacon/ action layer.
| Method and path | Auth | Purpose |
|---|---|---|
POST /api/v2/document/Beacon%20Incident/{name}/method/acknowledge | Responder | The same acknowledgement guard as Desk. |
POST /api/v2/document/Beacon%20Incident/{name}/method/resolve | Responder | Refuses resolution while unsuppressed alerts fire. |
POST /api/v2/document/{encoded DocType}/{name}/method/{method} | Authorized staff | Other internal document actions. Each controller owns its permission and state checks. |
GET /api/beacon/resources | Source token | External Resource Source contract that Beacon reads; this is not an internal Beacon action route. |
GET /api/beacon/telemetry-ids | Source token | External telemetry mapping contract that Beacon reads. |
POST /api/method/beacon.api.twilio.voice | Twilio signature | Returns the call prompt and Gather response. |
POST /api/method/beacon.api.twilio.gather | Twilio signature | Digit 1 acknowledges the incident. |
POST /api/method/beacon.api.twilio.status | Twilio signature | Updates notification delivery status. |
The public Vue app at / calls guest methods under /api/method/beacon.api.status.: get_status, get_history, get_incident and get_unlisted_incident. Only published data is returned. Cached results last 60 seconds. Publication and public changes clear the affected cache keys.
The current review identifies gaps in impact preservation, side-effect-free read helpers and public freshness. These are proposed corrections, not new action routes.
Customer rules and the Central event outbox remain outside the first version.
20. Status page
The mockups are in moki, project beacon-status, version 4. They have three layouts for the main page, a public incident page, an unlisted incident page and a history page. The ideas come from DigitalOcean (regions as rows), Railway and Cloudflare (90-day bars), Fly.io (region grid) and Hetzner (unlisted incident links).
- Recommended: regions first. At the top there is a banner, then active incidents and maintenance. Below that, each region is one row that opens to its services with 90-day bars. The global services come last.
- Beacon serves the page at
/as a small Vue app. Nothing is built or uploaded on publish. The app currently shows "Updated <time>" from response generation. This does not prove that measurements are current; see the freshness finding. - A region with Unknown status shows grey "Status unavailable", never its last green state.
21. Desk control panel and roles
Design intent. The implemented dashboard currently has six counts, two Quick Lists and shortcuts. The operational banners and evidence described below are proposed work. See the reviewed hierarchy.
The Beacon workspace is the control panel. From top to bottom:
- Red banners:
paging_paused, no active responder with a phone, an escalation with no answer, a heartbeat problem. - Open incidents, then Firing alerts that are not suppressed.
- The SLO table: one row per service and region, with status, the SLI of the last hour, budget left for 30 days, and burn rates. Red when a budget is under 25%.
- Health of Beacon's inputs: regions (OK, Suspect, Unreachable), Resource Sources (age, held removals), broken rules.
- Who is primary now.
Working an incident: Acknowledge → Post update → Publish (if customers need to know) → Resolve → write the RCA. The DocType reference lists every button and when it shows.
| Role | Can |
|---|---|
| Beacon Responder | Acknowledge, update, publish and resolve incidents. Create maintenance and silences. See private links. Set the primary override. |
| Beacon Admin | Everything above. Also rules, services and SLOs, regions, resource sources, monitoring on resources, the responder list, channels and paging pause. |
The Beacon site's system time zone is UTC. Forms show UTC next to time fields.
22. Changes in Datum and other services
Datum
We reviewed frappe/datum for the expected load. We checked each finding in the code. Datum stamps each sample with the resource_id of the token (routes/v1/ingest.py), which is why sites report through Pilot's counts.
| # | Finding (verified) | Change |
|---|---|---|
| 1 P1 | Each request is one ClickHouse insert, without async_insert (providers/clickhouse.py). Many small parts make merges fall behind. | Insert with async_insert=1, wait_for_async_insert=1. |
| 2 P1 | samples is ordered by (resource_id, metric, ts). Beacon asks for "metric X, all resources, last minutes". | Add samples_recent: ORDER BY (metric, ts, resource_id), daily partitions, TTL 2 days, filled by a materialized view. Add the views counter_increase and latest_value. |
| 3 P1 | The insights reader can create and drop views and has no limits. | Add a read-only beacon user: max_execution_time=20, memory and thread limits, 4 concurrent queries. |
| 4 P2 | samples and logs have no TTL. | Set a budget, for example 30–45 days of samples and 14–30 days of logs. Beacon keeps its own daily SLO counts, so no long rollup is needed for it. |
| 5 P2 | A write that ClickHouse refuses under load returns 400 (not retryable). | Return 503 for overload errors. Align the client and server timeouts. |
| 6 P2 | Sample timestamps are not bounded. | Reject samples more than 5 min in the future or more than 2 days old. |
| 7 P2 | datum_client logs "unreachable" only at debug level. | Log it as a warning, rate-limited. |
Other services
| Service | Change | Size |
|---|---|---|
| Pilot | The uptime monitor already pings every site. Each minute, ship pilot_sites{state} through the existing MetricShipper, summed over the VM's benches, all four states with one timestamp. Classify each failed ping with the table in "Who watches what". | Small |
| Atlas | Serve GET /api/beacon/resources: hosts, VMs and service nodes with parent and status, and the ETag. Ship atlas_host_sync_age_seconds for every Running host: today latest_usages() drops hosts with no sync in the last hour. | Small |
| Central | Keep minting Pilot's Datum token with the server ID (central/api/pilot.py), so Central's metrics keep working. Serve GET /api/beacon/telemetry-ids: server ID, region and Atlas VM ID for every server, with an ETag. Central already stores this (atlas_vm_id). | Small |
| Metal | None. metald already ships metal_vm_wanted_running, metal_vm_unavailable{reason} and metal_build_info. | None |
| HTTP proxy | Vector log_to_metric on the existing JSON access log: proxy_requests_total{class}. No proxy code change. | Config, phase 3 |
| Storage gateway, Central | Request counters by status class, for their SLIs. | Small, phase 3 and 4 |
23. Scale numbers
| Load | Per region | All regions |
|---|---|---|
| Registry poll (every minute, with ETag) | 1 request, mostly 304. About 10,000 rows when it changes. | 10 requests/min |
| Cause rule queries (about 10 rules; check families every 5 minutes) | about 6/min | about 60/min |
| SLI queries (4 services) | 4/min, a 30-minute scan, about 5,000 rows out | 40/min |
| Service Minute writes | About 40 rows a minute in one bulk insert | |
| Alerts in a host failure | 1 or 2 rows. Sites never become alert rows. | |
| Status page | Each API response is computed at most once a minute. Readers get the Redis copy. | |
4 RQ workers on the beacon queue are enough. Most queries take 0.1–2 s on samples_recent.
24. Rollout and checks
| Phase | Scope | Done when |
|---|---|---|
| 0. Inputs | Datum changes 1–3. Pilot ships pilot_sites. Atlas serves the resource list and reports an age for every Running host. Central serves the server ID map. | A sample rule runs in under 2 s. Every VM in one region reports pilot_sites, and Beacon matches it through telemetry_id. |
| 1. Rules and incidents, chat only | Region, Resource Source, Resource, Alert Rule, Rule Evaluation, Alert, Silence, Incident, chat posts. Port the checks in alerts.py as rule families. | 2 weeks next to the Insights alerts: every real Insights post has a Beacon alert, with no duplicate episodes. |
| 2. Paging | Escalation, Twilio, email, maintenance, roles, the control panel. | The scenario rows without SLOs pass on a game day. |
| 3. SLOs and status page | Proxy counters, Services, SLIs, burn alerts, Service Minute and Day, the SLO report, Publish, unlisted links, the status page app. | One month in which burn alerts match real incidents and the page matches the incidents. Then turn off the Insights alerts. |
| 4. Central | Outbox, affected sites, customer rules. | Central shows unlisted incidents to the affected teams only. |
25. What we do not build
- Checks for a single site or VM. Their owner layer has them.
- Probes of public URLs. They would wake Sleepy VMs and duplicate Pilot.
- Anomaly detection or learned baselines. Fixed thresholds and SLO burn rates first.
- SLA credits, and release freezes driven by the error budget.
- A staff web app, Python rules, a copy of the metrics, a CRUD API that copies Desk.
- Shift calendars, SMS, several on-call teams, email subscriptions.
- Rule sync from each team's repository, for now. Rules come through pull requests to Beacon.
- Automatic publishing or automatic reopening of public incidents.
26. Open questions
- Which SLA do we promise customers for each service? The field is ready; the number is a business decision.
- Pilot: does the platform_down and app_error table in "Who watches what" match what support sees?
- Where does Beacon run? Which dead-man switch service? The status page is down when Beacon is down, so Beacon must run outside our regions.
- What is the retention budget for raw samples and logs?
- Is a primary override enough on day one, or do we bring back the V1 night-shift table?
27. Sources
- Google SRE: Service Level Objectives, Monitoring Distributed Systems (symptoms against causes), Implementing SLOs, Alerting on SLOs (multiwindow, multi-burn-rate alerts)
- frappe/datum:
datum/api/routes/v1/ingest.py,migrations/*.sql,providers/clickhouse.py,datum_client/ - frappe/atlas:
scripts/insights/alerts.py,atlas/atlas/core/telemetry/collectors.py(host sync age, node readiness),metal/internal/vm/telemetry.goandavailability.go(VM availability), Atlas API - Pilot:
pilot/core/site/uptime_monitoring.py(site pings),pilot/core/server/monitoring_datum.py(MetricShipper) - frappe/press Incident, Prometheus Alert Rule, Silenced Alert
- ClickHouse: asynchronous inserts, parameterized views, settings profiles
- Twilio <Gather>, Vector prometheus_scrape
- Status pages: DigitalOcean, Railway, Cloudflare, Fly.io, Hetzner