observability: monitor-node-readings — monitoring's fourth signal — nullable readings and the telemetry state classifier #800

Closed
opened 2026-08-25 10:58:06 +00:00 by matou-build-agent · 2 comments

Parent

Feature spec: #769 — control-panel observability child spec: device telemetry (P9) (DDR 0202).
Design ticket #759; slice-map fan-in #770; wayfinder map #7.
Slice monitor-node-readings of docs/slices/observability.yaml; covers spec #769 stories 30–32, 38–40.

What to build

Resource readings become the thing monitoring collects fourth, beside health, heartbeats
and checks. They ride the enrolled node's existing periodic report as an additive, nullable block
(CPU %, memory %, disk %, temperature, node_exporter-style) landing through the authenticated
ingest that already refuses strangers — no new agent binary, no new port, no new ingest
surface
. Monitoring stores each node's latest sample with its timestamp; there is no series,
because there is no history surface in v1.

The telemetry state classifier lives here and only here: reporting (within cadence),
stale (age > 2× the collection cadence), last-known (carrying DDR 0071's existing silence
verdict, not a second judgement), none (never reported) and unavailable (the collector
faulted for an online node). The freshness verdict is computed once, server-side, so no two
surfaces can disagree — the dashboard renders the named state and performs no timestamp
arithmetic (ADR 0097).

Absence never becomes zero at any layer: a node that has never reported is null through wire,
projection and view, and a partial sample keeps the readings it does carry.

Annotation, not an edge (slice-map ruling 2): the day a resource-pressure alert is specced it
would read statusGrades from ui-kit-telemetry-primitives; #769 puts new alert behaviour out
of scope, so v1 raises nothing off them and this slice carries no edge to the primitives.

Acceptance criteria

  • (story 38) Given an enrolled node's periodic report, when it carries the nullable resource block, then it lands through the existing authenticated ingest; and given an unenrolled caller, then it is refused exactly as today and nothing lands.
  • (story 38) Given monitoring's aggregation, then it stores each node's latest sample with its timestamp and stores no history series.
  • (story 31) Given any telemetry projection served to the dashboard, then it carries a named state — reporting / stale / last-known / none / unavailable — computed by monitoring, plus the sample timestamp and its rendered age.
  • (story 17/32) Given a latest sample older than 2× the collection cadence, then the state is stale; the bar is system-defined and is not an operator-editable setting anywhere in the panel.
  • (story 20/21) Given a node monitoring has classified silent, then the state is last-known and it carries monitoring's own DDR 0071 silence verdict — the classifier re-judges nothing here and nothing downstream re-judges it either.
  • (story 24) Given a connected node that has never reported a sample, then the state is none.
  • (story 27) Given an online node whose collector faults, then the state is unavailable — distinct from stale, and never conflated with it.
  • (story 39) Given a node that has never reported readings, then its readings are null through every layer and no layer substitutes 0; and given a node reporting some readings but not others (no temperature sensor), then the present readings are kept and the absent one reads not-reported — a partial sample is not discarded.

Blocked by

  • monitoring:status-surface-classifier (#80 — done, satisfied)
  • monitoring:silence-classifier (#83 — done, satisfied)

Task manifest

task: observability:monitor-node-readings
interface: the enrolled node's periodic status report gains a nullable resource block (cpuPct / memPct
  / diskPct / temperature); monitoring keeps the latest sample + timestamp per node and exposes a computed
  telemetry state `reporting | stale | last-known | none | unavailable`
seam: 'Go monitoring unit tests (prior art `monitor_test.go`, `silence_test.go`, `authenticated_stream_test.go`):
  fresh sample → reporting; age > 2× cadence → stale; a silent node → last-known carrying the existing
  silence verdict; never-reported → none; a collector fault on a live node → unavailable; an unenrolled
  reporter refused with nothing landing; a partial sample keeping its present readings'
acceptance:
- given: an enrolled node reporting readings
  when: the periodic report lands
  then: the latest sample and its timestamp are stored and no series is kept
- given: a sample older than 2× the collection cadence
  when: the classifier runs
  then: the state is `stale` and never `reporting`
- given: a node monitoring has classified silent
  when: the classifier runs
  then: the state is `last-known` carrying DDR 0071's existing silence verdict verbatim
- given: a node that never reported
  when: the classifier runs
  then: the state is `none` and every reading is null — no layer substitutes 0
- given: an online node whose collector faults
  when: the classifier runs
  then: the state is `unavailable`, distinct from `stale`
- given: an unenrolled caller posting readings
  when: the ingest is called
  then: it is refused as today and nothing lands
depends_on:
- monitoring:status-surface-classifier
- monitoring:silence-classifier
out_of_scope:
- history charts / any time series — no series is stored by this slice
- per-process or per-service resource breakdown
- threshold editing — the staleness bar and grading constants are system-defined
- temperature grading or alerting — a plain fact only in v1
- 'new alert behaviour: v1 raises nothing off the resource constants, which is why this slice carries
  no edge to `ui-kit-telemetry-primitives` (ruling 2)'
- any new agent binary, port or ingest surface
needs_human_decision: []

Emitted by /to-tickets over docs/slices/observability.yaml in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.

## Parent Feature spec: **#769** — control-panel observability child spec: device telemetry (P9) (DDR 0202). Design ticket #759; slice-map fan-in **#770**; wayfinder map #7. Slice `monitor-node-readings` of `docs/slices/observability.yaml`; covers spec #769 stories 30–32, 38–40. ## What to build Resource readings become the thing monitoring collects **fourth**, beside health, heartbeats and checks. They ride the enrolled node's existing periodic report as an additive, nullable block (CPU %, memory %, disk %, temperature, node_exporter-style) landing through the authenticated ingest that already refuses strangers — **no new agent binary, no new port, no new ingest surface**. Monitoring stores each node's latest sample with its timestamp; there is no series, because there is no history surface in v1. The **telemetry state classifier lives here and only here**: `reporting` (within cadence), `stale` (age > 2× the collection cadence), `last-known` (carrying DDR 0071's existing silence verdict, not a second judgement), `none` (never reported) and `unavailable` (the collector faulted for an online node). The freshness verdict is computed once, server-side, so no two surfaces can disagree — the dashboard renders the named state and performs no timestamp arithmetic (ADR 0097). Absence never becomes zero at any layer: a node that has never reported is null through wire, projection and view, and a partial sample keeps the readings it does carry. **Annotation, not an edge** (slice-map ruling 2): the day a resource-pressure alert is specced it would read `statusGrades` from `ui-kit-telemetry-primitives`; #769 puts new alert behaviour out of scope, so v1 raises nothing off them and this slice carries no edge to the primitives. ## Acceptance criteria - [ ] (story 38) Given an enrolled node's periodic report, when it carries the nullable resource block, then it lands through the existing authenticated ingest; and given an unenrolled caller, then it is refused exactly as today and nothing lands. - [ ] (story 38) Given monitoring's aggregation, then it stores each node's latest sample with its timestamp and stores no history series. - [ ] (story 31) Given any telemetry projection served to the dashboard, then it carries a named state — `reporting` / `stale` / `last-known` / `none` / `unavailable` — computed by monitoring, plus the sample timestamp and its rendered age. - [ ] (story 17/32) Given a latest sample older than **2× the collection cadence**, then the state is `stale`; the bar is system-defined and is not an operator-editable setting anywhere in the panel. - [ ] (story 20/21) Given a node monitoring has classified silent, then the state is `last-known` and it carries monitoring's own DDR 0071 silence verdict — the classifier re-judges nothing here and nothing downstream re-judges it either. - [ ] (story 24) Given a connected node that has never reported a sample, then the state is `none`. - [ ] (story 27) Given an online node whose collector faults, then the state is `unavailable` — distinct from `stale`, and never conflated with it. - [ ] (story 39) Given a node that has never reported readings, then its readings are null through every layer and no layer substitutes `0`; and given a node reporting some readings but not others (no temperature sensor), then the present readings are kept and the absent one reads not-reported — a partial sample is not discarded. ## Blocked by - `monitoring:status-surface-classifier` (#80 — done, satisfied) - `monitoring:silence-classifier` (#83 — done, satisfied) ## Task manifest ```yaml task: observability:monitor-node-readings interface: the enrolled node's periodic status report gains a nullable resource block (cpuPct / memPct / diskPct / temperature); monitoring keeps the latest sample + timestamp per node and exposes a computed telemetry state `reporting | stale | last-known | none | unavailable` seam: 'Go monitoring unit tests (prior art `monitor_test.go`, `silence_test.go`, `authenticated_stream_test.go`): fresh sample → reporting; age > 2× cadence → stale; a silent node → last-known carrying the existing silence verdict; never-reported → none; a collector fault on a live node → unavailable; an unenrolled reporter refused with nothing landing; a partial sample keeping its present readings' acceptance: - given: an enrolled node reporting readings when: the periodic report lands then: the latest sample and its timestamp are stored and no series is kept - given: a sample older than 2× the collection cadence when: the classifier runs then: the state is `stale` and never `reporting` - given: a node monitoring has classified silent when: the classifier runs then: the state is `last-known` carrying DDR 0071's existing silence verdict verbatim - given: a node that never reported when: the classifier runs then: the state is `none` and every reading is null — no layer substitutes 0 - given: an online node whose collector faults when: the classifier runs then: the state is `unavailable`, distinct from `stale` - given: an unenrolled caller posting readings when: the ingest is called then: it is refused as today and nothing lands depends_on: - monitoring:status-surface-classifier - monitoring:silence-classifier out_of_scope: - history charts / any time series — no series is stored by this slice - per-process or per-service resource breakdown - threshold editing — the staleness bar and grading constants are system-defined - temperature grading or alerting — a plain fact only in v1 - 'new alert behaviour: v1 raises nothing off the resource constants, which is why this slice carries no edge to `ui-kit-telemetry-primitives` (ruling 2)' - any new agent binary, port or ingest surface needs_human_decision: [] ``` --- *Emitted by `/to-tickets` over `docs/slices/observability.yaml` in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.*
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=10069
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=10069 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #800 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 800,
  "status": "success",
  "commits": [
    "7f6cb6c"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/enroll/enroll.go",
    "internal/monitor/readings.go",
    "internal/monitor/readings_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/monitor/ ./internal/enroll/",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/enrollwire/ ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/monitor/ ./internal/enroll/ ./internal/enrollwire/",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "story 38 — nullable resource block lands through the existing authenticated ingest; an unenrolled caller refused, nothing lands": "enroll.ResourceReadings added nullable on StatusReport (internal/enroll/enroll.go), rides the existing FleetReporting heartbeat through AuthenticatedStream unchanged; TestTelemetry_RidesAuthenticatedIngestRefusesStrangers proves readings land intact for an enrolled node and a stranger is refused enroll.ErrNotEnrolled with nothing reaching the stream",
    "story 38 — monitoring stores each node's latest sample with its timestamp, no history series": "the heartbeat store keeps the latest StatusReport (with Readings) + arrival stamp, latest-wins; TestTelemetry_LatestSampleNoSeries proves a second report replaces the first and only the newest sample is projected",
    "story 31 — any telemetry projection carries a named state computed by monitoring plus sample timestamp and rendered age": "Orchestrator.Telemetry()/NodeTelemetry() return TelemetryView{State, SampledAt, Age}; classifyTelemetry computes state/age once server-side (readings.go); TestTelemetry_FreshSampleReporting asserts state+SampledAt+Age",
    "story 17/32 — sample older than 2x collection cadence is stale; the bar is system-defined, not operator-editable": "ReadingsCadence=2m constant, stale when now-sampledAt > 2*ReadingsCadence and under StaleAfter; no operator setter exists; TestTelemetry_StalePast2xCadence",
    "story 20/21 — a silent node is last-known carrying DDR 0071's silence verdict verbatim, re-judged by nobody": "classifyTelemetry returns TelemetryLastKnown with the SilenceView from judgeSilence (DDR 0071) unchanged; TestTelemetry_SilentIsLastKnownCarryingSilenceVerdict asserts the critical silence verdict + standing alert id ride the last-known view",
    "story 24 — a connected node that never reported a sample is none": "!reported and readings-absent both map to TelemetryNone with nil readings; TestTelemetry_NeverReportedIsNone",
    "story 27 — an online node whose collector faults is unavailable, distinct from stale": "a fresh report with ResourceReadings.Unavailable maps to TelemetryUnavailable before the stale branch; TestTelemetry_CollectorFaultOnLiveNodeIsUnavailable asserts unavailable and never stale",
    "story 39 — a never-reported node's readings are null through every layer (no 0); a partial sample keeps present readings and reads the absent one not-reported": "projectReadings maps nil per nil field and returns nil when nothing present, never a zeroed sample; TestTelemetry_NeverReportedIsNone (nil readings) and TestTelemetry_PartialSampleKeepsPresentReadings (cpu/mem/disk kept, temperature nil)"
  },
  "summary": "Added monitoring's fourth signal — a nullable resource-readings block on the enrolled node's periodic report and the single server-side telemetry state classifier (reporting/stale/last-known/none/unavailable) with absence carried as nil at every layer.",
  "blockers": []
}
**close-report** for #800 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 800, "status": "success", "commits": [ "7f6cb6c" ], "changed_files": [ "STATUS.md", "internal/enroll/enroll.go", "internal/monitor/readings.go", "internal/monitor/readings_test.go" ], "tests": [ { "command": "go test ./internal/monitor/ ./internal/enroll/", "exit_code": 0 }, { "command": "go test ./internal/enrollwire/ ./control-plane/...", "exit_code": 0 }, { "command": "go vet ./internal/monitor/ ./internal/enroll/ ./internal/enrollwire/", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 } ], "criteria": { "story 38 — nullable resource block lands through the existing authenticated ingest; an unenrolled caller refused, nothing lands": "enroll.ResourceReadings added nullable on StatusReport (internal/enroll/enroll.go), rides the existing FleetReporting heartbeat through AuthenticatedStream unchanged; TestTelemetry_RidesAuthenticatedIngestRefusesStrangers proves readings land intact for an enrolled node and a stranger is refused enroll.ErrNotEnrolled with nothing reaching the stream", "story 38 — monitoring stores each node's latest sample with its timestamp, no history series": "the heartbeat store keeps the latest StatusReport (with Readings) + arrival stamp, latest-wins; TestTelemetry_LatestSampleNoSeries proves a second report replaces the first and only the newest sample is projected", "story 31 — any telemetry projection carries a named state computed by monitoring plus sample timestamp and rendered age": "Orchestrator.Telemetry()/NodeTelemetry() return TelemetryView{State, SampledAt, Age}; classifyTelemetry computes state/age once server-side (readings.go); TestTelemetry_FreshSampleReporting asserts state+SampledAt+Age", "story 17/32 — sample older than 2x collection cadence is stale; the bar is system-defined, not operator-editable": "ReadingsCadence=2m constant, stale when now-sampledAt > 2*ReadingsCadence and under StaleAfter; no operator setter exists; TestTelemetry_StalePast2xCadence", "story 20/21 — a silent node is last-known carrying DDR 0071's silence verdict verbatim, re-judged by nobody": "classifyTelemetry returns TelemetryLastKnown with the SilenceView from judgeSilence (DDR 0071) unchanged; TestTelemetry_SilentIsLastKnownCarryingSilenceVerdict asserts the critical silence verdict + standing alert id ride the last-known view", "story 24 — a connected node that never reported a sample is none": "!reported and readings-absent both map to TelemetryNone with nil readings; TestTelemetry_NeverReportedIsNone", "story 27 — an online node whose collector faults is unavailable, distinct from stale": "a fresh report with ResourceReadings.Unavailable maps to TelemetryUnavailable before the stale branch; TestTelemetry_CollectorFaultOnLiveNodeIsUnavailable asserts unavailable and never stale", "story 39 — a never-reported node's readings are null through every layer (no 0); a partial sample keeps present readings and reads the absent one not-reported": "projectReadings maps nil per nil field and returns nil when nothing present, never a zeroed sample; TestTelemetry_NeverReportedIsNone (nil readings) and TestTelemetry_PartialSampleKeepsPresentReadings (cpu/mem/disk kept, temperature nil)" }, "summary": "Added monitoring's fourth signal — a nullable resource-readings block on the enrolled node's periodic report and the single server-side telemetry state classifier (reporting/stale/last-known/none/unavailable) with absence carried as nil at every layer.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#800
No description provided.