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

Ruler: rule evaluation jitter #8848

Merged
merged 7 commits into from Mar 21, 2023

Conversation

dannykopping
Copy link
Contributor

What this PR does / why we need it:
This PR introduces a configurable random sleep before each rule evaluation to prevent contention on the query engine should multiple runs execute concurrently. It's quite likely that rules will be evaluated ~concurrently if they have the same interval.

Which issue(s) this PR fixes:
N/A

Special notes for your reviewer:
In #8744 I introduced the ruler.Evaluator interface, and this implementation is much simpler/elegant than what I had previously implemented in #8307.

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/upgrading/_index.md

Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Mar 21, 2023
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
@dannykopping dannykopping marked this pull request as ready for review March 21, 2023 09:46
@dannykopping dannykopping requested review from JStickler and a team as code owners March 21, 2023 09:46
Copy link
Contributor

@DylanGuedes DylanGuedes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a few nits/suggestions

CHANGELOG.md Outdated Show resolved Hide resolved
docs/sources/configuration/_index.md Outdated Show resolved Hide resolved
pkg/ruler/base/ruler.go Outdated Show resolved Hide resolved
docs/sources/configuration/_index.md Outdated Show resolved Hide resolved
pkg/ruler/evaluator_jitter.go Outdated Show resolved Hide resolved
Danny Kopping and others added 2 commits March 21, 2023 12:23
Co-authored-by: Dylan Guedes <djmgguedes@gmail.com>
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
@pull-request-size pull-request-size bot added size/L and removed size/M labels Mar 21, 2023
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
@pull-request-size pull-request-size bot added size/M and removed size/L labels Mar 21, 2023
Signed-off-by: Danny Kopping <danny.kopping@grafana.com>
@dannykopping dannykopping merged commit 5c3d204 into grafana:main Mar 21, 2023
2 checks passed
@dannykopping dannykopping deleted the dannykopping/new-rule-jitter branch March 21, 2023 11:06
dannykopping pushed a commit that referenced this pull request Mar 22, 2023
**What this PR does / why we need it**:
This PR introduces a configurable random sleep before each rule
evaluation to prevent contention on the query engine should multiple
runs execute concurrently. It's quite likely that rules will be
evaluated ~concurrently if they have the same interval.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/M type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants