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

Revisions
RevisionDescriptionCreated
PostgreSQL

PostgreSQL

by Grafana Labs
Grafana Labs solution

Easily monitor your deployment of PostgreSQL, the open source relational database, with Grafana Cloud's out-of-the-box monitoring solution.

Learn more

Get this dashboard

Import the dashboard template

or

Download JSON

Datasource
Dependencies