Skip to content

Metrics and properties

Partial

Omniglass records what it knows about the fleet as samples in two lanes: a metric is a quantity, a property is a value. This page is the value model: the lanes and their catalogs, provenance, who may write a key, and how a value reads back. How samples arrive is collection and messaging; the physical tables are storage. To manage the catalogs, see metrics and properties.

The telemetry model is five lanes with no overlap: a metric, a property, an event, a command and a log line. This page owns the two sample lanes:

  • A metric is a quantity: a number of a registered metric_type, stored as a float. Quantities aggregate: an average volume, a p95 latency and a rate are all meaningful. It is the firehose, and every observation is kept.
  • A property is a value: what something is, stored as jsonb and typed by a registered property_type. A value can be a number used as a name (input 3), which is meaningless to average. Values have duration instead (“how long was it on input 3?”), so the lane is written transition-only: one row per change.

A probe’s state is a property (icmp-reachable is up or down, tcp-open is open or closed), written once per flip, while its timing beside it (icmp-rtt-avg, tcp-connect-time) is a metric (ADR-1592).

A sample is one timestamped reading, (owner, type, instance, ts, value, provenance, source, lineage). A series is one stream of them, (type, owner, instance, provenance). Which lane a name belongs to is decided by catalog membership alone: volume is a metric because metric_type holds it (ADR-0079).

A sample is owned by exactly one component, system, location or outpost (the exclusive-arc). A system owns what a push or a calc rule reports for it as a whole, and its health; an outpost owns its self-health; a location owns only an operator’s declared values and its calculated health, never an observed sample (ADR-0422).

The instance dimension: many values of one name on one owner

Section titled “The instance dimension: many values of one name on one owner”

One owner can hold several values of one name (three fan speeds, per-port counters). The catalog holds one row per measurement (fan-speed), and an instance text column, empty by default, discriminates. Each provenance has exactly one stamper (ADR-0456):

  • observed: the observer. An outpost-lane sample is stamped with the name of the endpoint whose task collected it, so two endpoints reporting one name stay two series. A push names an endpoint of its owner, or lands owner-level; naming anything else is a 422 that lists the owner’s endpoints. A value a conduit fans out to another owner lands owner-level, its observer named in source (ADR-1282).
  • declared: owner-level, the empty instance, on every shipped route.
  • intended: the command’s instance, empty for an owner-level command.
  • calculated and health: always the empty instance. An entity has one health.

A question about the owner reduces across every live instance of the key; a question naming an instance reads that series alone. An instance is not live once its endpoint is deleted, or once its driver’s current spec no longer emits the key, so a frozen last reading never stands against the owner forever. Reconciliation reduces worst-case, command settlement reduces any-instance-agrees, and a current-value read shows the newest live value and says which instance it came from, with instance_count and each instance’s latest beside it.

The has-a-value-now razor (sample vs event)

Section titled “The has-a-value-now razor (sample vs event)”

A sample records a value; an event records an occurrence. “Input is 1” is a value, so a property. “Call started” is an occurrence (“what is call-started now?” means nothing), so an event. An unnormalized raw line (a syslog line, a raw webhook frame) is neither: it is a log line, untyped and with no catalog gate.

Each typed lane has its catalog: metric_type and property_type for samples, event_type and command_type beside them. The two sample catalogs split on what the value is:

  • metric_type: data_type int or float, a unit, a display precision, an optional retention_days. Unit and precision live here and only here.
  • property_type: data_type string, bool or json, an optional JSON Schema validation, an optional retention_days. No unit.

A name is one kebab segment (at most 100 characters, no dots) naming a measurement, never its owner: temperature, not room-temperature; fan-speed with unit rpm, not fan-rpm. One canonical name is one comparable signal across vendors. The shipped set seeds from internal/seed/metric_types.yaml and property_types.yaml.

One name space, two tiers. The metric, property and event catalogs share one name space, so a name resolves to one row across all three. Every row has a namespace: og for the platform’s, which only the boot seed writes, and local for an admin’s (ADR-0318). A bare name resolves along a search path, local first, then og, through one function, storage.ResolveNameLane, which ingest, event rules, calc rules and driver emits all share. So when a release ships a name an admin already coined, theirs shadows it and their series keep landing where they did (ADR-1307); the server logs the shadow at catalog build and hourly. An admin’s create never takes a name og holds. A shipped rule or driver resolves its own names inside og.

Checked on ingest. A sample whose name does not resolve in its lane’s catalog is refused (reject-not-project), and a property value must parse as the type’s data_type and satisfy its validation. The ingest consumer keeps the catalogs between batches and rebuilds them when their fingerprint moves, so a new type is honored within seconds (ADR-1279).

The official flag and the namespace together say whose a row is: a shipped, read-only og row, or an admin’s local one. Every sample is typed by a catalog row (the foreign key is non-null), and a driver’s emit names a catalog row, checked when the spec is written. A template is never a scope: it is cloned, never pointed at (ADR-0827).

Only a metric has a unit, and even a dimensionless one has one (ratio, count). Storage is canonical at rest: each metric type declares one unit, every stored value is in it, and every threshold and calc compares like with like. A driver normalizes at the edge (a Fahrenheit display’s driver emits Celsius), so the native unit is a collection fact, never a storage fact. A ratio is stored 0..1 (cpu-utilization is 0.9, shown as 90%). precision is a display default; storage keeps full precision.

Lane is a property of the name; provenance is a property of the row. The same name can be observed, calculated, intended or declared, side by side in one table, each pointing at what produced it (its lineage):

ProvenanceHow we know itLineage
observedreported by a component, an outpost or a pushsource_rule and its version, where an edge parse produced it
calculatedderived by a calc rulesource_rule, its id and version
intendedthe effect a command we issued expectscommand_id
declaredset by an operatornone

The property lane admits all four; the metric lane admits the first three. A separate source column records which sensor or path produced an observed value (codec-cec against display-lan), so three sensors on one display’s power are three observed rows differing only in source.

observed: from a component, via an edge parse

Section titled “observed: from a component, via an edge parse”

The outpost parses the device’s answer at the edge and publishes the sample onto the bus; it never writes to Postgres. The raw payload is not kept. Two lanes feed one write path: the outpost lane, where the server binds the owner from the task’s endpoint, and the push lane (POST /telemetry:push), where a scoped caller names the owner and the scope check is the fence. Both land a batch in one transaction under its receipt, so a redelivered batch lands once (ADR-0311).

A calc rule’s tick reduces its inputs’ current values and writes the result through the same write path as a calculated row naming the rule, on a server tick rather than the stream (ADR-0148). An unchanged result writes nothing. A calculated property resolves as the owner’s value where nothing is declared, after a declared value and before the contract default. How a rule runs is on calculations.

intended: the declared effect of a command

Section titled “intended: the declared effect of a command”

Issuing a settleable command writes, in one transaction, the command row, a caused event and an intended row in its target lane, whose lineage is the command itself. It is a bet, settled by the observation that follows: intended against observed is the central razor, intent in progress against measured reality. Only a command writes an intended row; an outside event implying a value (“meeting started, so the room is occupied”) is an observation.

declared: an operator’s assertion, as a series row

Section titled “declared: an operator’s assertion, as a series row”

Anything an operator sets on an owner (an asset tag, a locked input) is a declared row in the property series:

  • An edit appends, so the edit history is the series.
  • Unset is a tombstone: a declared row whose value is JSON null, read as absence.
  • An identical re-set writes nothing.

The effective read coalesces the classifier’s contract default in when the series says nothing.

Provenance says how a row knows its value; the writer class says who may write the key at all (ADR-0161). Every metric, property and event type has exactly one, resolved from its name and never stored, and the Storage Gateway refuses any write the class does not admit. Type reads carry it as writer_class:

Writer classHoldsAdmits
outpost-probe (reserved) what an outpost's own probes and session machine write: the outpost's account of an endpoint : collection-failed, endpoint-authenticated, endpoint-reachable, endpoint-rejection, endpoint-rejection-reason, endpoint-responsive, hold-expiry-count, http-response-time, icmp-reachable, icmp-rtt-avg, poll-cpu-time, poll-due-count, poll-duration, poll-failure-count, poll-held-count, poll-skipped-count, push-message-count, push-unclaimed-count, session-reason, session-state, snmp-response-time, ssh-handshake-time, ssh-host-key, tcp-connect-time, tcp-open, telnet-response-time, tls-certificate, tls-certificate-days-left, tls-certificate-expiry, tls-handshake-time, udp-response-time
  • outpost: the outpost lane, under the endpoint whose task the outpost ran
  • key-pin on ssh-host-key alone: an operator's pin, set with an ssh endpoint's :retry (ADR-0157)
  • key-pin on tls-certificate alone: an operator's pin, set with a tls endpoint's :retry (ADR-0160)
platform (reserved) what only the Omniglass process writes about itself or its rollups : bus-consumer-ack-floor, bus-consumer-ack-pending, bus-consumer-pending, bus-consumer-redelivered, bus-request-count, bus-request-failure-count, bus-stream-last-seq, bus-telemetry-ack-failure-count, bus-worklist-pull-count, bus-worklist-reply-bytes-max, calc-pass-duration, calc-pending-depth, calc-served-count, checkin-age, command-dispatch-latency, command-execution-latency, command-expired-count, command-pending-age, command-pending-count, command-pull-failure-count, command-redelivery-count, command-stuck-count, data-dir-disk-used-ratio, db-connection-count, db-connection-idle-in-transaction-count, db-connection-limit, db-pool-acquire-count, db-pool-acquired, db-pool-idle, db-pool-max, db-pool-total, db-pool-wait-count, db-pool-wait-duration, db-size, db-slow-query-count, db-transaction-oldest-age, delivery-in-count, delivery-loss-ratio, delivery-out-count, health, http-request-count, http-request-duration, http-request-duration-max, ingest-batch-count, ingest-lag, ingest-lag-max, ingest-lane-busy, ingest-sample-count, lane-worker-count, metric-block-mark-lag, metric-oldest-day-age, metric-partition-count, metric-partition-created-count, metric-partition-dropped-count, metric-trend-mark-lag, outbox-due-age, outbox-queued-depth, process-cpu-seconds, process-fd-count, process-gc-pause, process-goroutine-count, process-heap-size, process-uptime, push-lane-publish-count, push-lane-refusal-count, push-lane-turn-wait-max, push-lane-turn-wait-p99, retention-behind, retention-deleted-count, retention-pass-duration, retention-pass-failure-count, retention-window-days, rule-sweep-age, schedule-gap-excess, schedule-lateness, schedule-skip-count, server-started-at, server-version, session-held-count, spool-batch-count, sweep-count, sweep-duration, sweep-failure-count, table-bytes, tick-duration, tick-overrun-count, webhook-post-count, webhook-refusal-count, worker-busy-fraction, worklist-pull-loss-ratio, worklist-task-count
  • process: the Omniglass process: the health rollup, the webhook receiver, and the platform's self-monitoring, an outpost's self-report landed on its platform component
command-lifecycle (reserved) the events a command's own lifecycle writes on its owner's timeline : command-failed, command-issued, command-settled, command-timed-out
  • command: a command's intended value and caused event
calc a key a calc rule names as its output
  • calc-rule: the calc rule's tick
  • operator: an operator's declared value
collected every other key: what a driver's emits, a push, a command or an operator say
  • outpost: the outpost lane, under the endpoint whose task the outpost ran
  • push: the telemetry push lane
  • fan-out: a conduit's value fanned out to the owner its identity binding names (ADR-1282)
  • command: a command's intended value and caused event
  • command-reply: a command's reply, read through its driver binding
  • operator: an operator's declared value
  • event-rule: an event rule's fire or clear event

Three classes are reserved and internal: outpost-probe (an outpost’s own account of an endpoint), platform (what only Omniglass writes: the health rollup, and each outpost’s and the server’s account of itself, listed on collection) and command-lifecycle (the events a command’s issue and terminal status write). Their names are closed to an admin’s catalog row and to every contract. A writer is the entry point a write comes through, and it fixes the provenance: the outpost and push lanes write observed, a calc rule calculated, a command intended, an operator declared.

  • An outpost-probe key reads only as the outpost’s observation. The one declared row the family admits is a key pin (an ssh host key, a tls certificate), set only through an endpoint’s audited :retry.
  • A calc rule owns its output. Once a rule outputs a key, a push, outpost lane or driver spec writing it is refused.
  • Fusion is within a class: the perspectives of a collected key, told apart by source.

“What is this now?” is answered by reading the series: the latest row per (type, owner, instance, provenance). No current-value cache is kept beside it (ADR-0079).

  • A declared or intended series orders by insertion. Neither carries a caller’s timestamp, so the row id is the sequence, and a database clock stepping backwards cannot make the earlier write win.
  • An observed or calculated series orders by ts, then id. The lane accepts a caller’s timestamp (an outpost backfilling), and a late-arriving older sample must not become current by being written last.

The property lane is sparse, so the read is an index probe. A metric is stored narrow, (id, series_id, ts, value), beside a metric_series row naming what it is a sample of (ADR-1275), partitioned by month, with intended rows in their own table no retention pass touches.

Retention prunes metric samples past retention.metric_days (14 by default) and property transitions past retention.property_days (90), or a type’s own retention_days (:setRetention). A prune never deletes a declared or intended row, and on the property lane never deletes the latest row of a series, since a steady value may hold one row for months.

A series chart is truthful at every zoom (#1269)

Section titled “A series chart is truthful at every zoom (#1269)”

The samples routes (GET /{components,systems}/{name}/metrics/{metric}/samples and .../properties/{property}/samples) answer a different question when given a resolution in seconds: every regular bucket of the window, oldest first.

  • The grid is epoch-aligned and complete. Thirty days at one hour is exactly 720 buckets, and an empty bucket is still there with count: 0: a gap is told, not skipped. More than 5,000 buckets is a 422.
  • A metric bucket keeps what an average loses: min, max, avg, count and last, so a one-sample spike survives any zoom as the band under the line.
  • A property bucket is count, last and held, the value in force across it, drawn as steps, with carried_in the value in force when the window opened.
  • A bucket is one series of measured rows: a declared or intended row never moves it, and several instances with readings make the read a 422 that lists them, so a caller picks one rather than charting a blend.
  • Nothing is read past what is kept: covered_from says where retention ends.
  • A wide metric read is whole hours. Past 48 hours, the resolution rises to whole hours and closed hours come from the series’ hourly trend, so a month reads 720 rows rather than 86,400 samples (ADR-1566).

An owner’s properties read (GET /{components,systems,locations}/{name}/properties) carries the reconciliation on each row (ADR-1297):

  • want: the current declared value, else the contract default; null when nothing declares one.
  • told: the newest intended value on any instance a command named.
  • is: the observed value, worst-case over the live instances (one that disagrees with want, if any does), named by is_instance.
  • drift: true when an observed instance disagrees with want, false when nothing is declared. Computed on read, so it cannot go stale.

An observed value is stored as its text form, so every comparison first reads it typed by the property’s data_type: 3 and 3.0, or an object’s key order, compare equal (ADR-1202). A reserved key (a probe key, health) is not a row here; a probe key reads on the reachability read. The command adds the windowed form: settlement is told against is, gated on the settle window.

The pipeline stays acyclic:

A rule may read observed and calculated values as truth. It may compare an intended or declared value against observed. It may not treat an intended value as truth to infer a new fact.

The one forward edge, a command to its intended row, is terminal, so rules reading only observed and calculated values keep the graph acyclic with no runtime guard.

The partitioning and lineage CHECKs are on storage.

metric_series (telemetry): generated from the migrated schema by make gen
Column Type Constraints Notes
id bigint PK
metric_type_id uuid FK → metric_type.id, not null The canonical name the series is a reading of
owner_kind text not null
component_id uuid FK → component.id
system_id uuid FK → system.id
location_id uuid FK → location.id
outpost_id uuid FK → outpost.user_id
owner_id uuid
instance text not null, default ''::text Which of several values of one name on one owner; empty is the owner-level series
provenance text not null observed, calculated or intended
source text not null, default ''::text The sensor or path that produced an observed value
collector_outpost_id uuid
source_conduit_id uuid
CHECK constraints and unique indexes on metric_series
  • metric_series_owner_arc_check: CHECK ((((owner_kind = 'component'::text) AND (component_id IS NOT NULL) AND (system_id IS NULL) AND (location_id IS NULL) AND (outpost_id IS NULL)) OR ((owner_kind = 'system'::text) AND (system_id IS NOT NULL) AND (component_id IS NULL) AND (location_id IS NULL) AND (outpost_id IS NULL)) OR ((owner_kind = 'location'::text) AND (location_id IS NOT NULL) AND (component_id IS NULL) AND (system_id IS NULL) AND (outpost_id IS NULL)) OR ((owner_kind = 'outpost'::text) AND (outpost_id IS NOT NULL) AND (component_id IS NULL) AND (system_id IS NULL) AND (location_id IS NULL))))
  • metric_series_owner_kind_check: CHECK ((owner_kind = ANY (ARRAY['component'::text, 'system'::text, 'location'::text, 'outpost'::text])))
  • metric_series_provenance_check: CHECK ((provenance = ANY (ARRAY['observed'::text, 'calculated'::text, 'intended'::text])))
  • metric_series_key: CREATE UNIQUE INDEX metric_series_key ON public.metric_series USING btree (owner_id, metric_type_id, instance, provenance, source, collector_outpost_id, source_conduit_id) NULLS NOT DISTINCT
metric (telemetry): generated from the migrated schema by make gen
Column Type Constraints Notes
id bigint not null
series_id bigint not null The series this sample belongs to
ts timestamp with time zone not null, default date_trunc('milliseconds'::text, now())
value double precision not null The number; aggregation happens here
source_rule_version bigint
source_rule text
source_rule_id uuid
property (telemetry): generated from the migrated schema by make gen
Column Type Constraints Notes
id bigint PK
ts timestamp with time zone not null, default now()
owner_kind text not null
instance text not null, default ''::text Same series discrimination as a metric
provenance text not null, default 'observed'::text observed, calculated, intended or declared
source text not null, default ''::text
source_rule text
source_rule_version bigint
event_id bigint FK → event.id
component_id uuid FK → component.id
system_id uuid FK → system.id
location_id uuid FK → location.id
outpost_id uuid FK → outpost.user_id
property_type_id uuid FK → property_type.id, not null The canonical name this sample is a value of
value jsonb not null The jsonb value; transitions only; JSON null is the declared tombstone
command_id bigint FK → command.id Lineage of an intended value: the command that opened it
source_rule_id uuid
source_conduit_id uuid
CHECK constraints and unique indexes on property
  • property_lineage_check: CHECK ((((provenance = 'observed'::text) AND (event_id IS NULL) AND (command_id IS NULL)) OR ((provenance = 'calculated'::text) AND (source_rule IS NOT NULL) AND (event_id IS NULL) AND (command_id IS NULL)) OR ((provenance = 'intended'::text) AND (command_id IS NOT NULL) AND (source_rule IS NULL)) OR ((provenance = 'declared'::text) AND (source_rule IS NULL) AND (event_id IS NULL) AND (command_id IS NULL))))
  • property_owner_arc_check: CHECK ((((owner_kind = 'component'::text) AND (component_id IS NOT NULL) AND (system_id IS NULL) AND (location_id IS NULL) AND (outpost_id IS NULL)) OR ((owner_kind = 'system'::text) AND (system_id IS NOT NULL) AND (component_id IS NULL) AND (location_id IS NULL) AND (outpost_id IS NULL)) OR ((owner_kind = 'location'::text) AND (location_id IS NOT NULL) AND (component_id IS NULL) AND (system_id IS NULL) AND (outpost_id IS NULL)) OR ((owner_kind = 'outpost'::text) AND (outpost_id IS NOT NULL) AND (component_id IS NULL) AND (system_id IS NULL) AND (location_id IS NULL))))
  • property_owner_kind_check: CHECK ((owner_kind = ANY (ARRAY['component'::text, 'system'::text, 'location'::text, 'outpost'::text])))
  • property_provenance_check: CHECK ((provenance = ANY (ARRAY['observed'::text, 'calculated'::text, 'intended'::text, 'declared'::text])))
metric_type (telemetry): generated from the migrated schema by make gen
Column Type Constraints Notes
name text not null
label text
data_type text not null The lane key: int or float
unit text The canonical unit every stored value is in
precision integer Display significant digits; a presentation default
fusion_policy jsonb
description text not null, default ''::text
registered_at timestamp with time zone not null, default now()
official boolean not null, default false
id uuid PK, default uuidv7()
retention_days integer
namespace text not null, default 'local'::text og for a shipped row, local for an admin one
CHECK constraints and unique indexes on metric_type
  • metric_type_data_type_check: CHECK ((data_type = ANY (ARRAY['int'::text, 'float'::text])))
  • metric_type_namespace_check: CHECK ((namespace ~ '^[a-z0-9][a-z0-9-]*$'::text))
  • metric_type_og_official_check: CHECK (((namespace <> 'og'::text) OR official))
  • metric_type_retention_days_check: CHECK (((retention_days IS NULL) OR ((retention_days >= 1) AND (retention_days <= 36500))))
  • metric_type_namespace_name_key: CREATE UNIQUE INDEX metric_type_namespace_name_key ON public.metric_type USING btree (namespace, name)
property_type (telemetry): generated from the migrated schema by make gen
Column Type Constraints Notes
name text not null
label text
data_type text not null The lane key: string, bool or json
fusion_policy jsonb
validation jsonb The JSON Schema a value must satisfy
description text not null, default ''::text
registered_at timestamp with time zone not null, default now()
official boolean not null, default false
id uuid PK, default uuidv7()
retention_days integer
namespace text not null, default 'local'::text og for a shipped row, local for an admin one
CHECK constraints and unique indexes on property_type
  • property_type_data_type_check: CHECK ((data_type = ANY (ARRAY['string'::text, 'bool'::text, 'json'::text])))
  • property_type_namespace_check: CHECK ((namespace ~ '^[a-z0-9][a-z0-9-]*$'::text))
  • property_type_og_official_check: CHECK (((namespace <> 'og'::text) OR official))
  • property_type_retention_days_check: CHECK (((retention_days IS NULL) OR ((retention_days >= 1) AND (retention_days <= 36500))))
  • property_type_namespace_name_key: CREATE UNIQUE INDEX property_type_namespace_name_key ON public.property_type USING btree (namespace, name)