Expand description
periodic self-observability collector for the metadata Postgres’s pg_stat_* views
Periodic self-observability collector for the metadata Postgres:
samples the standard pg_stat_* catalog views (plus index/table sizes) and
emits the readings as micromegas metrics through the process’s own tracing
sink. This turns questions that today can only be answered by connecting
to the DB (e.g. which indexes are dead weight) into hard evidence
queryable via FlightSQL.
The collector emits raw cumulative counters exactly as Postgres reports
them and never resets any statistic (no pg_stat_reset* call anywhere in
this module) — deltas and rates are a query-time concern, and
pg_db_stats_reset_timestamp lets that analysis segment on counter-reset
boundaries.
Modeled on object-cache-srv::saturation_monitor: a pure sampling function
(collect_pg_stats) split from the scheduling plumbing (PgStatsTask), so
it can be driven directly by tests.
Structs§
- PgStats
Task - Cron task wiring: runs
collect_pg_statsagainst the lakehouse’s metadata DB pool once per tick.
Functions§
- collect_
pg_ stats - Samples all
pg_stat_*families and emits them as metrics. Never issues apg_stat_reset*call — onlySELECTs.