Beacon telemetry map

Beacon is the incident manager and status page of Frappe Cloud V2. Each product sends its telemetry to the Datum of its region. Beacon reads Datum, matches each row to a resource, and turns failing rows into alerts, incidents and pages. This page shows what each product sends, how Beacon maps it, the services and their SLOs, and the 59 alert rules (Atlas 32, Cargo 15, Central 7, Pilot 5).

State of Beacon develop and the open pull requests on 14 November 2026: beacon, datum#20, atlas#607, cargo#141, central#714, pilot#828. The contract is docs/telemetry.md in frappe/beacon.

How it fits

The problem: many products send data, but an alert must name one resource that a person can fix. So every product sends with one ID for each machine, and the resource sources list the same IDs.

The token sets the resource ID of each row. A producer cannot set it.
  1. A producer collects a value and sends it to the Datum of its region with a token. The token holds the resource ID.
  2. Datum validates the request and writes the rows to ClickHouse. Materialized views copy new samples to samples_recent (2 days) and machine metrics to samples_5m (90 days).
  3. Each minute, Beacon reads the resource list of each region from Atlas. It keeps the resources, their parents and their status.
  4. Beacon runs each rule and each SLI on ClickHouse as the select-only beacon user. It keeps a row only when its resource_id is a known, checked resource of a type that the rule names, and monitoring is on for it.
  5. Beacon turns rows into alerts, alerts into incidents, and incidents into pages and chat posts. A person decides what the status page shows.

Resource map

Beacon matches a rule row by its resource_id only. There is no second ID. The resource_type line of a rule names the registry types of its rows, and Beacon drops a row of any other type. A query can leave out the resources with monitoring disabled with {excluded:Array(String)}. So the important rule is: the ID that a machine sends must be the ID that Atlas lists. Every machine uses its Atlas name.

GroupResourceBeacon typeresource_idParentListed bySends telemetry as this ID
RegionThe regionRegionThe region nameNoneBeaconNobody. Rules for Datum, Central and fleet-wide checks alert on it.
Control planeAtlasAtlasatlasNoneAtlasThe Atlas site: inventory, jobs, API, Error Logs, BMC readings
HardwareHostMetal HostThe Metal Server nameNoneAtlasmetald (metrics) and the Datum agent (logs only)
Virtual machinesService VM (proxy, WireGuard, IPv6 router)Virtual MachineThe Atlas VM name, vm-<tenant>-NNNNIts hostAtlasThe Datum agent
Cargo VM and Cargo machines (Garage, gateway, Datum host)Virtual MachineThe Atlas VM nameIts hostAtlasThe Datum agent. Cargo signs the token of each Cargo machine. Atlas signs the token of the Datum agent on the Cargo VM.
Customer server (Pilot)Virtual MachineThe Atlas VM nameIts hostAtlasPilot. Central signs the token with the atlas_vm_id of the server. Cargo signs it for the Pilot of the Cargo VM.
Service nodesProxy, WireGuard gateway, IPv6 routerProxy Server, Wireguard Gateway Server, IPv6 Router ServerThe node nameIts VMAtlasNobody directly. The VM sends, and a rule maps the VM to its node with atlas_service_node.
Object storage and buildsCargoCargo ServercargoThe Cargo VMAtlasThe Cargo site, with a token that Cargo signs. The Object Storage SLI also reports as cargo.
GlobalCentralNo resourcecentral in DatumNobodyCentral. Its rules and SLIs return the region as resource_id, so they need no resource.
Not coveredGrove boxNo resourcegrove:<machine>NobodyGrove. Beacon drops any rule row for it. See Gaps.

Who signs the token

Only the token binds a row to a resource. The sender chooses the metric, the labels and the message, so a rule must read only the rows of its own sender. Datum verifies each token against one key set for the region. A key ID names its issuer, and iss must match it.

IssuerKey IDSigns for
Centralcentral:central, and each customer server (Pilot)
Atlasatlas:<region id>:atlas, the hosts (metald), the service VMs and the Datum agent of the Cargo VM
Cargocargo:<region id>:cargo, the Pilot of the Cargo VM, and the Garage and Datum host machines

Datum takes central, atlas and cargo only from a token of that product, so a machine cannot write as one of them. Cargo serves the key set that the Datum host reads: the Atlas set, which holds the Central keys, and the Cargo key. A Cargo machine keeps a machine token in its Atlas metadata and trades it at Cargo each day for a Datum token of 7 days. Cargo refuses it when the Machine is not Running.

Status in Beacon

Only an Active resource is checked. A new or reactivated resource is not checked for 10 minutes, so it can finish booting.

ResourceActivePendingSuspendedTerminated
VMPlaced and not sleeping. A crashed VM stays Active, so it keeps its alerts.A draftStopped to sleepTerminating
HostActiveProvisioningFailedArchived
Service node, CargoActiveBeing set upFailedArchived

Parents and incident scope

A resource has a path, such as host, VM, proxy node. An alert joins an open incident whose scope covers it or a parent. A rule with scope_includes_descendants, such as a host that is down, opens an incident that covers everything under the host. So the VM and Pilot alerts that follow join that incident and do not page again. An incident of a resource with a parent waits 90 seconds before it pages, so the incident of the parent can take the alert first.

Services and SLOs

A service measures what customers feel. Each minute, Beacon runs the SLI query of each service in each region and stores good and valid counts. The SLO is the target over 30 days. A fast burn of the error budget pages.

ServiceOwnerGood meansSLOHow it counts
SitesPilotSites answer requests on the servers that run them.99.9%sort_order: 1 Pilot pings /api/method/ping on each site once a minute and sends pilot_sites by state. App request hooks run on the ping, so an app fault can count as bad. A sample more than 1 minute in the future comes from a wrong clock, and must not stay the newest value.
ServersAtlasServers that should run are available.99.9%sort_order: 2
NetworkingAtlasThe proxies pass requests to sites without errors of their own.99.9%sort_order: 3 A proxy error is a 5xx that the proxy made itself (origin proxy). A 5xx from the site's own code is good here.
Object StorageCargoS3 requests to object storage succeed.99.9%sort_order: 4 A 5xx answer is bad. 403 and 404 are normal S3 answers, so they are good. The Garage nodes send with their own resource IDs, but the resource list has one resource for Cargo, so the query reports the object storage of the region as the one reporter 'cargo'. The window is 3 minutes, so a counter that the Datum agent scrapes each minute has the 2 samples that an increase needs.
Dashboard and APICentralRequests to the Central dashboard and API succeed.99.9%Central requests that do not fail with 5xx, the mean of 5 minutes. A 4xx is good. The reporter is the region, because Central is in no resource list. Desk sets its Query Region.
Server actionsCentralCustomer actions on servers and sites finish without an error.99%Create, start, stop, restart and resize actions that succeed, from the last-hour count. Failed and Timed Out are bad. Terminate does not count. A burn does not page: central-resource-actions pages on the same failures.

Burn alerts

Alert keyBudget usedLong windowShort windowBurn rateSeverity
fast2%1 hour5 minutes14.4High, pages
medium5%6 hours30 minutes6High, pages
slow10%3 days6 hours1Low
sla1 hour15 minutesThe SLA error rateHigh, pages

A window with fewer than 100 valid events does not alert. When the query fails or returns no valid events, the service is Unknown, not good.

Severity: what happens

SeverityMeansChatEmailPhone callNext responder afterWhen nobody answers
CriticalCustomers are down now. A person must act at once.YesYesYes2 minutesCalls continue until a person acknowledges. A postmortem is required.
HighCustomers are or will soon be affected.YesYesYes5 minutesStops after 3 rounds and posts to chat
MediumA person must look today.YesYesNo
LowSomething to know about.YesNoNo

Endpoint checks

All other signals come from inside a region. An endpoint check calls a URL or a host from the Beacon site, so it sees what a customer sees. It runs each minute in the region run, and raises or resolves an alert on the region resource.

KindFileFails when
HTTPbeacon/rules/<key>.httpThe request fails, the status is not the expected status (200 by default), or the body does not contain the expected text
TLSbeacon/rules/<key>.tlsThe connection or the handshake fails, the certificate does not verify for the host, or fewer days are left than the minimum (14 by default)

A check can also be a Custom rule made in Desk. The region header names one region, or all for every active region. Each region then has its own alert. A file with no region header makes a check that is off. Desk then sets its Regions and turns it on. The URL and the host can use variables, so one file works in every region:

VariableValueKept in
{region}The region nameBeacon Region
{wildcard_domain}The site domain of the regionBeacon Region
{atlas_url}The scheme and host of the region's AtlasThe Base URL of the atlas Resource Source
{central_url}The Central addressBeacon Settings

Beacon refuses an unknown variable when the rule is saved. When a variable has no value in a region, Beacon logs an error and skips the check there, so its alert keeps its state.

Configured checks

CheckKindTargetRegionsSeverity
atlas-api-unreachableHTTP{atlas_url}/api/atlas/jwks.json, which needs no sign-in. Fails for 3 minutes.AllHigh
atlas-certificateTLS{atlas_url}, at least 14 days leftAllMedium
central-dashboard-unreachableHTTP{central_url}/dashboard. Fails for 3 minutes.Set in DeskHigh
central-api-unreachableHTTP{central_url}/api/method/ping. Fails for 3 minutes.Set in DeskHigh
central-certificateTLS{central_url}, at least 14 days leftSet in DeskMedium
object-storage-unreachableHTTPhttps://s3-admin-svc.{wildcard_domain}/health, through the gateway to Garage. Fails for 3 minutes.AllHigh
telemetry-unreachableHTTPhttps://telemetry-svc.{wildcard_domain}/health. Fails for 3 minutes.AllHigh
object-storage-certificateTLSs3-svc.{wildcard_domain}, at least 14 days leftAllMedium
telemetry-certificateTLStelemetry-svc.{wildcard_domain}, at least 14 days leftAllMedium
telemetry-read-certificateTLStelemetry-read-svc.{wildcard_domain}, at least 14 days left. Beacon reads ClickHouse on this name.AllMedium

S3 itself has no health route and refuses a request that is not signed, so Beacon checks only the certificate of s3-svc, and the health route of s3-admin-svc on the same gateway. The proxies have their own health check, so Beacon does not call a test site behind them. The Central checks name no region, because the Central Telemetry Region depends on the site.

Customer or infrastructure

Two systems send alerts. Pilot tells the customer about one server or one site. Beacon tells the Frappe Cloud team when many customers share a problem, or when the platform fails. So Beacon does not add a rule for one site or one customer server.

What Pilot sends to the customer

Pilot sends each event to the webhooks of the customer. It also sends an alert by email, to the recipients set on the server, and to Central, which shows it to the customer. Central accepts only the event types that it defines.

EventWhenGoes toWhat Beacon sees
site_downA site does not answer the uptime ping. The customer can turn it off (site_uptime).Webhooks, email, Central (site_unavailable)pilot_sites counts. pilot-sites-down fires when 3 or more sites, and 20% or more, are down on one server. The Sites SLI counts all sites.
resource_limit_breachedCPU, memory or disk use stays above the limit of the customer, 90% by default.Webhooks, email, CentralNothing for a customer server. The machine rules cover platform machines only.
backups_failingThe backups of one site keep failing.Webhooks, email, Central (backup_failure)pilot-backups-failing fires when 5 or more servers, and 10% or more, fail.
task_failed of an updateAn update fails.Webhooks, email, Central (migration_failure)pilot-updates-failing fires when one release of one repository fails on 3 or more servers.
certificate_expiry, certificate_failedA site certificate has less than 14 days left, or does not issue or renew.Webhooks, email, CentralNothing for a customer site. Atlas watches the wildcard and metald certificates. A TLS rule can check any host from outside.
Other events, such as site_up and other failed tasksA site answers again, a task failsWebhooks and the feedNothing

When Pilot cannot reach Central, the customer hears nothing. pilot-central-delivery fires on 3 failed deliveries in 15 minutes. pilot-silent fires when Pilot stops sending.

What counts as an infrastructure failure

ServiceBad (counts against the SLO)Not counted
SitesA site that does not answer the ping on a running serverA site in maintenance. Known limit: app request hooks run on the ping, so an app fault can count as bad.
ServersA server that should run and is not availableA stopped or sleeping server, a draft
NetworkingA 5xx that the proxy made itselfA 5xx from the site's own code
Object StorageAn S3 answer with 5xx403 and 404, which are normal S3 answers
Dashboard and APIA Central request that fails with 5xxA 4xx, which is an error of the client
Server actionsA create, start, stop, restart or resize action that fails or times out. A region at capacity is bad, because capacity is our problem.Terminate, which no customer waits for

Atlas and metald

Atlas runs the hosts, the VMs and the service nodes of a region. metald runs on each host. The Datum agent runs on each service VM and on the Cargo VM.

Data sent to Datum

DataTypeSender (resource ID)What it tells
15 system_* machine metrics: boot time, CPU count and seconds, load, memory, swap, file systems, disk and network bytes and errorsGauges and countersEach host (metald), each service VM and the Cargo VM (Datum agent)The health of the machine. system_boot_time_seconds is the heartbeat.
More host system_* detail, each 60 s: CPU frequency and throttles for each package, interrupts and schedstat totals, softnet, the netstat, vmstat and memory info allowlists, hwmon inputs and alarms, cooling devices, EDAC, SMART value and rawGauges and countersEach host (metald)Hardware faults, and detail to investigate an alert
metal_*Gauges and countersEach host (metald)VM states, ZFS, md, SMART, hardware, metald loops
bmc_health, bmc_component_health, bmc_temperature_celsius, bmc_fan_speed, bmc_power_watts, bmc_power_supply_*, bmc_clock_offset_seconds, bmc_system_infoGauges, each 5 minatlasThe BMC readings of each host
atlas_machine{machine, kind}Gauge, each minatlasThe machines that must send now: Running hosts and VMs that run and do not sleep
atlas_metal_servers{status}, atlas_metal_server_info, atlas_host_sync_age_seconds, atlas_host_cpu_millicores, atlas_host_memory_bytes, atlas_host_storage_bytes, atlas_host_virtual_machinesGauges, each minatlasHost inventory, sync age and allocation
atlas_virtual_machines{server, state}, atlas_virtual_machine_drafts, atlas_virtual_machine_oldest_draft_seconds, atlas_virtual_machines_terminatingGauges, each minatlasVM states and stuck drafts
atlas_migrations_active, atlas_migration_oldest_active_seconds, atlas_migrations_total, atlas_migration_duration_secondsGauges and countersatlasVM migrations
atlas_virtual_machine_images, atlas_virtual_machine_image_stored_bytesGauges, each minatlasVM images
atlas_public_ip_capacity, atlas_public_ip_allocationsGauges, each minatlasFree public IP addresses in each pool
atlas_ssh_tasks_active, atlas_metald_updates_activeGauges, each minatlasWork in progress
atlas_service_servers{service, status}, atlas_service_node, atlas_service_readyGauges, each minatlasService nodes (proxy, WireGuard gateway, IPv6 router, Cargo) and their readiness probes
atlas_job_queue_length, atlas_job_failed, atlas_job_started {queue}Gauges, each minatlasBackground job queues
atlas_api_requests_total, atlas_api_request_duration_seconds, atlas_metal_requests_total, atlas_metal_request_duration_secondsCountersatlasAtlas API calls and calls to metald
atlas_filesystem_bytes{path, kind}Gauge, each minatlasFree space on the Atlas machine
atlas_error_logs_last_minuteGauge, each minatlasNew Error Logs
atlas_tls_certificate_expiry_seconds{certificate, server}Gauge, each minatlasTime left on the wildcard and metald certificates
atlas_warpgate_sync_age_secondsGauge, each minatlasTime since the last Warpgate sync that reached every host
proxy_requests_total{origin, ...}, proxy_request_seconds_total, proxy_upstream_seconds_total, proxy_slow_requests_totalCountersEach proxy VMRequests, from the nginx access log on the VM. origin tells a proxy 5xx from a site 5xx.
wireguard_peers, wireguard_peers_activeGaugesEach WireGuard gateway VMConfigured and active peers
ipv6_router_program_attachedGauge, each 30 sEach IPv6 router VMThe eBPF program is on eth0
Log lines, source = journal, at warning and higher; metald also at infoLogsEach host (product metal), each service VM (product atlas), the Cargo VM (product cargo)System and service errors
Log lines, source = fileLogsEach proxy VMThe nginx error log at error and higher, without upstream errors
Log lines, source = error_logLogsatlasAtlas Error Logs
Log lines, source = bmcLogsatlasThe BMC event log of each host

Alert rules (32)

RuleTitleSeverityResourceFires when
atlas-silentAtlas silentCriticalRegionNo Atlas gauges for 3 min
host-downHost downCriticalMetal HostA Running host has no recent sync, and metald is silent
atlas-api-errorsAtlas API errorsHighAtlas5 errors and 5% of the calls of one operation in 10 min, or over 1% of all calls in 15 min
atlas-cannot-sync-hostAtlas cannot sync hostHighMetal HostA Running host has no recent sync, but metald still sends
atlas-disk-fullAtlas disk almost fullHighAtlasUnder 10% free (High), under 25% free (Low)
atlas-metal-errorsAtlas cannot reach metaldHighAtlasA burst of failed metald calls; repeated failures for 1 h, or any 401 or 403, are Medium
atlas-public-ips-exhaustedPublic IPv4 pool almost emptyHighAtlasNo free public IPv4 address (High); fewer than 5, or under 10% free (Medium)
atlas-queue-backlogAtlas queue backlogHighAtlas100 or more jobs wait in one queue for 10 min
atlas-service-nodes-failedService nodes failedHighAtlasA service node is Failed
bmc-problemsBMC problemsHighMetal HostA critical BMC event (High); an unhealthy component or an unreachable BMC (Medium); a warning event (Low)
host-hardware-degradedHost hardware degradedHighMetal HostAn uncorrected memory error (High); a failing disk or a hot CPU (Medium); wear signs (Low)
host-pool-capacityHost pool almost fullHighMetal HostA ZFS pool over 90% (High) or 80% (Low) used
host-storage-failedHost storage failedHighMetal HostA pool, array or mount can lose data or stop writes
ipv6-router-detachedIPv6 router not forwardingHighIPv6 Router ServerThe eBPF program is not on eth0
machine-disk-fullMachine disk almost fullHighMetal Host, Virtual MachineA file system under 10% (High) or 25% (Low) free. ZFS and tenant VMs are left out.
metald-unhealthymetald unhealthyHighMetal HostA metald loop stalls, a change waits, or VMs fail
service-node-not-readyService node not readyHighProxy Server, Wireguard Gateway Server, IPv6 Router ServerA service node fails its readiness probe twice in 3 min
tls-certificate-expiringTLS certificate expiringHighAtlasUnder 3 days (High) or 21 days (Medium) left
vms-unavailable-on-hostVMs unavailable on hostHighMetal Host3 VMs and 20% of the wanted VMs are down (High); fewer is Medium
atlas-error-logsAtlas unhandled errorsMediumAtlasA new error repeats 3 times in 1 h, or any error repeats 5 times in 15 min
atlas-failed-jobsAtlas jobs failingMediumAtlas3 failed jobs in 1 h
atlas-stuck-workAtlas work stuckMediumAtlasA migration runs, or a draft VM waits, for 1 h
host-limitsHost near a kernel limitMediumMetal HostConntrack or the open file table is near full, or the clock is not synced
host-network-errorsHost network errorsMediumMetal HostA link is down (Medium); over 10 NIC errors in 1 h (Low)
host-stressHost under stressMediumMetal HostHigh CPU, memory or I/O pressure for 15 min
host-systemd-unitsHost systemd units failingMediumMetal HostA failed unit (Medium); 3 restarts in 1 h (Low)
machine-silentMachine silentMediumMetal Host, Virtual MachineA host or service VM in atlas_machine sends no machine metrics for 3 min. Tenant VMs are left out.
machine-stressMachine under stressMediumMetal Host, Virtual MachineOver 90% memory used, or load over 1.5 per core, for 15 min
proxy-error-spikeProxy errorsMediumProxy ServerProxy-made 5xx at 5 times the share of the last 70 min, or over 5%
vm-migrations-failedVM migrations failedMediumMetal HostA VM migration failed in the last hour
warpgate-sync-failingWarpgate sync failingMediumAtlasNo full Warpgate sync for 15 min
repeated-errorsRepeated errorsLowMetal Host, Virtual MachineOne log message 10 times in 1 h

Cargo and Datum

Cargo builds Pilot images and runs object storage (Garage) and the Datum host of a region. The rules that watch Datum are in Cargo, because Cargo runs the Datum host.

Data sent to Datum

DataTypeSender (resource ID)What it tells
15 system_* machine metricsGauges and counters, each minEach Cargo machine and the Cargo VM (Datum agent)The health of the machine
garage_*, such as garage_cluster_available, garage_cluster_storage_nodes_ok, garage_local_disk_avail, garage_api_s3_request_counter, garage_api_s3_error_counter, garage_block_resync_errored_blocksGauges and counters, from the Garage admin APIEach gateway and storage nodeCluster health, disks, S3 requests and errors, resync
cargo_machine{machine, role, cluster}Gauge, each mincargoThe running Cargo machines, and the VM that runs Cargo (role cargo)
cargo_object_storage_health{cluster, health}Gauge, each mincargoThe health verdict of each live cluster
cargo_object_storage_metadata_backup_age_seconds{cluster}Gauge, each hourcargoThe age of the newest uploaded metadata backup
cargo_pilot_image_latest, cargo_pilot_image_in_progress_seconds, cargo_pilot_image_newest_completed_age_seconds, cargo_pilot_image_failed_attemptsGauges, each hourcargoPilot image builds
Pilot data of the Cargo VM: heartbeat, sites, backups, database state, disk space, calls to Central, update eventsSee pilot#828The Cargo VMThe Cargo site
Log lines, source = journal, warning and higher, Garage with a module attribute. Only the Garage series that a rule or chart reads.LogsEach Cargo machineSystem and Garage errors. Signed URLs are removed.
Log lines, source = fileLogsThe gateway, the Datum hostThe nginx error log at error and higher, and the ClickHouse error log
Log lines, source = error_logLogs, each mincargoCargo Error Logs

Alert rules (15)

RuleTitleSeverityResourceFires when
object-storage-unavailableObject storage unavailableCriticalCargo ServerGarage is unavailable or silent on every node
datum-ingest-stoppedDatum stores no new samplesHighRegionDatum stores no new sample for 3 min
object-storage-disk-fullObject storage disk almost fullHighCargo ServerA Garage disk has under 10% free
object-storage-errorsObject storage errorsHighCargo Server10 S3 requests fail with 5xx in 10 min, and over 1% of the requests
object-storage-healthObject storage healthHighCargo ServerA cluster is Critical (High); Degraded, Unknown or silent for 10 min (Medium)
cargo-build-failedCargo image build failedMediumCargo ServerThe newest build of an image failed
cargo-build-stuckCargo image build stuckMediumCargo ServerA build runs for 2 h
cargo-errorsCargo errorsMediumCargo ServerOne unhandled error repeats 5 times in 15 min
cargo-images-staleCargo images staleMediumCargo ServerThe newest usable image is older than 2 days
cargo-silentCargo silentMediumCargo ServerNo image build metrics for 3 h
datum-writes-refusedDatum refuses writesMediumRegionDatum refuses 10 requests of one sender in 15 min. A 5xx is High.
object-storage-backup-staleObject storage backup staleMediumCargo ServerNo metadata backup in the last day
object-storage-redundancyObject storage redundancy lostMediumCargo ServerA storage node is not OK, or blocks failed to resync
telemetry-droppedTelemetry dropped on machineLowMetal Host, Virtual MachineThe Datum agent counts the events that it drops: lines over the log cap, events that a full buffer drops, and events lost by error. A role file that drops a line on purpose does not count. Each drop is a gap in the data of the machine, so 100 in 1 h alerts.
telemetry-volumeTelemetry volume grewLowRegionDatum counts the samples and log lines of each sender each day. A sender that sent more than 2 times its median of the 7 days before, and more than 100,000 rows, often runs a new version that sends a new metric or logs too much. The rule finds it before the storage cost does.

Central

Central is global. It sends its telemetry as central to the Datum of one region, and its rules and SLIs report on that region.

Data sent to Datum

DataTypeWhat it tells
central_requests{group, status_class}Gauge, each minAPI requests since the last push, by central.api module and status class
central_resource_action_oldest_open_seconds{region, resource_type, action}, central_resource_actions_finished_last_hour{..., status}Gauges, each minResource actions that are open, and the ones that finished
central_payment_attempts_last_hour{gateway, status}, central_payment_last_capture_seconds{gateway}Gauges, each minPayment attempts and the newest capture
central_gateway_webhooks_unprocessed, central_gateway_webhook_oldest_unprocessed_seconds, central_gateway_webhooks_failed_last_hour {gateway}Gauges, each minPayment gateway webhooks that wait or failed
central_billing_run_oldest_open_seconds, central_invoices_sync_failedGauges, each minBilling runs, and invoices that did not sync to accounting
central_site_domains_failed_last_hour, central_site_domain_oldest_pending_seconds {route_type}Gauges, each minProxy routes
central_vm_snapshots_failed_last_day{snapshot_type}, central_vm_snapshot_oldest_pending_secondsGauges, each minVM snapshots
central_emails_failed_last_hour, central_email_oldest_unsent_secondsGauges, each minThe email queue
central_job_queue_length{queue}, central_scheduled_job_late_seconds{job}Gauges, each minBackground queues and late scheduled jobs
frappe_webhook_requests_last_day{webhook, status}Gauge, each minOutgoing webhook requests. Exhausted means Frappe gave up.
Log lines, source = error_log, level errorLogs, each minCentral Error Logs, up to 1,000 lines for each push

Alert rules (7)

RuleTitleSeverityResourceFires when
central-api-errorsCentral API errorsHighRegionOver 5% 5xx in 10 min, with 50 requests or more (High); over 1% in 1 h, or one group with 10 errors and over 10% (Medium)
central-paymentsCentral payments failingHighRegion5 failed payments that are half of the attempts of a gateway in 1 h, or a gateway webhook that waits 15 min (High); a failed webhook (Medium); no capture for 1 day (Low)
central-resource-actionsCentral resource actions failingHighRegion3 failed or timed out actions that are 20% of the finished ones in 1 h, or an action open for 2 h (High); open for 30 min (Medium)
central-silentCentral silentHighRegionNo Central gauges for 5 min, after Central sent them in the last 14 days
central-webhooks-failingCentral webhooks failingHighRegion10 exhausted requests that are 20% of one webhook in 1 day (High); one exhausted request, or 10 that still retry (Medium)
central-background-workCentral background work stuckMediumRegionA billing run open for 1 day, a proxy route pending 30 min or 3 failed in 1 h, a failed or stuck snapshot, failed or late emails, a scheduled job 15 min late, or 1,000 queued jobs (Medium); invoices that do not sync (Low)
central-errorsCentral errorsMediumRegionOne unhandled error repeats 5 times in 15 min

Pilot

Pilot runs the sites on each customer server. It tells the customer about the problems of one server, and sends Datum only the numbers that show a problem across many servers.

Data sent to Datum

DataTypeWhat it tells
pilot_info{version}Information, each 5 minThe heartbeat of Pilot
pilot_sites{state}Gauge, each minSites up, down and in maintenance, from the uptime pings. Zeroes are sent.
pilot_site_backups{status}Gauge, each 5 minSites whose newest backup of the last day succeeded or failed
pilot_database_upGauge, each 5 min1 when the database accepts connections
system_filesystem_size_bytes, system_filesystem_available_bytes {mountpoint, device, type}Gauge, each 5 minDisk space
pilot_central_requests_last_5_minutes{method, result}Gauge, each 5 minCalls to Central, ok or failed
Update events: product pilot, service update, source eventLog line, each app of each updateapp, repository (such as frappe/erpnext), from_version, to_version, status, phase, site. A failure has level error and the end of the output.

Alert rules (5)

RuleTitleSeverityResourceFires when
pilot-backups-failingSite backups failing on many serversHighRegionThe newest backup failed for most sites on 5 servers that are 10% of the servers. Half of the servers is High.
pilot-central-deliveryPilot cannot send alerts to CentralHighVirtual Machine3 report_pilot_event calls fail in 15 min
pilot-sites-downSites down on serverHighVirtual Machine3 sites, and 20% of the checked sites, are down. The detail names the database state.
pilot-silentPilot silentMediumVirtual MachineNo pilot_info or no pilot_sites for 10 min, on a VM that Atlas expects to run
pilot-updates-failingApp update failing on many serversLowRegionOne release of one repository fails on 3 or more servers in 6 h

Datum agent (all machines)

The Datum agent is Vector with one configuration from frappe/datum. Atlas and Cargo install it. Role files add the data of one role.

Data sent to Datum

DataTypeWhat it tells
system_boot_time_seconds, system_cpu_countGauges, each minThe heartbeat and size of the machine
system_cpu_seconds_total{cpu, mode}CounterCPU time by /proc/stat mode
system_load_average{window}GaugeLoad for 5 and 15 min
system_memory_total_bytes, system_memory_available_bytes, system_memory_swap_used_bytesGaugesMemory and swap
system_filesystem_size_bytes, system_filesystem_available_bytes {mountpoint, device, type}GaugesFile system space
system_disk_read_bytes_total, system_disk_written_bytes_total {device}CountersDisk I/O
system_network_receive_bytes_total, system_network_transmit_bytes_total, system_network_receive_errors_total, system_network_transmit_errors_total {interface}CountersNetwork traffic and errors
Role metrics, metrics_* in a role fileAs the role definesFor example proxy requests or Garage
Log lines, source = journal, at warning and higher; INFO_UNITS also at infoLogsSystem and service errors. A JSON line gives its fields as attributes, at most 64.
Log lines from a role, logs_* in a role fileLogsFor example the nginx error log
datum_agent_dropped_events_total{component, reason}Counter, each min, also on hostsEvents that the agent dropped: cap, buffer_full or error
One JSON log line for each refused /v1/ request, with sender and statusLogs, from Datum itselfWrites that Datum refused

Review status

I checked each resource ID from the sender to the resource list, and each customer-facing part for a service and a paging rule. These changes came from the review.

Pilot sent under the wrong resource ID central#714

Central gave the Pilot token the Central name of the server, not the Atlas VM name that Atlas lists. Beacon dropped every Pilot rule row, pilot-silent could never fire, and the Sites SLI had no reporters. Central now uses atlas_vm_id, and refuses a server that Atlas has not bound yet.

SLOs for the dashboard, the API and server actions central#714

Two global services: Dashboard and API at 99.9%, and Server actions at 99%. Both report on the region, because Central is in no resource list. The Central Telemetry Region depends on the site, so Desk sets their Query Region.

HTTP and TLS checks with variables beacon

Beacon has a TLS rule kind beside HTTP. Both can use {region}, {wildcard_domain}, {atlas_url} and {central_url}, and region: all. A file can leave out the region, and Desk sets it. See Endpoint checks.

Certificate alerts reach Central central#714 pilot#828

Central defines certificate_expiry (Warning) and certificate_failed (Error), and Pilot sends them there. A customer without webhooks or email recipients now learns that a certificate does not renew.

One resource ID, clear type names beacon atlas#607

The unused Telemetry IDs source is removed, so Beacon finds a resource by its resource ID only. Atlas lists hosts as Metal Host and VMs as Virtual Machine, and every rule names the registry types of its rows.

Checks from outside beacon atlas#607 central#714

Beacon now calls the Atlas API of each region, the Central dashboard and API, and reads their certificates. See Endpoint checks.

A rule reads only its own sender atlas#607 cargo#141 central#714 datum#20

A machine could send a metric with the name and labels of a product metric, and fire or silence a product rule. Each product rule now reads only the rows that the product sends as itself (resource_id = 'atlas', 'cargo' or 'central'), or the machines that its inventory lists. Datum refuses those three IDs in the token of another issuer.

Rows of other types and disabled resources stay out beacon cargo#141 pilot#828

Beacon drops a rule row whose resource type is not in the resource_type of the rule. A fleet-wide rule leaves out the resources with monitoring disabled through {excluded:Array(String)}, so a server that a person turned off does not count toward a threshold.

Cargo signs the Datum tokens of its services cargo#141 central#714 datum#20

Atlas runs the VMs, and Cargo runs the regional services, so Cargo signs for them with its own Ed25519 key. Central no longer gives Cargo tokens. Roll out Cargo first, run setup again on each Datum Server and object storage cluster, then deploy Central. See Who signs the token.

Checks of object storage and telemetry from outside cargo#141

Beacon now calls the object storage gateway and the telemetry endpoint of each region, and reads the certificates of s3-svc, telemetry-svc and telemetry-read-svc. The rules inside the region do not see a wrong DNS record, a stopped Caddy or an expired certificate. See Endpoint checks.

Passwords stay out of the process list datum#20 cargo#141

datum-migrate reads every user password from the environment, and Cargo passes them with su -w. Before, the insights and default passwords were flags that ps showed.

Journal fields stay valid attributes datum#20

The Datum agent makes the field names of a JSON journal line valid attribute names and sends at most 64, so one line cannot make Datum refuse its batch.

Open: Grove is not covered

Grove boxes send as grove:<machine>, and no resource source lists them. Beacon drops their rows. Decide: add a Grove resource source and rules, or leave Grove out of Beacon.

Developer guide: add a service

Do these steps to connect a new service to Datum and Beacon. The full guide is docs/integration.md in frappe/beacon.

1. Decide what to watch

2. Get a token from the issuer that already trusts you

Do not make a new key set. A machine sends as its Atlas Virtual Machine or Metal Server name, and an application as its own name. See Who signs the token. The token is for one region and has an expiry, so renew it before it expires. Beacon keeps only the rows whose resource ID it knows, so the ID must be in a resource list (step 6).

3. Send metrics and logs

Name a metric namespace_subsystem_target_unit, with _total at the end of a counter. Use base units: seconds and bytes. Send a gauge for a value that goes up and down, and the running total for a counter. Give all series of one collection the same timestamp, so a rule can read the newest collection only.

from datum_client import Batch, Datum

batch = Batch("cargo", "object_storage")
batch.gauge("backup_age", age_seconds, unit="seconds", cluster="garage-1")
batch.counter("backups", completed, cluster="garage-1")  # cargo_object_storage_backups_total

with Datum(url, token) as datum:
    datum.send(batch)

A machine with the Datum agent sends its journal already. Add a role file for an exporter (metrics_<name>) or a log file (logs_<name>). A Frappe app sends its Error Logs from a scheduled job with source = 'error_log'. Limits: 12 requests a minute for each resource and endpoint, 10,000 samples a request, 64 labels a sample.

4. Write a rule and a runbook

Put one file in beacon/rules/<rule-key>.sql of your repository. The header sets the timing, and the query returns only failing rows: resource_id, alert_key, value, detail, and an optional severity.

-- title: Object storage backup stale
-- severity: Medium
-- resource_type: Cargo Server
-- interval: 900
-- pending_for: 900
-- resolve_after: 3600
-- runbook_url: https://github.com/frappe/cargo/blob/develop/beacon/runbooks/object-storage-backup-stale.md
SELECT 'cargo' AS resource_id, cluster AS alert_key, age AS value,
       concat('the newest metadata backup of ', cluster, ' is ', toString(round(age / 3600)), ' h old') AS detail
FROM (
    SELECT labels['cluster'] AS cluster, argMax(value, ts) AS age
    FROM datum.samples_recent
    WHERE metric = 'cargo_object_storage_metadata_backup_age_seconds'
      AND resource_id = 'cargo' AND ts > now() - INTERVAL 3 HOUR
    GROUP BY cluster
)
WHERE age > 86400

Test the query before you merge it, with rows that fail and rows that do not:

clickhouse-client --param_region=blr1 --param_excluded="[]" < beacon/rules/object-storage-backup-stale.sql

5. Define an SLI

When customers use the service, add beacon/services/<service>.sql. It returns one row for each reporter: resource_id, good, valid and last_ts, and sets slo_target in its header. Count only the failures that the platform causes. A global service reports as the region, {region:String} AS resource_id, and sets its Query Region.

6. Serve a resource list

A regional service that runs infrastructure serves GET <base>/beacon/resources with an ETag. Beacon signs in with a Frappe API key and reads it each minute.

{"resources": [{"resource_id": "h12", "resource_type": "Metal Host", "parent_id": "", "title": "h12", "status": "Active"}]}

A Suspended resource gives no alerts. A resource that is missing from 2 good fetches becomes Terminated. When one fetch removes more than 10% of the resources, Beacon holds the removal until an admin applies it.

7. Sync

Add the repository as a Definition Source in Beacon Settings, with its branch and the folder beacon, and select Sync Definitions. A sync applies all files of a source or none: one bad header or one failing query stops it. Desk can only turn a file rule on or off and set its regions. Change everything else in the file.

How Beacon runs the rule

Each minute, Beacon queues one job for each region with due rules. For each due rule:

  1. Run the query as the beacon user, with {region} and {excluded}. A query error changes nothing. 3 errors in a row mark the rule Broken.
  2. Drop the rows of unknown resources, of other types, of resources that are not checked, and of resources that are new in the last 10 minutes.
  3. Compare the rows with the open alerts and write only the changes.
FromWhenTo
NoneA new failing rowPending
PendingThe row fails for pending_forFiring. The alert joins an open incident, which pages.
PendingA good run without the rowResolved (Cleared)
FiringNo row for resolve_afterResolved (Recovered). A job closes the incident when all its alerts recover.
Pending, FiringThe resource is removed, or monitoring is disabledResolved

A silence, a maintenance or a held removal suppresses an alert: it keeps its state, but it does not join an incident and does not page. Beacon never publishes an incident. A person decides what the status page shows.

Before you merge

Made from the rule and service files of each repository and the pull request descriptions.