Skip to content

Self-monitoring

Partial

Omniglass reports on itself the way it reports on a fleet: each process that does the work, every outpost and every server, has a component of its own, and its health lands there as metrics. An operator reads whether an outpost keeps up, or whether the server is falling behind its samples, with the same tools they use for a codec: its metrics, their trend, and the rules that alarm on them. The operator’s view of all of it is Platform health. An endpoint’s account of its own collection (its poll durations, failures and pushes) is a different thing, landed on the device’s component: see collection telemetry.

The boot seed creates one reserved system, platform, of the reserved system type of the same name. Registering an outpost gives it an omniglass-outpost component in that system, named for the outpost and named back on the outpost row (outpost.platform_component_id); each server boot ensures an omniglass-server component for the server’s identity (below).

The keys these components carry belong to the platform writer class (who writes a key): the Storage Gateway lets only the process write them, so no push, declared value, command, calc rule or event rule can plant one, and a platform key named anywhere else is refused like any reserved key. An operator may relabel the system and its components but not reshape them: a rename, retype, move, reparent or delete, or another component joining the system, is a 409 naming the reservation. Decommissioning an outpost removes its component. The system is placed at no location, so only an all-scope read sees it, and a location-scoped operator sees no platform rows (ADR-1625).

Every platform metric key, rendered from the writer-class ruling and the seed:

KeyTypeUnitWhat it reads
webhook-post-count int Webhook posts to the endpoint the server accepted in the report window; one zero follows a window with posts, then none while quiet.
webhook-refusal-count int Webhook posts to the endpoint the server refused (a bad signature, a missing credential) in the report window; reported only when nonzero.
checkin-age float s Seconds since the outpost's last heartbeat reached the server (since its enrollment, before its first), written by the server every platform tick; keeps growing while the outpost is silent.
rule-sweep-age float s Seconds since the server's event rule sweep last completed, on the server's platform component; written every report window by the server itself and, from the shared database, by each peer server, so it keeps growing while the sweep is stalled.
worklist-task-count int Tasks in the worklist the outpost installed, sampled on each install.
worklist-pull-loss-ratio float ratio The share of the outpost's worklist pulls over the report window that the bus refused or the outpost could not read, so the outpost ran its last worklist; a window with no pull carries the last pull's outcome. 0 is healthy, 1 is an outpost running a stale worklist.
tick-duration float ms The longest pass the outpost's dispatcher took over one heartbeat window, sampled each heartbeat.
tick-overrun-count int Dues that met their task's previous run still in flight, so were skipped, over the report window; reported every window, 0 when quiet.
schedule-lateness float ms The worst gap between a task's due time and its dispatch over one heartbeat window's scheduled runs.
schedule-gap-excess float ms The worst deviation between a task's gap since its previous scheduled start and its interval over one heartbeat window; a poll keeping its interval reads 0, a skipped slot a whole interval.
schedule-skip-count int Task dues the dispatcher passed over (a run still in flight, a late pass), over the report window; reported every window, 0 when quiet.
worker-busy-fraction float ratio Share of the outpost's worker time spent running polls, probes, commands and runs over the report window; near 1 every worker is busy and dues start to wait. Reported every window, 0 when idle.
lane-worker-count int How many endpoint lanes the outpost runs at once, each one request in flight to its endpoint; sized at boot from the CPU and memory the outpost may use unless an operator set it. Reported every window.
spool-batch-count int Batches waiting in the outpost's spool for the bus, sampled each tick.
delivery-in-count int Items that reached a hop over the report window, one sample per kind as the instance (metric, property, event, log); an outpost counts its spool, the server its ingest. At an outpost's schedule/{kind} instance it counts the runs due on the schedule that produce that kind. Written every window, 0 when quiet.
delivery-out-count int Items a hop handed on over the report window, one sample per kind as the instance (metric, property, event, log); an outpost counts what the bus acknowledged, the server what it stored, coalesced, or had already landed. At an outpost's schedule/{kind} instance it counts the runs made of those due. Written every window, 0 when quiet.
delivery-loss-ratio float ratio The share of a hop's items that came in and never went out over the report window, one sample per kind as the instance (metric, property, event, log); at an outpost's schedule/{kind} instance, the share of runs due that were skipped. 0 is healthy, and a quiet window writes 0.
session-held-count int Device sessions the outpost holds, one sample per session state as the instance, sampled each tick.
process-goroutine-count int Goroutines the Omniglass process runs, sampled each tick.
process-heap-size int bytes Bytes of heap the Omniglass process holds in live and unswept objects, sampled each tick.
process-gc-pause float ms The most recent garbage collection pause of the Omniglass process; absent until the first collection.
process-cpu-seconds float s CPU time the Omniglass process spent since its previous sample (each tick on an outpost, each report window on the server), as the Go runtime estimates it rather than the kernel's account; divided by that interval it is the cores the process kept busy.
process-fd-count int File descriptors the Omniglass process holds open, sockets included; absent where the platform does not expose them.
process-uptime float s Seconds since the Omniglass process started; a rule's age on a process key runs from it, so the refill after a restart does not read as growth.
retention-deleted-count int Rows the retention pass removed from one lane in one pass; a day's partition dropped whole is counted in Metric Partitions Dropped, not here.
retention-behind int 1 when the pass stopped at its chunk cap with rows (or compaction work) still past the window, or its prune or compaction failed, 0 when it caught up; a lane that stays at 1 is falling behind.
retention-pass-duration float s Wall time of one retention pass, every lane, the partition roll and both compactions.
retention-pass-failure-count int Steps of one retention pass that returned an error (a lane, the roll, a compaction, a window out of range); 0 on a clean pass.
retention-window-days int d The retention window in days the pass applied to a lane.
metric-partition-created-count int Day partitions of the metric table the pass created ahead of now.
metric-partition-dropped-count int Day partitions of the metric table the pass dropped whole, every row in them past the window.
metric-partition-count int Day partitions the metric table holds after the pass.
metric-oldest-day-age float d Days from the start of the oldest metric partition to the pass; steady at about the metric window plus one once retention keeps up.
metric-trend-mark-lag float h Hours from the trend compaction's mark to now; steady at about 24 to 25, the trend horizon, and growing when the compaction falls behind.
metric-block-mark-lag float d Days from the block fold's mark to now; steady at about 1 to 2 (a day folds once its hours are compacted) and growing when the fold falls behind.
table-bytes int bytes On-disk bytes of one stored table with its indexes and toast; the metric table's is the sum of its day partitions.
db-size int bytes On-disk bytes of the whole Omniglass database, as pg_database_size reads it, sampled each report window.
data-dir-disk-used-ratio float ratio The share of the filesystem holding the server's data directory that is in use, used bytes over total, 0 empty and 1 full. Written every report window; a window whose disk read failed carries none.
http-request-count int Requests the server answered for one method, route template and status class over the report window; one zero follows a window with requests, then none while quiet.
http-request-duration float ms Mean time the server took to answer a request of one method, route template and status class over the report window.
http-request-duration-max float ms The slowest request of one method, route template and status class over the report window.
db-slow-query-count int Queries that ran past the database slow-query threshold over the report window, each also logged as a warning with its fingerprint; one zero follows a window with slow queries.
db-pool-acquired int Database connections the server's pool had checked out at the end of the report window.
db-pool-idle int Open database connections the server's pool held idle at the end of the report window.
db-pool-total int Database connections the server's pool held open, in use or idle, at the end of the report window.
db-pool-max int The most connections the server's pool may open; db-pool-total reaching it means a new query waits.
db-pool-acquire-count int Connections the server's pool handed out over the report window, the denominator db-pool-wait-count is a share of; a pool that waited 40 times of 50 acquires is starved, of 50,000 it is not.
db-pool-wait-count int Connection acquires that found the pool exhausted and waited for a connection, over the report window; read against db-pool-acquire-count, 0 is healthy.
db-pool-wait-duration float ms Total time acquires spent waiting on an exhausted pool for a connection to free up or open, over the report window.
db-connection-count int Client connections open on the database from every source (the server's pool, migrate, psql, a lab measure, a second server) at the end of the report window, read against db-connection-limit; at the limit the database refuses the next client whatever headroom the server's pool shows.
db-connection-limit int The connections the database admits an ordinary role, max_connections less superuser_reserved_connections.
db-connection-idle-in-transaction-count int Database connections sitting idle inside an open transaction at the end of the report window, read against db-connection-count; 0 is healthy. Each holds a connection and its locks and blocks vacuum from reclaiming rows, a leak that shows nowhere until something fails.
db-transaction-oldest-age float s How long the oldest open transaction on the database has been open at the end of the report window, whatever state it is in; a figure that only climbs is a transaction nothing is finishing.
ingest-lag float s Mean time from a sample's timestamp to its batch's commit on the server, over the newest and oldest sample of each batch landed in the report window; the outpost's clock stamps the sample, so a skewed outpost clock reads as lag.
ingest-lag-max float s The oldest sample's lag at commit across every batch landed in the report window.
ingest-batch-count int Telemetry batches the server committed over the report window; a redelivery its receipt held to a no-op landed nothing and counts none.
ingest-sample-count int Samples the server's committed telemetry batches landed over the report window; an outpost group the fence or the gateway dropped counts none.
ingest-lane-busy float ratio Share of the report window the telemetry lane spent handling batches; near 1 the lane is saturated and the consumer backlog grows.
bus-consumer-pending int Batches on the telemetry stream not yet delivered to the server's consumer, at the end of the report window.
bus-consumer-ack-pending int Batches delivered to the server's telemetry consumer and not yet acknowledged, at the end of the report window.
bus-consumer-redelivered int Batches the telemetry consumer holds that were delivered more than once, at the end of the report window.
bus-consumer-ack-floor int The telemetry stream sequence at and below which the server's consumer has answered every batch, landed or dropped, read at the report. It reaching an earlier bus-stream-last-seq proves every batch the stream held by then is settled, under any steady load.
bus-stream-last-seq int The sequence of the last batch the telemetry stream stored, read at the report; it only grows, so the batches published by a moment are all at or below the head read after it.
bus-telemetry-ack-failure-count int Batch deliveries whose acknowledgement the bus did not confirm over the report window, a redelivery its receipt held included; each is redelivered and its receipt keeps it from landing twice, so this costs work, not rows. Written 0 in a window of confirmed acks, so healthy reads 0, not unreported; as a share of ingest-batch-count, healthy is 0.
bus-worklist-pull-count int Outpost worklist pulls the server answered over the report window, one sample per outcome as the instance (served, read-failed, oversize, respond-failed, expired, abandoned, busy).
bus-worklist-reply-bytes-max int bytes The largest worklist reply the server holds sized for any outpost, at the end of the report window; nearing the bus payload limit means a reply will be refused as oversize.
bus-request-count int Outpost requests the server handled on the bus over the report window, one sample per path as the instance (heartbeat, command-pull, command-report).
bus-request-failure-count int Outpost requests on the bus the server failed to serve over the report window, one sample per path as the instance; a share of bus-request-count, written 0 beside a window of requests that all succeeded.
calc-pending-depth int The deepest the queue of calculated metrics waiting to be computed stood over the report window.
calc-served-count int Calculated metric rows the server computed over the report window.
calc-pass-duration float ms Mean time one pass over the calc queue took over the report window.
outbox-queued-depth int Notifications queued to send, due or waiting out a retry backoff, at the end of the report window.
outbox-due-age float s How long the oldest due notification has waited past its send time, at the end of the report window; zero when nothing is due.
sweep-duration float ms Mean time one pass of a server sweep took over the report window, one sample per sweep as the instance (command-settlement, event-rule).
sweep-count int Passes of a server sweep over the report window, one sample per sweep as the instance.
sweep-failure-count int Passes of a server sweep that failed over the report window, one sample per sweep as the instance; a share of sweep-count, written 0 beside a window of passes that all succeeded.
push-lane-publish-count int Pushes that waited for the push lane's publish turn over the report window, taken or refused.
push-lane-refusal-count int Pushes refused because their wait for the publish turn passed the bound (answered 503, nothing minted) over the report window; a share of push-lane-publish-count.
push-lane-turn-wait-p99 float ms The 99th percentile of how long a push waited for the publish turn over the report window, a refusal's whole bound included.
push-lane-turn-wait-max float ms The longest a push waited for the publish turn over the report window, a refusal's whole bound included.
command-pending-count int Commands waiting for the outpost, the ones its next pull would take and the ones it took that await their execution report, sampled each platform tick.
command-pending-age float s Seconds the oldest command waiting for the outpost has waited since its issue, sampled each platform tick; zero while none waits.
command-dispatch-latency float ms Time from a command's issue to the first time an outpost took it, one sample per command at that take; a command no outpost takes writes none and counts as expired.
command-execution-latency float ms Time from a command's first take to the outpost's execution report, one sample per command at the report.
command-redelivery-count int Commands a pull redelivered (taken again after no report came) over the platform tick's window, read 5 s behind the tick so a take still committing is not missed; written every tick, zero when none.
command-stuck-count int Commands the outpost took that have had no execution report for longer than the redelivery wait, still inside the delivery window, sampled each platform tick.
command-expired-count int Commands that aged past the delivery window unexecuted over the platform tick's window, instance undelivered (no outpost took it) or unexecuted (taken, never reported); written every tick, zero when none.
command-pull-failure-count int Pulls of the outpost's command queue that failed (no answer, or one it could not read), over the report window; reported every window, 0 when quiet.

Self-monitoring: every outpost’s account of itself

Section titled “Self-monitoring: every outpost’s account of itself”

An outpost reports its own figures in the outpost-self block of the telemetry batch it already publishes (TelemetryBatch.outpost_self). The block names no owner and no task: the server takes the outpost from the subject the batch arrived on and lands the rows on that outpost’s platform component, holding every row to the keys declared as the outpost’s own. A row that names an identity, or a block that names an owner, is refused alone, and the batch’s task groups still land. So an outpost speaks only for itself, and never for another outpost or for the server.

What an outpost sends falls into two shapes:

  • Levels, every tick. One observation per sample, never a stored average: the dispatcher’s longest pass (tick-duration), the worst lateness and gap excess of the runs it dispatched (schedule-lateness, schedule-gap-excess), the spool’s depth, the held sessions by state, and the Go process figures (process-*). A poll keeping its interval reads a zero gap excess; a late pass or a skipped slot reads the distance it lost (scheduling).
  • Counts and ratios, once a report window. Tallied over collection.report_seconds (a minute by default) and landed when the window ends, every window, 0 when quiet, so a count returns to 0 after the window that had it rather than standing on its last event.

The figures that matter most:

  • worker-busy-fraction: the lane pool’s worker time spent running over the worker time it had, 0 idle to 1 every worker busy all window. It is the outpost’s headroom: near 1, dues start to wait for a worker. A run in flight at the window’s end counts the part it has run. lane-worker-count lands beside it, both under the one instance lane, since the outpost runs one pool for every kind of discrete work (sizing the pool, ADR-1686).
  • Delivery, per hop. delivery-in-count, delivery-out-count and delivery-loss-ratio ((in - out) / in, 0 when nothing came in), per item kind as the instance. On the outpost hop an item is in when it settles at the spool and out when the stream acks its batch; a batch dropped at a spool cap, refused by the bus or never encoded, or a self-log line the bounded buffer dropped, is in and not out. The schedule hop writes the same three keys at the instance schedule/{kind}: runs due in, runs made out, so a skipped due is that hop’s loss. Every hop reads as the same ratio (the loss ratio).
  • worklist-pull-loss-ratio: the worklist pulls refused or unreadable over the pulls made, so an outpost running a stale worklist reads as loss rather than as healthy; a window with no pull carries the last outcome (pulling the worklist).
  • command-pull-failure-count: the pulls of its command queue that got no answer or one it could not read.

What one poll costs an outpost is read from the kernel: a lane worker runs each driver poll with its goroutine locked to its OS thread and reads the thread’s CPU clock before and after, landing the mean per run as poll-cpu-time on the polled endpoint’s component. It counts only the run’s own thread, so it leaves out a held session’s reader, the HTTP client’s connection goroutines and the garbage collector’s background workers: read it as a floor on a poll’s cost, the process CPU as the ceiling, and compare drivers on it only within one transport. A platform with no per-thread clock lands nothing rather than a false zero (ADR-1870; the cross-transport comparison is what a driver costs an outpost).

Some outpost figures are the server’s, because they must keep moving when the outpost does not:

  • checkin-age: every 15 s the server writes each claimed outpost’s seconds since its last heartbeat (or since its claim, before the first). It grows while an outpost is silent, and the seeded outpost-silent rule opens a high alarm on the outpost’s component past 90 s, three missed heartbeats, cleared by the next one (ADR-1707). The seeded worklist-stale rule likewise opens a warning when worklist-pull-loss-ratio holds at 1 for two minutes.
  • The command queue. Every 15 s the server reads each outpost’s queue and writes its depth, oldest age and stuck commands, and over the window its redeliveries and expiries; the command wire writes each command’s dispatch and execution latency as it stamps them (queue health).

Self-monitoring: the server’s account of itself

Section titled “Self-monitoring: the server’s account of itself”

Each server boot ensures the component of the server’s identity, OMNIGLASS_SERVER_NAME (the hostname when unset), recorded in a platform_server row, so a restart under one identity reports on one component and two servers report on two. Set the name wherever the hostname is not stable: a container’s or a pod’s changes on every start, and each new name is a new component.

The server folds what it sees into the window recorder in internal/platformmetric, the primitive any Omniglass process records itself through, and lands one sample per key and instance each report window:

  • Requests: http-request-count, http-request-duration (mean ms) and http-request-duration-max, per route template and status class (GET /api/v1/components/{name} 2xx), never the path asked for, so a scan of a thousand names is one series. An unrouted request is the one instance unmatched, and a nonstandard method reads OTHER, so a client inventing paths cannot grow the series.
  • Slow queries: db-slow-query-count, the queries past database.slow_query_ms (500 by default, 0 off). Each also logs a slow query WARN with its statement’s fingerprint (the text, whitespace collapsed, bounded at 200 characters) and never its arguments, which carry operator data and secrets (ADR-1627).
  • The pool: db-pool-acquired, db-pool-idle, db-pool-total and db-pool-max at the window’s close, and db-pool-acquire-count, db-pool-wait-count and db-pool-wait-duration over it. The waits read as a share of the acquires.
  • The database’s side: db-connection-count against db-connection-limit, db-connection-idle-in-transaction-count and db-transaction-oldest-age, read from pg_stat_activity, so a migrate, a psql session or a second server counts too; and db-size, pg_database_size at the window’s close.
  • The process: the process-* figures (goroutines, heap, GC pause, CPU time, open files), from the same runtime sampler an outpost reports through.
  • The pipeline: ingest lag and throughput, the telemetry consumer’s backlog, the server hop’s delivery keys, the bus request-reply failures (measuring the pipeline), and the background ticks’ depth, pace and failures (measuring the ticks).
  • rule-sweep-age: the seconds since the event rule sweep last completed, read from a clock the sweep stamps, so a stalled sweep’s age keeps growing. Every 10 s each server also marks itself seen in the shared database and writes its live peers’ ages onto their components, so a live server raises the alarm for a stalled one.
  • data-dir-disk-used-ratio: how full the filesystem under OMNIGLASS_DATA_DIR (where the bus keeps its stream) is, 0 empty to 1 full. Root-reserved blocks count as free, so a full disk can read short of 1.
  • Retention: the retention pass’s figures (what a retention pass reports).

A read that fails writes nothing for that window, and the other figures still land. A boot whose ensure fails logs a WARN and serves anyway, reporting none of this until a boot whose ensure succeeds: self-monitoring never keeps the server down (ADR-1671).

The bus, the database pool and the background ticks have no components of their own: their figures land on the server’s component, told apart by key and instance, since each is one server’s own view. Two servers report two pools, never one merged figure (ADR-1628.2).

What an alarm inside the platform cannot see

Section titled “What an alarm inside the platform cannot see”

An alarm raised by the thing it reports on cannot report that thing’s death. rule-sweep-stalled catches a stalled sweep, not a dead server: a server that crashed or lost its database writes no age and stops marking itself seen, its peers stop judging it, and a lone server has no peer at all. The server’s optional outbound heartbeat (heartbeat.target and heartbeat.interval_seconds) covers the rest: a signed request to a webhook notification target every interval, through the same egress allow list and audit as a notification (a target with no hmac-key secret bound is refused), carrying the server’s name, build and count of open platform alarms. A receiver outside the install alarms on its absence. It is off by default, and hosting the receiver is out of scope (the heartbeat, ADR-1986).

Each figure that alarms does so through a seeded event rule on its key, with the severity and thresholds that rule carries. A few are worth knowing by shape: a trend rule fires on a steady climb rather than a level, and db-size-growing ships disabled, since a fleet onboarded in its first week grows as bloat would (a trend rule reads a window).

Every figure Platform health reads is the sample_key of a shipped rule or is named, with a reason, on an exemption list in code (PlatformRuleExemptions); a test fails when a figure reaches a panel with neither, or when an exemption outlives the rule that overtakes it. The table is rendered from the rules and the list, so it shows what alarms today:

FigurePanelWatched by
checkin-age Checkin outpost-silent
schedule-lateness Schedule no rule: no rule yet, #1982
tick-overrun-count Schedule no rule: no rule yet, #1982
schedule-skip-count Schedule no rule: no rule yet, #1982
command-pending-count Commands no rule: no rule yet, #1982
command-pending-age Commands no rule: no rule yet, #1982
command-stuck-count Commands no rule: no rule yet, #1982
command-expired-count Commands no rule: no rule yet, #1982
worklist-pull-loss-ratio Worklist worklist-stale
http-request-duration-max Requests no rule: no rule yet, #1982
http-request-count Requests no rule: a throughput count: its rate is load, not health
db-slow-query-count Requests no rule: no rule yet, #1982
bus-request-failure-count Requests no rule: no rule yet, #1982
db-pool-acquired Requests no rule: no rule yet, #1984
db-pool-wait-count Requests no rule: no rule yet, #1984
db-pool-wait-duration Requests no rule: no rule yet, #1984
db-connection-count Requests no rule: no rule yet, #1984
db-connection-idle-in-transaction-count Requests no rule: no rule yet, #1984
db-transaction-oldest-age Requests no rule: no rule yet, #1984
ingest-lag Ingest no rule: read beside ingest-lag-max, which the ingest-lag-high rule watches
ingest-lag-max Ingest ingest-lag-high
ingest-batch-count Ingest no rule: a throughput count: its rate is load, not health
ingest-sample-count Ingest no rule: a throughput count: its rate is load, not health
push-lane-refusal-count Ingest no rule: no rule yet, #1982
push-lane-turn-wait-p99 Ingest no rule: no rule yet, #1982
push-lane-turn-wait-max Ingest no rule: no rule yet, #1982
bus-consumer-pending Queues no rule: no rule yet, #1977
bus-consumer-ack-pending Queues no rule: no rule yet, #1982
bus-consumer-ack-floor Queues no rule: a stream position, read against the stream's head by the lab's measure, not a health figure
bus-telemetry-ack-failure-count Queues no rule: no rule yet, #1982
calc-pending-depth Queues no rule: no rule yet, #1982
outbox-queued-depth Queues no rule: no rule yet, #1982
outbox-due-age Queues no rule: no rule yet, #1982
ingest-lane-busy Queues no rule: no rule yet, #1977
sweep-failure-count Queues no rule: no rule yet, #1982
rule-sweep-age Queues rule-sweep-stalled
retention-behind Retention retention-behind
retention-deleted-count Retention no rule: a throughput count: its rate is load, not health
retention-pass-failure-count Retention no rule: read beside retention-behind, which flags a failing pass too
metric-oldest-day-age Retention no rule: no rule yet, #1982
db-size Retention db-size-growing
table-bytes Retention no rule: no rule yet, #1982
delivery-loss-ratio Pipeline no rule: no rule yet, #1977