Skip to main content

collect_pg_stats

Function collect_pg_stats 

Source
pub async fn collect_pg_stats(pool: &PgPool) -> Result<()>
Expand description

Samples all pg_stat_* families and emits them as metrics. Never issues a pg_stat_reset* call — only SELECTs.

If a single catalog query fails, it’s logged and the others still run (a transient catalog hiccup shouldn’t drop the whole tick); the first error encountered is returned at the end via anyhow context.