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

adds throttle grace #15

Closed
wants to merge 4 commits into from
Closed

adds throttle grace #15

wants to merge 4 commits into from

Conversation

kevincobain2000
Copy link
Member

@kevincobain2000 kevincobain2000 commented Oct 24, 2023

Consider throttled if alert is in grace period.
Use case is to ignore first few alerts. In order to shh occasional alerts.

Copy link
Collaborator

@gizumon gizumon left a comment

Choose a reason for hiding this comment

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

Thank you for your change.

Just to clarify the spec, let me make sure the difference between THROTTLE_DURATION and THROTTLE_GRACE_SECONDS.

Am I correct in assuming that the difference between these variables is in "seconds" or "minutes" and the following settings work as the same behavior?

  • THROTTLE_GRACE_SECONDS=300
  • THROTTLE_DURATION=5

Also, the reason to keep THROTTLE_DURATION is for supporting the compatibility, correct?

@kevincobain2000
Copy link
Member Author

kevincobain2000 commented Oct 25, 2023

@gizumon
THROTTLE_GRACE_SECONDS is a new feature.

Example, you set THROTTLE_GRACE_SECONDS=5 #seconds, then the new alerts in 5 seconds will not be notified. After 5 seconds are passed, the notification and throttling will begin.

Main reason I used seconds for THROTTLE_GRACE_SECONDS is to have more control on the period, as many users could have THROTTLE_DURATION=1 #minute and we want to set a smaller value for THROTTLE_GRACE_SECONDS.
Second reason is compatibility as I want to change THROTTLE_DURATION to seconds too, but that would lead to v2.

Example 1:

Error message = I am alert #occurs every hour
THROTTLE_GRACE_SECONDS=5 #seconds
THROTTLE_DURATION=5 #minutes
#This error will never be reported

Example 2:

Error message = I am alert #occurs every minute
THROTTLE_GRACE_SECONDS=5 #seconds
THROTTLE_DURATION=5 #minutes
#The first error will not be reported (1st minute)
#The second error will be reported (2nd minute)
#The third, fourth, fifth errors will not be reported until (5 mins and 5 seconds)

PS: I will write more tests on it, I think the implementation has a bug.

@kevincobain2000
Copy link
Member Author

Buggy and unable to add this feature.

@kevincobain2000 kevincobain2000 deleted the develop branch October 26, 2023 04:51
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