Repository navigation
docs(java): Document Quartz monitor config upsert #19777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wedamija
wants to merge
7
commits into
master
Choose a base branch
from
danf/quartz-cron-config-docs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3052a5d
docs(java): Document Quartz monitor config upsert
wedamija 1f6afe8
docs(java): Make Quartz monitor config upsert opt-in
wedamija 8990e68
docs(java): Note Quartz schedules that send no monitor config
wedamija 3aa7c09
docs(java): Use one job data map and list name steps and calendars
wedamija dd296dd
docs(java): Set the Quartz upsert key as a String
wedamija 246eab1
docs(java): Quartz monitor config is on by default
wedamija 972655b
docs(java): Clarify which Quartz time zones send a monitor config
wedamija File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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. | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| 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`. | ||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| <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); | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
Did we get this right? 👍 / 👎 to inform future reviews.