Implement multitarget pattern support#198
Open
maikelpoot wants to merge 1 commit intoprometheus-community:masterfrom
Open
Implement multitarget pattern support#198maikelpoot wants to merge 1 commit intoprometheus-community:masterfrom
maikelpoot wants to merge 1 commit intoprometheus-community:masterfrom
Conversation
Signed-off-by: Maikel Poot <maikel.poot@topicus.nl>
SuperQ
requested changes
Mar 3, 2025
Contributor
SuperQ
left a comment
There was a problem hiding this comment.
The metric_path and probe_path need to be removed from the configuration file.
Since these are not reloadable configurations, we want them to be command line arguments only.
|
|
||
| ## Turn on legacy mode, where the exporter scrapes a configured endpoint and exposes the metrics on the metrics_path | ||
| ## Defaults to false when using config file | ||
| legacy_mode: false |
Contributor
There was a problem hiding this comment.
There should be no "legacy mode". Both normal scrape and probe endpoints should be supported simultaneously.
Author
There was a problem hiding this comment.
If i read (and interpret) the multi-target docs correctly, a multi-target exporter should only export it's own metrics over /metrics and /probe should be used for target metrics.
How do you see using both mode's simultaneously? Should /metrics contain the metrics for the configured target or should /probe without parameters return these?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
note: this is a follow-up to #182
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 the multitarget pattern defined by prometheus.
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 when used in legacy mode (single-target).
Example
The probe endpoints accepts 2 parameters:
dsn: the postgresql connection stringcred: credential reference to credentials stored in the config file.When
credis used the dsn will be updated with the credential values from the config file.If the DSN and credentials config define the same parameter the latter takes precedence.
With the example below the exporter will scrape
"postgres://username:password@localhost:6543/pgbouncer?sslmode=disable".prometheus.yaml:config.yaml