-
Notifications
You must be signed in to change notification settings - Fork 512
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
Update vendored prometheus #8295
Changes from all commits
ad7dc1a
0da89da
8dd3498
da84a8d
9f715be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,3 +211,8 @@ The following features or configuration parameters are currently deprecated and | |
- `-ingester.client.report-grpc-codes-in-instrumentation-label-enabled` | ||
- Mimirtool | ||
- the flag `--rule-files` | ||
|
||
The following features or configuration parameters are currently deprecated and will be **removed in a future release (to be announced)**: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to reviewers: I want to keep |
||
|
||
- Rule group configuration file | ||
- `evaluation_delay` field: use `query_offset` instead |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -960,7 +960,6 @@ func TestAPI_CreateRuleGroup(t *testing.T) { | |
name string | ||
cfg Config | ||
input string | ||
output string | ||
err error | ||
status int | ||
}{ | ||
|
@@ -1034,7 +1033,61 @@ rules: | |
labels: | ||
test: test | ||
`, | ||
output: "name: test\ninterval: 15s\nsource_tenants: [t1, t2]\nrules:\n - record: up_rule\n expr: up{}\n - alert: up_alert\n expr: sum(up{}) > 1\n for: 30s\n labels:\n test: test\n annotations:\n test: test\n", | ||
}, | ||
{ | ||
name: "with valid rules and evaluation delay", | ||
cfg: defaultCfg, | ||
input: ` | ||
name: test | ||
interval: 15s | ||
evaluation_delay: 5m | ||
rules: | ||
- record: up_rule | ||
expr: up{} | ||
`, | ||
status: 202, | ||
}, | ||
{ | ||
name: "with valid rules and query offset", | ||
cfg: defaultCfg, | ||
input: ` | ||
name: test | ||
interval: 15s | ||
query_offset: 2m | ||
rules: | ||
- record: up_rule | ||
expr: up{} | ||
`, | ||
status: 202, | ||
}, | ||
{ | ||
name: "with valid rules and both evaluation delay and query offset set to the same value", | ||
cfg: defaultCfg, | ||
input: ` | ||
name: test | ||
interval: 15s | ||
evaluation_delay: 5m | ||
query_offset: 5m | ||
rules: | ||
- record: up_rule | ||
expr: up{} | ||
`, | ||
status: 202, | ||
}, | ||
{ | ||
name: "with valid rules but evaluation delay and query offset set to different values", | ||
cfg: defaultCfg, | ||
input: ` | ||
name: test | ||
interval: 15s | ||
evaluation_delay: 2m | ||
query_offset: 5m | ||
rules: | ||
- record: up_rule | ||
expr: up{} | ||
`, | ||
status: 400, | ||
err: errors.New("invalid rules configuration: rule group 'test' has both query_offset and (deprecated) evaluation_delay set, but to different values; please remove the deprecated evaluation_delay and use query_offset instead"), | ||
}, | ||
} | ||
|
||
|
@@ -1071,7 +1124,7 @@ rules: | |
|
||
router.ServeHTTP(w, req) | ||
require.Equal(t, 200, w.Code) | ||
require.YAMLEq(t, tt.output, w.Body.String()) | ||
require.YAMLEq(t, tt.input, w.Body.String()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to reviewers: we can simplify the test. We expect to receive the same YAML we uploaded. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree, although isn't that because we don't test 0 value here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct. If we would test the 0 value the output would be different |
||
|
||
// Ensure it triggered a rules sync notification. | ||
verifySyncRulesMetric(t, reg, 1, 1) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -330,7 +330,7 @@ func DefaultTenantManagerFactory( | |
ForGracePeriod: cfg.ForGracePeriod, | ||
ResendDelay: cfg.ResendDelay, | ||
AlwaysRestoreAlertState: true, | ||
DefaultEvaluationDelay: func() time.Duration { | ||
DefaultRuleQueryOffset: func() time.Duration { | ||
// Delay the evaluation of all rules by a set interval to give a buffer | ||
// to metric that haven't been forwarded to Mimir yet. | ||
return overrides.EvaluationDelay(userID) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit [non-blocking]: At some point, we probably want to create a new limit so that it matches the description a bit more accurately. Happy to create an issue for it if you think it's worth it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree we should but looks very low priority. I'm fine creating an issue for now. |
||
|
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.
Note to reviewers: this is related to prometheus/prometheus#14079.