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

Alerting: new min_interval_seconds option to enforce a minimum evaluation frequency #21188

Merged
merged 11 commits into from
Jan 14, 2020

Conversation

papagian
Copy link
Contributor

What this PR does / why we need it:
It will allow operator to force alerting scheduler to honor a minimum frequency when Tick() is called.
This is continuation of work in #17279. It introduces a commit with the suggested UI modification on top of the existing commits. I have opened a new PR because I was unable to push commits to the old PR's source branch.

Which issue(s) this PR fixes:

Fixes #14447

Special notes for your reviewer:

Copy link
Contributor

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

Looks good AFAICT (haven't tested, just read through). But left a couple of comments.

conf/sample.ini Outdated Show resolved Hide resolved
public/app/features/alerting/partials/alert_tab.html Outdated Show resolved Hide resolved
Copy link
Member

@marefr marefr left a comment

Choose a reason for hiding this comment

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

See comments

conf/defaults.ini Show resolved Hide resolved
docs/sources/alerting/rules.md Outdated Show resolved Hide resolved
Copy link
Member

@marefr marefr left a comment

Choose a reason for hiding this comment

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

Looks good, but some minor things left.

public/app/features/alerting/partials/alert_tab.html Outdated Show resolved Hide resolved
const frequencySecs = kbn.interval_to_seconds(this.alert.frequency);
if (frequencySecs < this.alertingMinIntervalSecs) {
this.frequencyWarning =
'The rule will be evaluated every ' +
Copy link
Member

Choose a reason for hiding this comment

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

Would like to change the warning text, but not exactly sure to what. Suggestions:

  • "A minimum evaluation interval of this.alertingMinInterval have been configured and will be used for this rule"
  • "A minimum evaluation interval have been configured. This rule will be evaluated every this.alertingMinInterval"

@oddlittlebird maybe have some input on the warning text?

Evaluation interval is what we're referring to in docs: https://grafana.com/docs/grafana/latest/alerting/rules/#name-and-evaluation-interval

Copy link
Contributor

@oddlittlebird oddlittlebird Dec 30, 2019

Choose a reason for hiding this comment

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

Both of those warning texts are very passive. It makes it hard to understand what is happening to what. Of the two listed, the second is better. I would suggest something like:

"<rule name> will be evaluated every <this.alertingMinInterval>. You can change this by adjusting the <whatever> value."

Either that or the second sentence should be other useful information about why they might want to increase or lower the value.

@papagian papagian requested a review from marefr January 7, 2020 09:07
Copy link
Member

@marefr marefr left a comment

Choose a reason for hiding this comment

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

Still some minor things, see comments. The suggested warning message is a bit weird because the user may not be able to change it why I suggests a different one.

public/app/features/alerting/partials/alert_tab.html Outdated Show resolved Hide resolved
public/app/features/alerting/AlertTabCtrl.ts Outdated Show resolved Hide resolved
public/app/features/alerting/AlertTabCtrl.ts Outdated Show resolved Hide resolved
public/app/features/alerting/AlertTabCtrl.ts Outdated Show resolved Hide resolved
public/app/features/alerting/AlertTabCtrl.ts Outdated Show resolved Hide resolved
@papagian papagian requested a review from marefr January 13, 2020 09:00
Copy link
Member

@marefr marefr left a comment

Choose a reason for hiding this comment

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

LGTM

@papagian papagian merged commit d135f12 into master Jan 14, 2020
@papagian papagian deleted the alerting_min_interval branch January 14, 2020 09:13
@papagian papagian added this to the 6.6 milestone Jan 14, 2020
@papagian papagian changed the title Alerting: new min_interval_seconds options to enforce a minimum eval frequency Alerting: new min_interval_seconds option to enforce a minimum evaluation frequency Jan 14, 2020
ryantxu added a commit that referenced this pull request Jan 15, 2020
…ation

* origin/master:
  Explore: Fix timepicker when browsing back after switching datasource (#21454)
  Add disabled option for cookie samesite attribute (#21472)
  Chore: Adds basic alerting notification service tests (#21467)
  ImportDashboardCommand: Validate JSON fields (#21350)
  Docs: add test for website build (#21364)
  Fix: when clicking a plot on a touch device we won't display the annotation menu (#21479)
  Backend Plugins: add a common implementation (#21408)
  Alerting: new min_interval_seconds options to enforce a minimum eval frequency  (#21188)
  Panel: Use Tabs in panel inspector (#21468)
ryantxu added a commit that referenced this pull request Jan 15, 2020
* origin/master:
  ImportDashboardCommand: Validate JSON fields (#21350)
  Docs: add test for website build (#21364)
  Fix: when clicking a plot on a touch device we won't display the annotation menu (#21479)
  Backend Plugins: add a common implementation (#21408)
  Alerting: new min_interval_seconds options to enforce a minimum eval frequency  (#21188)
  Panel: Use Tabs in panel inspector (#21468)
  Docs: Update rpm install (#21475)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Alert, minimum time
4 participants