diff --git a/docs/platforms/java/common/integrations/quartz.mdx b/docs/platforms/java/common/integrations/quartz.mdx index 306141d22fb6b..70af8734918f0 100644 --- a/docs/platforms/java/common/integrations/quartz.mdx +++ b/docs/platforms/java/common/integrations/quartz.mdx @@ -79,3 +79,31 @@ Setting the monitor slug on the `Trigger` will override what is set on the `JobD Setting a global job listener using a `SchedulerFactoryBeanCustomizer` in Spring Boot, will override the listener set by Sentry. For Sentry to work properly, you need to add a new `SentryJobListener` instance to the global job listeners. + +## Monitor Config + +From the next Sentry Java SDK release (after `8.59.0`), `SentryJobListener` sends a monitor config derived from the job's trigger with each check-in, so Sentry creates the monitor (or updates its schedule) from your code. This is on by default for every job that has a monitor slug. + +The config is derived like this: + +- `CronTrigger`: the cron expression and the trigger's time zone. The seconds field must be a fixed number, and the year field, if set, must be `*`. +- `SimpleTrigger` that repeats forever: the repeat interval, if it's a whole number of minutes. + +Other triggers send no monitor config, and neither do triggers with a `Calendar`, jobs with more than one trigger, cron expressions with syntax Sentry doesn't support (such as `15W`, `L-3`, or wrap-around ranges like `FRI-MON`), a step after a day or month name (such as `MON/2`, which Quartz runs every Monday), or time zones that aren't IANA time zone IDs. For these, create the monitor in Sentry first. Whole-hour offsets such as `GMT+2` aren't affected: they're sent as `Etc/GMT-2`. + + + +When you upgrade, monitors you created in Sentry take their schedule and time zone from the trigger. To keep managing a monitor's schedule in Sentry, turn the monitor config off for that job. + + + +To turn it off for a job, set `SentryJobListener.SENTRY_UPSERT_MONITOR_CONFIG_KEY` to the string `"false"` in the job data map, next to the monitor slug. Like the slug, it also works in the trigger's job data map: + +```java +Map jobData = new HashMap<>(); +jobData.put(SentryJobListener.SENTRY_SLUG_KEY, ""); +jobData.put(SentryJobListener.SENTRY_UPSERT_MONITOR_CONFIG_KEY, "false"); + +JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean(); +jobDetailFactory.setJobDataAsMap(jobData); +```