Configuration
Configuration guides for customizing PostgresAI monitoring components.
Components​
| Component | Purpose | Configuration scope |
|---|---|---|
| pgwatch | Metrics collection | Collection intervals, custom metrics |
| VictoriaMetrics | Time-series storage | Retention, storage, scrape settings |
| Grafana | Visualization | Dashboards, data sources, authentication |
| Alerting | Notifications | Alert rules, notification channels |
Configuration methods​
CLI installation​
Configuration is stored in the monitoring directory .env file and can be applied with update-config:
# Example .env overrides (default VM_RETENTION_PERIOD is 336h ≡ 14 days)
VM_RETENTION_PERIOD=30d
VM_QUERY_DURATION=30s
VM_MAX_CONCURRENT_REQUESTS=16
postgresai mon update-config
Docker Compose​
Configuration is passed through docker-compose.yml and the generated .env file:
# Example overrides (default VM_RETENTION_PERIOD is 336h ≡ 14 days)
VM_RETENTION_PERIOD=30d
VM_QUERY_DURATION=30s
VM_MAX_CONCURRENT_REQUESTS=16
Helm​
Configuration via values.yaml:
monitoring:
retention: 30d
scrapeInterval: 15s
Quick reference​
| Setting | Default | Description |
|---|---|---|
| Scrape interval | 15s | How often to collect metrics |
| Retention | 14 days (336h) | How long to keep metrics |
| Max connections | 3 | Connections per monitored database |
Sections​
- pgwatch configuration — Metrics collector settings
- Prometheus/VictoriaMetrics — Time-series storage
- Grafana configuration — Dashboard customization
- Alerting — Alert rules and notifications