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

Compute default error duration if omitted #91

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

pederhan
Copy link
Member

@pederhan pederhan commented Dec 3, 2024

This PR adds a computed default for a source collector's error_duration based on its update_interval and error_tolerance.

Given a the following config, we can expect ZAC to compute a default value for error_duration that is between 300 and 359 seconds:

[source_collectors.faultysource]
module_name = "faultysource"
update_interval = 60
error_tolerance = 5
exit_on_err = false

This PR uses the following formula to compute the default value: round(error_tolerance * update_interval + (update_interval*0.9)). So for the config above, we will get a default error_duration of 354.

The extra duration (update_interval*0.9) allows for some accumulated latency during and between updates, while still ensuring 5 successive errors are required to trigger deactivation.

@pederhan pederhan merged commit f213300 into unioslo:master Dec 3, 2024
5 checks passed
@pederhan pederhan deleted the error-duration-computed-default branch December 3, 2024 09:47
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.

1 participant