-
Notifications
You must be signed in to change notification settings - Fork 816
Add support for rule group labels #6665
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
49e9849
to
c469509
Compare
@@ -30,6 +30,10 @@ message RuleGroupDesc { | |||
int64 limit =10; | |||
google.protobuf.Duration queryOffset = 11 | |||
[(gogoproto.nullable) = true, (gogoproto.stdduration) = true]; |
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.
Unrelated, but interesting that queryOffset is using nullable = true while all the rest is not. I was reading through the implications https://pkg.go.dev/github.com/gogo/protobuf/gogoproto#hdr-More_Canonical_Go_Structures
integration/ruler_test.go
Outdated
// Wait until ruler has loaded the group. | ||
require.NoError(t, ruler.WaitSumMetricsWithOptions(e2e.Equals(1), []string{"cortex_prometheus_rule_group_rules"}, e2e.WithLabelMatchers(m), e2e.WaitMissingMetrics)) | ||
|
||
groups, _, err := c.GetPrometheusRules(e2ecortex.RuleFilter{ |
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.
we could also get the rule group using the client GerRuleGroup
method to assert that the duplicate_label
is really in the rule group level.
LGTM. Thanks! |
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.
Line 1253 in 8668b1c
Group: &rulespb.RuleGroupDesc{ |
I wonder if we miss this one. When API backup is enabled.
integration/ruler_test.go
Outdated
@@ -1739,6 +1739,106 @@ func TestRulerEvalWithQueryFrontend(t *testing.T) { | |||
} | |||
} |
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.
Can we try to cover group labels in the API backup test case? Just to make sure it works for that scenario
TestRulerAPIShardingWithAPIRulesBackupEnabled
Signed-off-by: Mustafain Ali Khan <mustalik@amazon.com>
c469509
to
2dc3a5a
Compare
Signed-off-by: Mustafain Ali Khan <mustalik@amazon.com>
2dc3a5a
to
f56d3b8
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!
What this PR does:
Adds support for labels at rule group level.
Which issue(s) this PR fixes:
This feature was added in a recent Prometheus release, cortex should support this.
related PR: prometheus/prometheus#11474
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]