Skip to content
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

feat: add extra-filter-labels param #522

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Goorsky1
Copy link

@Goorsky1 Goorsky1 commented Aug 3, 2023

Motivation and use cases

This param is mostly useful when using Sloth with a metric storage for multiple k8s clusters (like VictoriaMetrics).

Even if you would define a unique name for each SLO and provide a proper filter in each query, some of the generated rules would end up without the required filter and you would result in an error when executing the generated rules: result contains metrics with the same labelset after applying rule labels

Assuming you define --extra-filter-labels cluster=my-cluster-name for Sloth operator,
It allows for using the same SLO names on each cluster as {{ .cluster }} can be referenced in the user's query and also will be used as filter in the created recording rules, which users can't modify, fixing previously described problem. The cluster label will be also added to the resulting metrics in similar fasion to --extra-labels, so it ensures that the resulting metrics can be differentiated.

This fixes issues like #430 or can be helpful for #349

@Goorsky1 Goorsky1 requested a review from slok as a code owner August 3, 2023 09:48
@zmailloux
Copy link

Wish this would just be pulled in.

@nirmalkumar85
Copy link

+1 bump. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants