:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
pgcollector — Postgres telemetry collector
rust/pgcollector scrapes telemetry from our RDS/Aurora clusters (pgstat*,
Aurora stat functions, pg_proctab, CloudWatch-exported logs) into a stats
Postgres. rust/pgapi
(pgapi.md) serves the data. Design, catalog and deployment details
live in the crate: DESIGN.md,
docs/deploy.md,
docs/telemetry-sources.md.
Contract
- Inputs: one
pg_monitor-tier user per monitored cluster, discovered fromPGCOLLECTOR_SERVER_<ID>_URL/_READER_URL/_LOG_GROUPenv vars (one golden-chartpsql:entry per cluster), plus a TOML config for the sink and defaults.pgbouncer: falseeverywhere: sessions set GUCs. - Output: partitioned
ts_*time series,cur_*current state,events,collector_runsin the stats database, daily partitions,retention_days. A collector adds columns to its table when its SELECT gains a column. Statement-bearing tables carry atagsjsonb column parsed from query comments (/* key=value */); seedocs/query-tags.mdfor the accepted shapes and the key vocabulary. - Load: every session runs with
statement_timeout = 5s/lock_timeout = 1s; per-collector cost is tabulated indocs/deploy.md"Load profile". Per-backend collectors ship off by default. - Security: TLS required for sink and targets unless the URL says
sslmode=disable/prefer; the collector's own statements are kept out of the server log; statement text taken from logs andpg_stat_activityis stored with string literals redacted;pg_stat_statementstext is already normalised by Postgres. - Ops:
/healthz,/readyz,/metricson:9187;--check,--once,--parse-logfor validation.