perf: Reduce pgwatch log verbosity to error level
Closes #102 (closed)
Summary
- pgwatch was logging every metric fetch at INFO level, generating ~80% of all logs in
postgres-ai-mon-productionnamespace - With 4 database sources × ~25 metrics × 30-second intervals = ~12,000 log lines per hour of noise
Changes
- Add
--log-level=warnto both pgwatch services indocker-compose.yml - Add configurable
logLevel(default:warn) to Helmvalues.yaml - Update pgwatch-postgres and pgwatch-prometheus deployments to use the config
Evidence
$ gcloud logging read ... | sort | uniq -c | sort -nr
8138 pgwatch <-- 81% of logs
1509 grafana
306 postgres-exporter
47 victoriametrics
Sample logs (pure noise):
[INFO] [source:prod_replica_postgres_ai] [metric:replication] [rows:0] measurements fetched
[INFO] [source:prod_replica_postgres_ai] [metric:pg_stat_replication] [rows:0] measurements fetched
...repeated every 30 seconds for every metric...
Test Plan
- Deploy to staging and verify pgwatch only logs warnings/errors
- Verify metrics collection still works (check Grafana dashboards)
- Monitor log volume reduction in GCP Logging
Edited by Dementii Priadko