postgresql
https://github.com/wrouesnel/postgres_exporter
授权
https://github.com/wrouesnel/postgres_exporter#running-as-non-superuser
部署
date -R
mv /etc/timezone /etc/timezone-`date +%Y%m%d-%H%M%S`
echo 'Asia/Shanghai' > /etc/timezone
mv /etc/localtime /etc/localtime-`date +%Y%m%d-%H%M%S`
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
docker pull wrouesnel/postgres_exporter
docker rm -f postgres-exporter
docker run -d \
--name postgres-exporter \
-v /etc/timezone:/etc/timezone \
-v /etc/localtime:/etc/localtime \
-p 9187:9187 \
-e DATA_SOURCE_NAME="postgresql://postgres:passw0rd@172.17.10.94:5432/postgres?sslmode=disable" \
--restart=unless-stopped \
wrouesnel/postgres_exporter
docker logs -f --tail 10 postgres-exporter
dashboard from
https://github.com/percona/grafana-dashboards/blob/master/dashboards/PostgreSQL_Overview.json
Data source config
Collector config:
Upload an updated version of an exported dashboard.json file from Grafana
Revision | Description | Created | |
---|---|---|---|
Download |
PostgreSQL
Easily monitor your deployment of PostgreSQL, the open source relational database, with Grafana Cloud's out-of-the-box monitoring solution.
Learn more