-
Notifications
You must be signed in to change notification settings - Fork 691
feat: dynamically named usage groups #4210
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
Conversation
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.
Not 100% sure myself yet if I like it. It obviously is pretty aligned with label selectors.
I also could think something more like ${label.service_name}
could be quite nice, but then that's something completely different to the label selector.
Edit: Forgot to say: Plus 100 to the feature itself, the current feature is not really usable, esp. as long as its not self service.
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.
Not 100% sure myself yet if I like it. It obviously is pretty aligned with label selectors.
I also could think something more like ${label.service_name} could be quite nice, but then that's something completely different to the label selector.
Named placeholders are arguably safer than positional ones. I also think it can fit the usage group model as well, the label selector would be used purely for filtering / segmentation (like today), while the name can be independently controlled, e.g.:
"${label.service_name}": "{}"
I will try this and see how it looks / feels.
568f510
to
1f75d4a
Compare
Switched to named placeholders now. One added benefit is that we can now pre-parse the placeholders (once when the config is read) and can apply it more efficiently. The added overhead decreased quite a bit compared to using regex capture groups. |
Just in case: have we considered adding another internal/private label, like This would:
As I understand it, relabeling rules should be able to do everything that both the proposed and current implementations can do. In 99.(9)% of cases, it's just a simple mapping from |
@kolesnikovae that is an interesting idea. It can work for simpler cases (like the |
b7978df
to
58bafa3
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.
While I agree with Anton's sentiment that this is very close to relabelling rules, I do think we decided to go down this slightly separate route and this an enhancement, which is essential to make the feature usable without developing further automation (like a cron listing service_name and creating usage groups on the back of that).
LGTM
71405d3
to
389423f
Compare
Adds a special meaning to usage groups with placeholders (
${labels.label_name}
) in their names. When encountered AND there is a match with the provided selector, we replace placeholders with the actual label values.This allows for a simpler and more powerful configuration of usage groups where this:
can be replaced with:
Benchmark results:
Notes: