Skip to content

feat: add Sentry.Quartz3 for cron monitoring of Quartz.NET 3.x jobs - #5668

Draft
wedamija wants to merge 3 commits into
danf/quartz-5505-rebasedfrom
danf/quartz-crons
Draft

wedamija wants to merge 3 commits into
danf/quartz-5505-rebasedfrom
danf/quartz-crons

Conversation

@wedamija

@wedamija wedamija commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Description

Stacked on #5505 (base branch danf/quartz-5505-rebased is a copy of #5505's branch).

Adds Sentry.Quartz3, the Quartz.NET 3.x add-on to Sentry.Quartz (#5505). It compiles the same core files (schedule conversion, slugs, options, check-ins) against Quartz [3.6.0,4.0.0) for net8.0, net9.0, net10.0 and net462, and runs them from an IJobListener, since Quartz 3 has no job middleware.

services.AddQuartz(q => q.AddJobListener<SentryJobListener>());
// or: scheduler.ListenerManager.AddJobListener(new SentryJobListener());

Check-ins and monitor configs work as in Sentry.Quartz: only jobs with [SentryCronMonitorSlug] are monitored, and their trigger's schedule is sent unless SendMonitorConfig is off. A listener can't wrap the job, so there is no per-job scope or exception capture.

Quartz 4 changed IJobListener to return ValueTask with default implementations, so this listener would load there but never be called. It logs an error pointing to Sentry.Quartz instead.

A release-registry entry is needed before the first release.

Motivation

Quartz 4 only targets net10.0, so apps on .NET Framework or older .NET stay on Quartz 3. They need the same check-ins, and sharing the core keeps the extra code to the listener.

Testing

The core tests from Sentry.Quartz.Tests run against Quartz 3.6 on net8.0, net9.0 and net10.0 (and net48 on Windows), plus listener tests and a real-scheduler test. API approval files added.

Docs: getsentry/sentry-docs#19790

@codecov

codecov Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 8 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (danf/quartz-5505-rebased@fe97276). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/Sentry.Quartz3/SentryJobListener.cs 65.21% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@                     Coverage Diff                     @@
##             danf/quartz-5505-rebased    #5668   +/-   ##
===========================================================
  Coverage                            ?   75.50%           
===========================================================
  Files                               ?      525           
  Lines                               ?    19279           
  Branches                            ?     3775           
===========================================================
  Hits                                ?    14557           
  Misses                              ?     3842           
  Partials                            ?      880           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wedamija
wedamija changed the base branch from main to danf/quartz4-crons October 6, 2026 02:03
@wedamija wedamija changed the title feat: add Sentry.Quartz for cron monitoring of Quartz.NET jobs feat: add Sentry.Quartz3 for cron monitoring of Quartz.NET 3.x jobs Oct 6, 2026
wedamija and others added 2 commits October 8, 2026 13:47
Compiles the Sentry.Quartz core (schedule conversion, slugs, options and
check-ins) against Quartz 3.6+ and drives it from an IJobListener, since
Quartz 3 has no job middleware. Logs an error at startup when Quartz 4
is loaded, where the listener's Task methods would never be called.

Co-Authored-By: Claude <noreply@anthropic.com>
Quartz 3 needs exactly one '?' day field, so only that form is converted.
ConfigureMonitorOptions gets the listener's IJobExecutionContext, and the
final check-in reuses the ID created for the in-progress one.

Co-Authored-By: Claude <noreply@anthropic.com>
@wedamija
wedamija changed the base branch from danf/quartz4-crons to danf/quartz-5505-rebased October 8, 2026 21:32
Co-Authored-By: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant