Integrations - gonace/Cronitor GitHub Wiki

Report a scheduler's jobs to Cronitor without any reporting code in the jobs themselves.

Each integration is a separate package that hooks into a scheduler and reports its jobs: run when the job starts, complete when it succeeds, and fail, with the exception's message, when it fails. Installation, setup and the details of each are in the package's README.

Package Scheduler Reports Versions
Cronitor.Quartz Quartz.NET every job 4.x for Quartz 4, 3.x for Quartz 3
Cronitor.Hangfire Hangfire every recurring job 1.x for Hangfire 1
Cronitor.TickerQ TickerQ every cron job 8.x, 9.x and 10.x, matching TickerQ and .NET
Cronitor.Coravel Coravel every job scheduled with ScheduleWithCronitor 6.x for Coravel 6

Each package's major version matches its scheduler's, so pick the one for the scheduler version you use.

What they have in common

  • Setup: register Cronitor with .ConfigureCronitor() (see Setup), then enable the integration when you add the scheduler. Hangfire can also use the static CronitorClient instead. With Coravel, you also choose which jobs are reported, by scheduling them with ScheduleWithCronitor<TJob>() instead of Schedule<TJob>().
  • Monitor keys: a job reports to the monitor whose key is the job's name: the job name in Quartz, the recurring job ID in Hangfire, the function name in TickerQ, the job's class name in Coravel. Cronitor doesn't accept / in a monitor key, so a / in the name becomes -, and whitespace at either end is removed. In Quartz, Hangfire and TickerQ, a job whose name still breaks Cronitor's rules for keys, such as one longer than 100 characters, isn't reported or synced, and the reason is logged. In Coravel, a class name longer than 100 characters throws when the job is scheduled.
  • Keys you choose: a key you give Quartz's WithCronitorMonitorKey() or Coravel's ScheduleWithCronitor() is used exactly as given, so it must follow the rules for keys; it throws when the job is configured if it doesn't.
  • Monitors are created for you: a monitor that doesn't exist yet is created by the job's first report.
  • Reporting never breaks a job: if Cronitor can't be reached, the job still runs, and the error is logged.

Without an integration

For schedulers without an integration, or jobs you run yourself, report from the job with a using block. For a BackgroundService that repeats its work in a loop, see BackgroundService.

⚠️ **GitHub.com Fallback** ⚠️