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

Fixes the critical alerts exception with the start_time > end_time #551

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

tsebastiani
Copy link
Collaborator

If datetime.now() is defined as default parameter value, the date is calculated at the moment the intepreter defines the function and not when the function is called (as I thought), that's the reason why the start_time is considered greater than the end_time by the prometheus API as explained here.
This change fixes the issue.

This has been enforced also on the krkn-lib side, but this fix will solve the problem immediately without the need of updating to the next version.

@tsebastiani tsebastiani requested review from chaitanyaenr and paigerube14 and removed request for chaitanyaenr January 15, 2024 10:53
Copy link
Collaborator

@paigerube14 paigerube14 left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Collaborator

@chaitanyaenr chaitanyaenr left a comment

Choose a reason for hiding this comment

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

LGTM!

@chaitanyaenr chaitanyaenr merged commit aa030a2 into krkn-chaos:main Jan 15, 2024
2 checks passed
@tsebastiani tsebastiani deleted the prom_query_range_fix branch January 15, 2024 18:00
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.

3 participants