From 23ff17e60082c5d1407ac2cd1951153f5f2a2d5a Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Fri, 16 Oct 2026 17:40:47 -0700 Subject: [PATCH 1/4] docs(dotnet): Document monitoring all Hangfire recurring jobs Co-Authored-By: Claude --- .../dotnet/common/crons/hangfire/index.mdx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/platforms/dotnet/common/crons/hangfire/index.mdx b/docs/platforms/dotnet/common/crons/hangfire/index.mdx index 05d64b30dac686..83f283a71bf129 100644 --- a/docs/platforms/dotnet/common/crons/hangfire/index.mdx +++ b/docs/platforms/dotnet/common/crons/hangfire/index.mdx @@ -50,7 +50,7 @@ The SDK will automatically capture a check-in with `CheckInStatus.InProgress` wh Sentry only creates a monitor from a check-in that includes a monitor config. From the next SDK release, the SDK sends the schedule of your recurring jobs with their check-ins by default. -The job still needs the `SentryMonitorSlug` attribute. The SDK doesn't use the recurring job ID as the monitor slug. +The job still needs the `SentryMonitorSlug` attribute, unless you [monitor all recurring jobs](#monitor-all-recurring-jobs). ```csharp using Hangfire; @@ -80,3 +80,19 @@ GlobalConfiguration.Configuration.UseSentry(options => options.SendMonitorConfig ``` If you delete a monitor while its job still has `[SentryMonitorSlug]`, the next run creates it again. To stop monitoring a job, disable the monitor in Sentry, or remove the attribute. + +## Monitor All Recurring Jobs + +From the next SDK release, you can monitor every recurring job without adding the `SentryMonitorSlug` attribute to each one. Turn on `MonitorAllRecurringJobs`, and list any recurring job IDs you don't want to monitor in `ExcludedRecurringJobs`: + +```csharp +GlobalConfiguration.Configuration.UseSentry(options => +{ + options.MonitorAllRecurringJobs = true; + options.ExcludedRecurringJobs.Add("cache-warmup"); +}); +``` + +The monitor slug is the recurring job ID in lowercase, with characters other than letters, digits, `-`, and `_` replaced by `-`, and cut to 50 characters. For example, the recurring job `Reports.Nightly Run` reports to the monitor `reports-nightly-run`. Jobs with the `SentryMonitorSlug` attribute keep their slug and are monitored even if their ID is excluded. + +The schedule is sent as described in [Send the Recurring Job Schedule](#send-the-recurring-job-schedule). If two recurring jobs end up with the same monitor slug and different schedules, their check-ins are sent without a schedule. Jobs that aren't recurring, such as `BackgroundJob.Enqueue`, still need the attribute. From 1d7f02a08239d993dfe1aa6533b964a5a05d2fdf Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Mon, 19 Oct 2026 17:50:13 -0700 Subject: [PATCH 2/4] docs(dotnet): Recommend monitoring all Hangfire recurring jobs first Co-Authored-By: Claude --- .../dotnet/common/crons/hangfire/index.mdx | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/docs/platforms/dotnet/common/crons/hangfire/index.mdx b/docs/platforms/dotnet/common/crons/hangfire/index.mdx index 83f283a71bf129..0d087e7813a0f5 100644 --- a/docs/platforms/dotnet/common/crons/hangfire/index.mdx +++ b/docs/platforms/dotnet/common/crons/hangfire/index.mdx @@ -25,7 +25,27 @@ builder.Services.AddHangfire(configuration => configuration ); ``` -To let the SDK know which jobs to monitor, you need to provide the job with a monitor slug. This can be done by setting the `SentryMonitorSlug` attribute on the job. For example, the following snippet shows how to set up a fire-and-forget job that Sentry will monitor: +For each monitored job, the SDK will automatically capture a check-in with `CheckInStatus.InProgress` when the job starts and update the check-in with `CheckInStatus.OK` on success. In case of an exception during execution, the check-in will be updated as `CheckInStatus.ERROR` instead. + +## Monitor All Recurring Jobs + +We recommend monitoring every recurring job. From the next SDK release, you can do this without adding the `SentryMonitorSlug` attribute to each one. Turn on `MonitorAllRecurringJobs`, and list any recurring job IDs you don't want to monitor in `ExcludedRecurringJobs`: + +```csharp +GlobalConfiguration.Configuration.UseSentry(options => +{ + options.MonitorAllRecurringJobs = true; + options.ExcludedRecurringJobs.Add("cache-warmup"); +}); +``` + +The monitor slug is the recurring job ID in lowercase, with characters other than letters, digits, `-`, and `_` replaced by `-`, and cut to 50 characters. For example, the recurring job `Reports.Nightly Run` reports to the monitor `reports-nightly-run`. Jobs with the `SentryMonitorSlug` attribute keep their slug and are monitored even if their ID is excluded. + +The schedule is sent as described in [Send the Recurring Job Schedule](#send-the-recurring-job-schedule). If two recurring jobs end up with the same monitor slug and different schedules, their check-ins are sent without a schedule. Jobs that aren't recurring, such as `BackgroundJob.Enqueue`, still need the attribute. + +## Monitor Specific Jobs + +To monitor specific jobs, including jobs that aren't recurring, provide the job with a monitor slug by setting the `SentryMonitorSlug` attribute on it. For example, the following snippet shows how to set up a fire-and-forget job that Sentry will monitor: ```csharp using Hangfire; @@ -44,7 +64,7 @@ public class PricingUpdateWorker } ``` -The SDK will automatically capture a check-in with `CheckInStatus.InProgress` when the job starts and update the check-in with `CheckInStatus.OK` on success. In case of an exception during execution, the check-in will be updated as `CheckInStatus.ERROR` instead. +With `MonitorAllRecurringJobs` on, a recurring job with the attribute still sends one check-in per run, using the attribute's slug. ## Send the Recurring Job Schedule @@ -80,19 +100,3 @@ GlobalConfiguration.Configuration.UseSentry(options => options.SendMonitorConfig ``` If you delete a monitor while its job still has `[SentryMonitorSlug]`, the next run creates it again. To stop monitoring a job, disable the monitor in Sentry, or remove the attribute. - -## Monitor All Recurring Jobs - -From the next SDK release, you can monitor every recurring job without adding the `SentryMonitorSlug` attribute to each one. Turn on `MonitorAllRecurringJobs`, and list any recurring job IDs you don't want to monitor in `ExcludedRecurringJobs`: - -```csharp -GlobalConfiguration.Configuration.UseSentry(options => -{ - options.MonitorAllRecurringJobs = true; - options.ExcludedRecurringJobs.Add("cache-warmup"); -}); -``` - -The monitor slug is the recurring job ID in lowercase, with characters other than letters, digits, `-`, and `_` replaced by `-`, and cut to 50 characters. For example, the recurring job `Reports.Nightly Run` reports to the monitor `reports-nightly-run`. Jobs with the `SentryMonitorSlug` attribute keep their slug and are monitored even if their ID is excluded. - -The schedule is sent as described in [Send the Recurring Job Schedule](#send-the-recurring-job-schedule). If two recurring jobs end up with the same monitor slug and different schedules, their check-ins are sent without a schedule. Jobs that aren't recurring, such as `BackgroundJob.Enqueue`, still need the attribute. From 24969f14d29b0872c6a4490f6c1f5cecb74fc74a Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Tue, 20 Oct 2026 10:46:00 -0700 Subject: [PATCH 3/4] docs(dotnet): Match the Hangfire slug rule and how to stop monitoring a job Co-Authored-By: Claude --- docs/platforms/dotnet/common/crons/hangfire/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/dotnet/common/crons/hangfire/index.mdx b/docs/platforms/dotnet/common/crons/hangfire/index.mdx index 0d087e7813a0f5..5d7056b88bc719 100644 --- a/docs/platforms/dotnet/common/crons/hangfire/index.mdx +++ b/docs/platforms/dotnet/common/crons/hangfire/index.mdx @@ -39,7 +39,7 @@ GlobalConfiguration.Configuration.UseSentry(options => }); ``` -The monitor slug is the recurring job ID in lowercase, with characters other than letters, digits, `-`, and `_` replaced by `-`, and cut to 50 characters. For example, the recurring job `Reports.Nightly Run` reports to the monitor `reports-nightly-run`. Jobs with the `SentryMonitorSlug` attribute keep their slug and are monitored even if their ID is excluded. +The monitor slug is the recurring job ID in lowercase, with each run of characters other than letters, digits, and `_` replaced by a single `-`, and cut to 50 characters. For example, the recurring job `Reports.Nightly Run` reports to the monitor `reports-nightly-run`. Jobs with the `SentryMonitorSlug` attribute keep their slug and are monitored even if their ID is excluded. The schedule is sent as described in [Send the Recurring Job Schedule](#send-the-recurring-job-schedule). If two recurring jobs end up with the same monitor slug and different schedules, their check-ins are sent without a schedule. Jobs that aren't recurring, such as `BackgroundJob.Enqueue`, still need the attribute. @@ -99,4 +99,4 @@ When you upgrade, existing monitors for recurring jobs get their schedule and ti GlobalConfiguration.Configuration.UseSentry(options => options.SendMonitorConfig = false); ``` -If you delete a monitor while its job still has `[SentryMonitorSlug]`, the next run creates it again. To stop monitoring a job, disable the monitor in Sentry, or remove the attribute. +If you delete a monitor while its job is still monitored, the next run creates it again. To stop monitoring a job, disable the monitor in Sentry, remove the attribute, or add the job to `ExcludedRecurringJobs`. From dbf27363de157d9afaf1868b839f4bf52e12c779 Mon Sep 17 00:00:00 2001 From: Dan Fuller Date: Wed, 21 Oct 2026 15:39:09 -0700 Subject: [PATCH 4/4] docs(dotnet): Update Hangfire slug rule and regex exclusions Co-Authored-By: Claude --- docs/platforms/dotnet/common/crons/hangfire/index.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/platforms/dotnet/common/crons/hangfire/index.mdx b/docs/platforms/dotnet/common/crons/hangfire/index.mdx index 5d7056b88bc719..cda063241d9b93 100644 --- a/docs/platforms/dotnet/common/crons/hangfire/index.mdx +++ b/docs/platforms/dotnet/common/crons/hangfire/index.mdx @@ -29,17 +29,18 @@ For each monitored job, the SDK will automatically capture a check-in with `Chec ## Monitor All Recurring Jobs -We recommend monitoring every recurring job. From the next SDK release, you can do this without adding the `SentryMonitorSlug` attribute to each one. Turn on `MonitorAllRecurringJobs`, and list any recurring job IDs you don't want to monitor in `ExcludedRecurringJobs`: +We recommend monitoring every recurring job. From the next SDK release, you can do this without adding the `SentryMonitorSlug` attribute to each one. Turn on `MonitorAllRecurringJobs`, and add any recurring jobs you don't want to monitor to `ExcludedRecurringJobs`, by ID or with a regular expression: ```csharp GlobalConfiguration.Configuration.UseSentry(options => { options.MonitorAllRecurringJobs = true; options.ExcludedRecurringJobs.Add("cache-warmup"); + options.ExcludedRecurringJobs.Add(new Regex("^cleanup-", RegexOptions.IgnoreCase)); }); ``` -The monitor slug is the recurring job ID in lowercase, with each run of characters other than letters, digits, and `_` replaced by a single `-`, and cut to 50 characters. For example, the recurring job `Reports.Nightly Run` reports to the monitor `reports-nightly-run`. Jobs with the `SentryMonitorSlug` attribute keep their slug and are monitored even if their ID is excluded. +The monitor slug is the recurring job ID, normalized the same way Sentry normalizes monitor slugs: lowercased, accents removed, spaces and dashes replaced by a single `-`, other characters dropped, and cut to 50 characters. For example, the recurring job `Reports: Nightly Run` reports to the monitor `reports-nightly-run`. Jobs with the `SentryMonitorSlug` attribute keep their slug and are monitored even if their ID is excluded. The schedule is sent as described in [Send the Recurring Job Schedule](#send-the-recurring-job-schedule). If two recurring jobs end up with the same monitor slug and different schedules, their check-ins are sent without a schedule. Jobs that aren't recurring, such as `BackgroundJob.Enqueue`, still need the attribute.