How to Monitor PostgreSQL with Prometheus & Grafana ?

  Рет қаралды 16,133

Avinashkumar - The Learning Destination

Avinashkumar - The Learning Destination

Күн бұрын

This tutorial helps you to monitor "POSTGRES" DB with "Prometheus & Grafana".
Follow the below steps:
sudo cp postgres_exporter /usr/local/bin
cd /opt/postgres_exporter
sudo nano postgres_exporter.env
DATA_SOURCE_NAME="postgresql://postgres:postgres@192.168.56.106:5432/?sslmode=disable"
sudo useradd -rs /bin/false postgres
vi /etc/systemd/system/postgres_exporter.service
[Unit]
Description=Prometheus exporter for Postgresql
Wants=network-online.target
After=network-online.target
[Service]
User=postgres
Group=postgres
WorkingDirectory=/opt/postgres_exporter
EnvironmentFile=/opt/postgres_exporter/postgres_exporter.env
ExecStart=/usr/local/bin/postgres_exporter --web.listen-address=192.168.56.106:9100 --web.telemetry-path=/metrics
Restart=always
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start postgres_exporter
sudo systemctl enable postgres_exporter
sudo systemctl status postgres_exporter
Steps to perform on Prometheus Server
systemctl stop prometheus
vi /etc/prometheus/prometheus.yml
systemctl start prometheus
systemctl status prometheus

Пікірлер: 30
@GabrielaLopezUrquiaga
@GabrielaLopezUrquiaga Жыл бұрын
Great video. The ports/services debugging fragment is very useful. Thanks!
@avinashkumar-thelearningdest
@avinashkumar-thelearningdest Жыл бұрын
Thank you so much for your valuable words. That encouraging me a lot to keep produce good contents. Please help me to share my channel within your friends. Thanks 😊
@jalandharbehera2456
@jalandharbehera2456 Жыл бұрын
Very much informative video.....easy to understand ❤❤
@avinashkumar-thelearningdest
@avinashkumar-thelearningdest Жыл бұрын
Thank you so much, brother 😊
@MrPrajyod
@MrPrajyod 2 жыл бұрын
how did you create prometheus data source in the Import? you have skipped this step. Can you show how to create Prometheus data source. While creating Prometheus Data Source I am getting error
@RaviShankar-xf4qx
@RaviShankar-xf4qx Жыл бұрын
Thanks a lot - it's helped me to configure postgres exporter - only problem i am facing was not getting data in grafana dashboard - just getting N/A - not sure what causing the problem.
@kevsermutaf3269
@kevsermutaf3269 Жыл бұрын
Thank you :)
@avinashkumar-thelearningdest
@avinashkumar-thelearningdest 10 ай бұрын
You're welcome!
@ahmedsecad1164
@ahmedsecad1164 Жыл бұрын
Hey Avinash. Nice job. Wondering have you tried multiple PG DBs using multi-target exporter?
@janupriyo2096
@janupriyo2096 Жыл бұрын
how i use docker for postgre_exporter?
@rafa2343
@rafa2343 10 ай бұрын
Hello, I performed all step, but postgres_exported doesn't colleg statistics from database. At the end of vide when you show grafana we can only basic stat like CPU. There isn't any data connected to postgres stats lige pgwriter, shared_buffer etc. Can you please advice how configure it to enable to collect stats from postgres?
@user-sh2cv2qw5m
@user-sh2cv2qw5m 2 ай бұрын
I have found solution. grant pg_monitor to postgres; The best if you user other db user instead of postgres.
@subhashudata3416
@subhashudata3416 2 жыл бұрын
Hi Avinash, In the end, in the dashboard, every metric is shown as "N/A". were you be able to resolve that issue?
@avinashkumar-thelearningdest
@avinashkumar-thelearningdest 2 жыл бұрын
Hi Subhash, Thanks for your valuable comments. Actually the data is not getting fetched in Grafana probably you need to create Grafana user in postgresql DB & give appropriate permissions to it so it can fetch the data. That I have already mentioned at 15: 04. Let me know if you need any other help.
@jtf643
@jtf643 Жыл бұрын
@@avinashkumar-thelearningdest same problem here... can you help with the steps?
@akshadbhandula8641
@akshadbhandula8641 Жыл бұрын
@@avinashkumar-thelearningdest Hi Avinash, please help with the data showing N/A.
@jithur2290
@jithur2290 3 ай бұрын
Can you please help with the steps
@philbongborces
@philbongborces Жыл бұрын
got 404 error @Avinashkumar . what is the download path?
@user-dl6cc4wi8j
@user-dl6cc4wi8j 2 жыл бұрын
its works ! but every metric show N/A. you can help me about create Grafana user in postgresql DB & give appropriate permissions to it so it can fetch the data ?
@jtf643
@jtf643 Жыл бұрын
same problem here :/ have solved the problem yet? how did you do it?
@bindhusingaraj9154
@bindhusingaraj9154 2 жыл бұрын
It was very useful sir.I have a doubt, Why Prometheus is taking more RAM
@avinashkumar-thelearningdest
@avinashkumar-thelearningdest 2 жыл бұрын
Thanks for you valuable comments Bindhu. I haven't yet noticed it. Let me check and if I find something, I will share with you 🙂
@rajdeokumar7099
@rajdeokumar7099 10 ай бұрын
Hi Avinash, I did the same configuration but we are not able achieve the success.
@avinashkumar-thelearningdest
@avinashkumar-thelearningdest 9 ай бұрын
Hi Brother, Thanks for the query. Could you please share the error ?
@singhpandi6849
@singhpandi6849 2 жыл бұрын
Hi, in grafana how to find slow running queries?
@avinashkumar-thelearningdest
@avinashkumar-thelearningdest 2 жыл бұрын
Hi, let me check ✔️ and will get back. If you do not hear in 2-3 days then please remind me. 🙏
@zizinabilamajesty3738
@zizinabilamajesty3738 2 жыл бұрын
@@avinashkumar-thelearningdest how sir?
@avinashkumar-thelearningdest
@avinashkumar-thelearningdest 2 жыл бұрын
@@zizinabilamajesty3738 Sorry I haven't yet made video onnit as quote busy in my office work. Soon I will release. Sorry for delay.
Learn MongoDB Health Checks/Monitoring with Prometheus & Grafana #prometheus #grafana #mongodb
12:15
Avinashkumar - The Learning Destination
Рет қаралды 9 М.
Learn complete Linux system Health Checks in One Minute #monitoring #shorts #linuxmonitoring
0:47
Avinashkumar - The Learning Destination
Рет қаралды 901
Эффект Карбонаро и нестандартная коробка
01:00
История одного вокалиста
Рет қаралды 9 МЛН
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 171 МЛН
Playing hide and seek with my dog 🐶
00:25
Zach King
Рет қаралды 30 МЛН
DAD LEFT HIS OLD SOCKS ON THE COUCH…😱😂
00:24
JULI_PROETO
Рет қаралды 14 МЛН
Server Monitoring with Grafana Prometheus and Loki
51:44
Piyush Garg
Рет қаралды 43 М.
Server Monitoring // Prometheus and Grafana Tutorial
24:36
Christian Lempa
Рет қаралды 620 М.
How Prometheus Monitoring works | Prometheus Architecture explained
21:31
TechWorld with Nana
Рет қаралды 1 МЛН
Professional PostgreSQL Monitoring Made Easy - Pavlo Golub
41:05
CYBERTEC - PostgreSQL Services & Support
Рет қаралды 1,9 М.
Docker Dashboard Using Grafana, Prometheus & Node Exporter
14:59
Эффект Карбонаро и нестандартная коробка
01:00
История одного вокалиста
Рет қаралды 9 МЛН