Feature: add option to export multiple pgbouncer instances #182
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this PR
We TCP load balance our connections over multiple (4+) pgbouncer instances/processes to increase stability and performance. We would like to switch from our own exporter to the prometheus-community exporter but would like to run only one exporter instance instead of an exporter per pgbouncer instance.
What does the PR do
This PR will add the option to export multiple pgbouncer instances with one exporter instance using a yaml config file.
All the options are documented within the example config.yaml within this repo.
This config file also add the option to start the exporter even if the connection fails on startup.
Extra labels
To differentiate the metrics for each pgbouncer instances, you MUST configure a unique label/value set for each instance.
As shown in the example, this can be as simple as setting a unique
pgbouncer_instance
value for each instance.The extra labels per instance are merged with the common extra_labels where the instance value has precedence over the common value
Requirements:
If there requirements are not met the exporter will fail startup.
Example
When using the config file:
you now get 3
pgbouncer_up
metrics: