-
Notifications
You must be signed in to change notification settings - Fork 9.7k
discovery: add label_selector
to hetzner service discovery
#16512
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
discovery: add label_selector
to hetzner service discovery
#16512
Conversation
2e28fdb
to
873cf52
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.
Thanks for this.
I assume you cannot use __meta_hetzner_hcloud_label_xxx
labels with relabeling to get rid of the unwanted targets.
Even if you just "don't" want to do that, it's still a legit feature as we already allow to do that for other SD.
I assume you did test this manually and I think the tests on hetznercloud/hcloud-go
side are enough.
By the way, since you work at Hetzner, we’re looking for a point of contact to help review and validate API related changes. Would you or someone on your team be interested in helping us with that? (looking at the history https://github.com/prometheus/prometheus/commits/main/discovery/hetzner, it should be light workload)
873cf52
to
481d12a
Compare
Allows to filter the servers when sending the listing request to the API. This feature is only available when using the `role=hcloud`. See https://docs.hetzner.cloud/#label-selector for details on how to use the label selector. Signed-off-by: Jonas Lammler <jonas.lammler@hetzner-cloud.de>
481d12a
to
08982b1
Compare
This is actually another valid option, but depending on the amount of server in a user's project, this should still reduce the load on both prometheus and our API by processing less data from the start.
Sure, you may contact me @jooola or @apricote for anything related to the hetzner service discovery.
Indeed, I did test this manually. I rebased the changes on top of the main branch. |
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.
great, thanks!
lgtm
Awesome! Thanks for the reactivity! |
Allows to filter the servers when sending the listing request to the API. This feature is only available when using the
role=hcloud
.See https://docs.hetzner.cloud/#label-selector for details on how to use the label selector.