I’m new to PMM and trying to monitor some Postgresql databases. I have installed PMM agents and ran “pmm-admin config …” on 2 Postgresql nodes. One of them was monitored successfully. One of them was not, only node metrics were collected. Prometheus targets were showing that it got time out error when scraping the postgresql exporter.
Any idea what happened here?
It looks like port 42001 is blocked on your second node. Pmm-server talks back to the postgresql exporter on this port.
Thanks for your reply.
I think that’s not the case, because I can telnet to that port.
When I tried to curl to the port, the curl just stopped here. The server didn’t send any reply even after some minutes had elapsed.
On the other server, the one which was successfully monitored, the curl was almost instantly replied.
Could you check if the provided curl command can fetch metrics if it’s run directly on the node?
After trying one more time, from the server, it got a reply after 4m39.916s. I guess that’s why Prometheus always timed out when trying to scrape the node. That’s very slow. Do you have any idea what can be the cause?
Could you check if there is any error in /var/log/pmm-agent.log on the node?
well, I don’t even see any log file of the pmm-agent.
there was no error in the journalctl logs (attached) though.
journalctl-pmm-agent.log (12.7 KB)
It’s hard to say what’s going on there without any additional information.
Are you able to fetch exporter metrics directly on the node by a curl command?
I can’t because I don’t know the APIs. I got that curl link from the prometheus dashboard.
Can you help me how to fetch the exporter’s metrics?
and while at it, is it possible to change the prometheus’s scrape interval & timeout configs without being replaced by pmm-managed?
Please use the next command. It has to be used Agent ID of postgres_exporter as a password.
curl -s -u pmm:<Agent ID of exporter> http://localhost:42000/metrics
Scraping intervals can be modified on the tab “PMM Settings”. Please notice that it’s global for all exporters.