-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
WIP: add labeling support for exported scrape jobs #370
Conversation
The previous work to collect scrape jobs (voxpupuli#304) was a good start, but it really becomes powerful when you can select certain labels to apply on the exporters. For example, I use this to export the node roles' in the prometheus metrics, which allows me to regroup results by role instead of by node.
@@ -103,6 +103,7 @@ | |||
Boolean $export_scrape_job = false, | |||
Stdlib::Port $scrape_port = 9117, | |||
String[1] $scrape_job_name = 'apache', | |||
Optional[Hash] $scrape_job_labels = {}, |
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.
any chance to enforce the type in the hash? Also it doesn't need to be optional, if the default is an empty hash.
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 guess it's something like label = { foo: bar, ...}
, so how is that expressed in a type?
Dear @anarcat, thanks for the PR! This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase? You can find my sourcecode at voxpupuli/vox-pupuli-tasks |
1 similar comment
Dear @anarcat, thanks for the PR! This is pccibot, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase? You can find my sourcecode at voxpupuli/vox-pupuli-tasks |
@anarcat Hi! Only just spotted this PR. Sorry!! I implemented something very almost identical in #388 Many thanks for #304 and apologies for not checking through existing PRs before starting my own. |
@alexjfisher i reviewed your changes and i must say: no apologies necessary! :) your patchset looks better than mine and the interface is otherwise identical, which is great. so no harm done, and thanks for your work! |
Pull Request (PR) description
The previous work to collect scrape jobs (#304) was a good start, but
it really becomes powerful when you can select certain labels to apply
on the exporters.
For example, I use this to export the node roles' in the prometheus
metrics, which allows me to regroup results by role instead of by node:
This is WIP because it probably needs docs strings and tests, although I'm not sure about the latter.