Get the App
SLTechnology News&Howtos  ›  Servers  › 

Prometheus Monitoring of PG

Shulou Source: shulou.com Published: 2022-06-03 00:53:18 09月22日 Update

Go to github and download the compiled exporter file

Address: https://github.com/wrouesnel/postgres_exporter/releases

Tar xf postgres_exporter_v0.4.1_linux-amd64.tar.gz-C / opt/

Cd / opt/postgres_exporter_v0.4.1_linux-amd64

The vim start.sh startup script contains the following

Replace the password under #! / bin/bashcd / opt/postgres_exporter_v0.4.1_linux-amd64export PATH=/usr/local/pgsql/bin:$PATH# with your own postgres user password export DATA_SOURCE_NAME= "user=postgres host=localhost password=123456 port=5432 dbname=postgres sslmode=disable" nohup. / postgres_exporter-- web.listen-address= ": 9187" > / dev/null 2 > & 1 &

Then, add the corresponding target to the Prometheus

Once the data is collected, you can draw a picture in grafana, like this:

Usually, we will also deploy a node_exporter to collect monitoring information at the host level at the same time. Something like this:

Because blog is not convenient to upload files, I will not post grafana template files here.

Tags: File monitor host information content at the same time address password data template user level script facet compile Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Microsoft vpn NVidia OPPO Reno