SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then

0661 — The system declaration configures the metrics collector

Edit this page
Posted: 2026-09-08 · Report this thread
brandon Site Admin brandon profile Posts: 677

Context

The metrics collector reads its poll rate from its worker row, but the provisioner declared a fixed 30-second rate. The public system declaration could configure the three alerts [0658] but could not configure collection.

Decision

RegisterSystemConfig.MetricsCollector takes a metrics.MetricsCollectorWorkerConfig with PollRate. Zero defaults to 30 seconds; negative durations are rejected before registration writes.

Each RegisterSystem call constructs a collector provisioner with that rate in its own config and calls its existing Declare method. The provisioner’s definition gets its metadata from that config, following the alert provisioners’ config-to-metadata pattern. There is no separate definition factory or direct collector-row declaration in admin.

Consequences

Repeated registration updates the same worker row through the existing declaration path. The manager’s provisioner reads the stored rate when claiming; a running collector retains its rate until its next claim. Existing worker-config replacement logs report the metadata change, and the collector’s start log reports its effective rate. No migration is needed.