Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Prometheus Monitoring of PG

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report