PMM is working great. Now I need to add Postgres RDS. I’ve got the postgres_exporter on the client that is serving RDS MySQL. Will I have to hack prometheus to get this to work?
as I know have long-term plan to make PMM pluggable, so in future, we want to have the possibility to add PostgreSQL (or any other popular DB) plugin in one or two simple actions.
Currently, it is quite complex to add PostgreSQL monitoring, but I think it is possible.
If you want I can research and prepare instruction how to add Postgres RDS into PMM.
It will be “hacker” way (not simple) and totally not supported officially.
please say if you need it, it can take some time.
I think I’m not the only one that would need this. And I don’t mind hacking. I have added postgres to my prometheus.yml file (in docker). and at the moment I do have my PMM prometheus gathering stats. I just can’t figure out how to get my pmm grafana to use those metrics.
I think you can try to use this dashboard - https://grafana.com/dashboards/455
I guess I should have given you more info. I do have that dashboard… Let me gather all the info on what I’ve done so far.
- I copied a mysql job_name in the prometheus.yml and added a postgres (this may be the problem?)
- job_name: postgres
- server: ‘localhost:8500’
- target_label: ‘job’
- source_labels: [’_meta_consul_tags’]
- source_labels: [’__meta_consul_tags’]
- docker exec -it pmm-server bash
vi /etc/prometheus.yml <-- added that
- kill -HUP (the first time I had a typo & prometheus failed to run, fixed it & now it’s running)
- added the grants/create functions/create schema postgres_exporter (as per postgres_exporter recommended)
- tried to add the pmm-admin add postres:metrics but pmm refused!
- went to this page: http://<PMM_SERVER>:/metrics
THERE are metrics & a reload sees the
pg_exporter_scrapes_total 2 --> 3 7) here’s where I’m having problems - setting the $HOST The postgres instance is an RDS one. I can not seem to get the postgres Overview grafana see the host. Prometheus has the metrics… I’ve tried: : <-- no go :/ Thoughts?
as I understand postgres_exporter REST API working fine and you can see metrics on http://<PMM_SERVER>:/metrics URL.
the next step is to add it to prometheus.
- can you rollback changes and try to add the following lines to Prometheus config?
- job_name: postgres static_configs: - targets: ['PG-EXPORTER-IP:PG-EXPORTER-PORT'] labels: instance: PG-EXPORTER-IP
- restart prometheus
docker exec pmm-server supervisorctl restart prometheus
YAY! that worked. Of course I got all my white space messes up the first time I changed the yml file but /var/log/prometheus hinted at the line number. but it’s working! Now to learn a but more Postgres. Thanks for you help. Hopefully this thread will help others.