Expand description
Coordinator-installed metric sinks, the curated counterpart to CREATE METRIC SINK.
A curated metric sink is a CURATED entry rendered on every replica, publishing its series
into that replica’s process-local Prometheus registry. Unlike a user’s CREATE METRIC SINK it
is not a catalog item: it gets a transient GlobalId, targets one replica rather than a
cluster, and is re-created from the static list on every boot. Modelling the curated set this
way keeps it out of the catalog, so adding or removing a definition needs no builtin migration.
Every replica means every replica of every cluster, user clusters included. Each definition is
therefore a dataflow, with its arrangements, on customer compute, charged to that customer’s
cluster, and the cost scales with CURATED. coord::introspection already accepts this for its
subscribes.
install_metric_sinks installs every definition on a newly created replica
(bootstrap_metric_sinks covers the replicas already present at startup), and
drop_metric_sinks drops them before a replica is dropped. This mirrors
crate::coord::introspection, which installs introspection subscribes on the same triggers.
Structs§
- Curated
Metric 🔒Sink - A curated metric sink: SQL producing the canonical metric-sink columns, plus the name it is known by in logs.
- Installed
Metric 🔒Sink - A
CuratedMetricSinkinstalled on one replica. - Planned
Metric 🔒Sink - A
CuratedMetricSinkplanned once and shared across the replicas it installs on. SeeCoordinator::plan_metric_sink.
Constants§
- CURATED 🔒
- The curated metric sinks, installed on every replica.
Functions§
- ensure_
reads_ 🔒only_ logs - Enforces the introspection-only contract from
CuratedMetricSink::source_sql: every relation the definition reads, walking views transitively, must be a log collection. - metric_
sinks_ 🔒on_ replica - The registry entries installed on
replica_id, as(name, cluster, sink)in key order.