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

Add Cron Monitoring for the Scheduler Component #776

Open
cleptric opened this issue Nov 2, 2023 · 4 comments
Open

Add Cron Monitoring for the Scheduler Component #776

cleptric opened this issue Nov 2, 2023 · 4 comments

Comments

@cleptric
Copy link
Member

cleptric commented Nov 2, 2023

Symfony 6.3 added a new Scheduler Component, something we should add support for, for Cron Monitoring.

https://symfony.com/blog/new-in-symfony-6-3-scheduler-component

@Mika56
Copy link

Mika56 commented Sep 17, 2024

Hello,

I am interested in using and implementing this feature as well.

Scheduler seems to have everything we need to implement this, the most important being that Scheduler dispatches events before and after running crons.

Questions that come to mind are:

  • How/when are crons definitions sent to Sentry? I think it could be either:
    • A dedicated sentry:crons:sync-definitions command
    • Anytime a Messenger worker is started (my preference)
  • How do we set checkinMargin, maxRuntime, failureIssueThreshold, recoveryThreshold? I suggest we add a #[Sentry\Cron] attribute or similar

@cleptric
Copy link
Member Author

Our SDK has a baseline of PHP 7.2. If we conditionally can make this work, I'm ok with adding the Cron's configuration via attributes. I'm aware that the scheduler component is only available from PHP 8.1 and up.

@Mika56
Copy link

Mika56 commented Oct 14, 2024

Doctrine annotations can be used as a fallback, but it is not a dependency.

Attributes are "compatible" with PHP 7, in a sense that the compiler just ignores it. Scheduler has indeed been introduced in Symfony 6.3, which requires PHP 8.1+. We could throw an exception for this feature when PHP_VERSION<8.1 just in case.

@cleptric
Copy link
Member Author

We rather don’t want to throw exceptions but instead fail silently and emit a debug log entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants