Extension won’t load
postgresql.conf and restart:
Background worker not running
Check if the exporter process is visible:- Verify
shared_preload_librariesincludespg_stat_ch - Check PostgreSQL logs for startup errors
- The worker restarts automatically after 10 seconds if it crashes — check logs for repeated crash/restart cycles
Events not appearing in ClickHouse
Check queue stats
enqueued_events = 0: No queries are being captured. Run some queries and check again.enqueued_events > 0butexported_events = 0: The background worker cannot reach ClickHouse.send_failures > 0: Checklast_error_textfor the specific error.
High queue usage
Ifqueue_usage_pct from pg_stat_ch_stats() is consistently above 80%:
-
Decrease flush interval — export more frequently:
-
Increase batch size — drain more events per cycle:
-
Check ClickHouse health — slow inserts cause backpressure:
-
Increase queue capacity (requires restart):
Dropped events
dropped_events means the queue filled up before the background worker could drain it. This is safe — queries continue running unaffected — but some telemetry is lost.
Common causes:
- ClickHouse is down or unreachable (events queue up with nowhere to go)
- A burst of queries exceeded the queue capacity
- The flush interval is too long for the workload
DSA String Area Full
Check thedsa_oom_count counter:
pg_stat_ch.string_area_size
and restart PostgreSQL.
Missing I/O timing data
Ifshared_blk_read_time_us and related columns are always zero:
postgresql.conf:
gettimeofday() call per block I/O operation) but provides valuable data for distinguishing CPU-bound from I/O-bound queries.
Missing query_id values
Ifquery_id is always 0:
query_id = 0 and cannot be aggregated.
TLS connection errors
If you see TLS-related errors in PostgreSQL logs:- Verify
pg_stat_ch.clickhouse_use_tls = onis set - For self-signed certificates in testing, set
pg_stat_ch.clickhouse_skip_tls_verify = on - In production, ensure the ClickHouse server certificate is trusted by the system CA store

