Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/platforms/java/common/integrations/quartz.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

</Alert>

## 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The documentation contains a placeholder version string that was not replaced with the actual version number, leaving users unsure which SDK version is required.
Severity: LOW

Suggested Fix

Replace the placeholder text "the next Sentry Java SDK release (after 8.59.0)" with the correct, released version number of the Sentry Java SDK.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: docs/platforms/java/common/integrations/quartz.mdx#L85

Potential issue: The documentation at
`docs/platforms/java/common/integrations/quartz.mdx:85` contains a placeholder version
string: "the next Sentry Java SDK release (after `8.59.0`)". This was intended to be
replaced with a specific version number before publication. Because this pre-merge step
was missed, users are unable to determine the exact SDK version required for the
described feature.

Did we get this right? 👍 / 👎 to inform future reviews.


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`.

<Alert>

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.

</Alert>

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<String, Object> jobData = new HashMap<>();
jobData.put(SentryJobListener.SENTRY_SLUG_KEY, "<monitor-slug>");
jobData.put(SentryJobListener.SENTRY_UPSERT_MONITOR_CONFIG_KEY, "false");

JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean();
jobDetailFactory.setJobDataAsMap(jobData);
```
Loading