Fix the rules for postgres_exporter. Change to the prometheus version.

Robert Drake 2025-10-06 13:09:03 -04:00
parent 9687331902
commit 749cb57b05

@ -29,15 +29,12 @@ services:
# postgres
postgres-exporter:
image: wrouesnel/postgres_exporter:v0.8.0
image: quay.io/prometheuscommunity/postgres-exporter:latest
depends_on:
- postgres
env_file: env/postgres.env
env_file: env/pg_exporter.env
environment:
DATA_SOURCE_URI: postgres?sslmode=disable
DATA_SOURCE_USER: $${POSTGRES_USER}
DATA_SOURCE_PASS: $${POSTGRES_PASSWORD}
PG_EXPORTER_AUTO_DISCOVER_DATABASES: 'true'
# redis
redis-worker-exporter:
@ -120,8 +117,11 @@ scrape_configs:
- targets: ['grafana:3000']
```
Finally, create env/grafana.env. You will need to know the ADMIN PASSWORD to login to grafana, but it will be changed on first login.
Finally, create env/grafana.env and env/pg_exporter.env. You will need to know the GF_SECURITY_ADMIN_PASSWORD to login to grafana, but it will be changed on first login.
source env/postgres.env
echo "DATA_SOURCE_USER=$POSTGRES_USER" > env/pg_exporter.env
echo "DATA_SOURCE_PASS=$POSTGRES_PASSWORD" >> env/pg_exporter.env
echo "GF_SECURITY_SECRET_KEY=$(openssl rand -base64 32)" > env/grafana.env
echo "GF_SECURITY_ADMIN_PASSWORD=$(openssl rand -hex 5)" | tee -a env/grafana.env