janmikes/symfony-console-sentry-cron-monitoring

Implementation of Sentry cron monitoring for symfony/console commands

dev-main 2023-09-16 08:39 UTC

This package is auto-updated.

Last update: 2024-04-16 10:11:09 UTC


README

  1. Install package - composer require janmikes/symfony-console-sentry-cron-monitoring
  2. Register Janmikes\SymfonyConsoleSentryCronMonitoring\MonitoringConsoleSubscriber service to your application (must be tagged as event subscriber)
  3. Add Monitor attributes to your console commands
  4. Profit!

Minimal

#[Monitor('0 */4 * * *', Environment::Production)]
class MySuperCoolCommand

Full

#[Monitor(
    cronExpression: '0 */4 * * *',
    environment: Environment::Production,
    checkinMargin: 10,
    maxRuntime: 60,
    timezone: 'Europe/Prague',
    arguments: ['some-arg', 'some-another-arg'],
)]
class MySuperCoolCommand