pg_stat_ch_version()
Returns the extension version string.
pg_stat_ch_stats()
Returns queue and exporter statistics as a single row.
Output columns
Monitoring examples
Check if events are flowing:pg_stat_ch_reset()
Resets all queue counters to zero.
enqueued_events, dropped_events, exported_events, and send_failures back to zero. It does not affect the queue contents or ClickHouse data. Useful for establishing a clean baseline before a load test or after resolving an issue.
pg_stat_ch_flush()
Triggers an immediate flush of queued events to ClickHouse.
SIGUSR2 to the background worker, which wakes it up and starts a drain cycle immediately instead of waiting for the next flush_interval_ms tick. The function returns immediately without waiting for the flush to complete.
Use this after running test queries when you want events to appear in ClickHouse right away, or as part of a deployment script that needs to verify data is flowing.
