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
Monitor latest task runs per CLI #146
Conversation
I decided to have one CLI task for multiple task checks. We also know how often we call these tasks in the cron environment, so it's not a bad choice to also pass this info (how long ago is acceptable) in the same environment. To test:
|
…un info as extra context. Also alert if no latest run exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing changelog entry.
if ( | ||
now - acceptable_interval | ||
<= latest_run.datetime | ||
<= now + acceptable_interval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the now + acceptable_interval
supposed to do? Doesn't seem documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I got this from Bobby's code. It checks if the latest run time isn't too far from the monitor's now perspective.
Well, re-thinking it, I am actually not sure this makes sense. This date can practically happen to be in the future from the monitor's perspective, but if the clocks of monitoring server and task-executing server are out of sync, that should become a different kind of warning I guess. Then the allowed interval isn't a good measurement, as we don't know how much we are out of bounds.
AAAnyway ― in our case the same server is executing and monitoring so I'll not do that extra warning. I'll simply remove the future check.
New CLI function to monitor if tasks have run successfully and their latest run time is acceptable.
Alerts are sent to sentry and configurable email addresses.