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

(Backport to r321) rules: Add new RuleEvaluationTimeSum field to groups (#15672) #807

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

julienduchesne
Copy link
Member

  • feat(ruler): Add new RuleEvaluationTimeSum field to groups
    Coupled with a metric: rule_group_last_rule_duration_sum_seconds

This will give us more observability into how fast a group runs with or without concurrency

* feat(ruler): Add new `RuleEvaluationTimeSum` field to groups
Coupled with a metric: `rule_group_last_rule_duration_sum_seconds`

This will give us more observability into how fast a group runs with or without concurrency

Signed-off-by: Julien Duchesne <[email protected]>

* Update rules/group.go

Co-authored-by: gotjosh <[email protected]>
Signed-off-by: Julien Duchesne <[email protected]>
Signed-off-by: Julien Duchesne <[email protected]>

* Apply suggestions from code review

Co-authored-by: gotjosh <[email protected]>
Signed-off-by: Julien Duchesne <[email protected]>
Signed-off-by: Julien Duchesne <[email protected]>

* Remove `in seconds`. A duration is a duration

Signed-off-by: Julien Duchesne <[email protected]>

---------

Signed-off-by: Julien Duchesne <[email protected]>
Signed-off-by: Julien Duchesne <[email protected]>
Co-authored-by: gotjosh <[email protected]>
@julienduchesne julienduchesne changed the title rules: Add new RuleEvaluationTimeSum field to groups (#15672) Backport (r321) rules: Add new RuleEvaluationTimeSum field to groups (#15672) Dec 17, 2024
@julienduchesne julienduchesne changed the title Backport (r321) rules: Add new RuleEvaluationTimeSum field to groups (#15672) (Backport to r321) rules: Add new RuleEvaluationTimeSum field to groups (#15672) Dec 17, 2024
@julienduchesne julienduchesne merged commit e97bb2a into weekly-r321 Dec 17, 2024
5 of 8 checks passed
@julienduchesne julienduchesne deleted the weekly-r321-15672 branch December 17, 2024 17:16
colega added a commit to grafana/mimir that referenced this pull request Dec 17, 2024
julienduchesne added a commit to grafana/mimir that referenced this pull request Dec 17, 2024
* Update mimir-prometheus weekly-r321

This includes:
- grafana/mimir-prometheus#807
- grafana/mimir-prometheus#806

Signed-off-by: Oleg Zaytsev <[email protected]>

* Rule Concurrency: Prevent flapping of concurrency (#10189)

* Rule Concurrency: Prevent flapping of concurrency

Iterates on #8146

The `isGroupAtRisk` function only uses the group's last evaluation time as a metric
However, if the concurrency of the group causes the group's eval time to lower to less than the threshold, this will flap between enabling concurrency and disabling it on every run

In this PR, a condition is added to also sum up the last evaluation time of each rule to compare against the threshold

* Linting

* Use the new `evaluationRuleTimeSum` field from the group

* Linting

* Add changelog + metric

* Apply suggestions from code review

Co-authored-by: gotjosh <[email protected]>

* Unrevert crypto

* Fix typo in changelog

---------

Co-authored-by: gotjosh <[email protected]>

---------

Signed-off-by: Oleg Zaytsev <[email protected]>
Co-authored-by: Julien Duchesne <[email protected]>
Co-authored-by: gotjosh <[email protected]>
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.

2 participants