prometheus-community / prometheus-community/postgres_exporter
postgres_exporter for some postgres containers on the same server - metrics
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 3.6k
- Forks
- 835
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 10
Description
Hi,
I have more than one postgres container running on my server. They are distinguished from one another by their port.
I can run one postgres-exporter to monitor them using the command below (for example), where I specify them both for the DATA_SOURCE-NAME:
docker run --name postgres_exporter --net=host -e DATA_SOURCE_NAME=postgresql://octopusrepmgr:'mypassword'@10.97.7.97:5020/octopusdb?sslmode=disable,
postgresql://octopusrepmgr:'oct-DBA+2020'@10.97.7.97:5009/octopusdb?sslmode=disable
wrouesnel/postgres_exporter
The postgres_exporter container comes up fine like this, and I can see in Prometheus UI it is UP, and I can see its metrics.
However, some metrics, for example all those who monitor process* are not distinguished by the server/port.
For example:
process_resident_memory_bytes :
process_resident_memory_bytes{instance="10.97.7.97:9187",job="postgres_exporter"} | 13225984
or:
process_start_time_seconds{instance="10.97.7.97:9187",job="postgres_exporter"} | 1604311685.43
That means that in Grafana, I cannot show the correct values for each for those metrics.
What is the solution here?
Should I run two postgres_exporters containers on the same server?
If so - how can I do that?
Thanks,
Tamar
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the DATA_SOURCE_NAME configuration and the postgres_exporter container setup described in the issue. Compare the metric labels produced for multiple PostgreSQL targets with separate exporter containers, then verify the resulting process_* values in the Prometheus UI and Grafana; done means each target can be distinguished reliably.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go, grafana, postgresql, prometheus
- Domain
- databases, devops, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100