-
Notifications
You must be signed in to change notification settings - Fork 803
Add multi-target support #1063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add multi-target support #1063
Conversation
b3486c1
to
8bafbac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to spend more time with the code to provide all of my feedback, but want to provide what I have ready while I gave it the first pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the guts of this are really solid. It did take me some time to give a proper review so once the changes are pushed up, I will need to allocate some time to re-review. Thanks for submitting this, I think it will be a good improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the new files are also missing the copyright assignment/license header. You should be able to copy paste (make sure there are no dates) from any other go file. I don't love the extra requests for the two collectors but I think that can be cleaned up after #1052 is merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DCO check is also failing on at least one commit
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
…'s empty and if so, don't parse it Signed-off-by: pincher95 <[email protected]> Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Update examples/auth_modules.yml Fix main.go to apply userpass credentials only if the module type is explicitly set to userpass. Signed-off-by: pincher95 <[email protected]>
Keep light-weight validation for the probe params during runtime Add AWS SigV4 authentication module support Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Add TLS config validation Update config test to include TLS config Signed-off-by: pincher95 <[email protected]>
…when no clusterinfo retriever is attached, avoiding the previous "unknown_cluster" label. Signed-off-by: pincher95 <[email protected]>
…sts to /probe. Updated auth_modules.yml to include AWS SigV4 signing and mTLS support. Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
…theus-community#1065) Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.22.0 to 1.23.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](prometheus/client_golang@v1.22.0...v1.23.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-version: 1.23.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: pincher95 <[email protected]>
Add tls auth type support in multi-target mode Update README.md, examples/auth_modules.yml, tests Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Signed-off-by: pincher95 <[email protected]>
955d9ee
to
bd1c0a8
Compare
Signed-off-by: Yuri Tsuprun <[email protected]>
Signed-off-by: pincher95 <[email protected]>
Update roundtripper.go to use region from config or environment resolver if not provided in config file (AWS_REGION) Update probe.go to accept module even if region omitted; environment resolver can provide it Update config.go to use region as optional field Update main.go to use region from config or environment resolver if not provided in config file (AWS_REGION) and update roundtripper.go to use region from config or environment resolver if not provided in config file (AWS_REGION) Signed-off-by: pincher95 <[email protected]>
PR: Add multi-target
/probe
endpoint + auth-modules (fixes #1062)This PR implements the feature described in issue #1062 (“multi-target scraping”).
───────────────────────────────
What’s new
───────────────────────────────
/probe
endpointAccepts
?target=
and (optionally)auth_module=
.For each request the exporter spins up a throw-away Prometheus registry, registers the usual collectors with the supplied ES URL, gathers, and streams metrics.
Auth-module support (
--config.file=
)Simple YAML schema modelled after
postgres_exporter
&mysqld_exporter
.Alias on
/metrics
Requests that already contain
target=
are internally forwarded to the probe handler, so users may keeppath: /metrics
in ServiceMonitors if they wish.Per-module API key support
type: apikey
injects theAuthorization: ApiKey …
header for that probe only.Docs & examples
examples/auth_modules.yml
showsuserpass
,apikey
.Unit tests
config
loader round-trip.validateProbeParams
.───────────────────────────────
Compatibility
───────────────────────────────
/metrics
withouttarget=
still returns the startup cluster.───────────────────────────────
Prometheus sample config
───────────────────────────────
───────────────────────────────
Commit outline
───────────────────────────────
Feedback / suggestions welcome!