Conversation
Derive a monitor config from the job's trigger and send it with the in-progress check-in, so Sentry can create or update the monitor from code. Cron triggers are sent as a crontab with the trigger's time zone, and simple triggers that repeat every whole number of minutes as an interval. Other triggers send no config. Opt out per job by setting sentry-upsert-monitor-config to false in the job data.
Contributor
|
1 of 6 tasks
📲 Install BuildsAndroid
|
3 of 9 tasks
…nfig' into danf/quartz-cron-config # Conflicts: # CHANGELOG.md
Send the monitor config only when sentry-upsert-monitor-config is true in the job data.
…nfig' into danf/quartz-cron-config
Steps from a single day of week stop on Saturday, names with L become numbers, and only SimpleTriggers that repeat forever send an interval. Derive the config before forking scopes and store the scope token first so it is always closed.
…nfig' into danf/quartz-cron-config
Quartz ignores a step after a day or month name, and Sentry can't express calendar exclusions, so send no config for either. 7/n only fires on Saturday.
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #6215 (Spring), which is stacked on #6217 (core
MonitorConfigUtils). Merge those first.📜 Description
With
SentryJobListener.SENTRY_UPSERT_MONITOR_CONFIG_KEYset totruein the job data (opt-in),SentryJobListenersends a monitor config from the job's trigger with the in-progress check-in, like #6215 does for Spring.CronTrigger: the cron, converted byMonitorConfigUtils, with the trigger's time zone. A*year field is dropped (any other year sends no config), and Quartz's day-of-week numbers and names (1–7 from Sunday) are shifted to crontab's 0–6. Quartz ignores a step after a name (SUN/2is every Sunday), so that sends no config.SimpleTriggerthat repeats forever: an interval when it's a whole number of minutes.Calendarsend no config, as Sentry can't express the exclusions.💡 Motivation and Context
Without a config, check-ins for monitors that weren't created in Sentry are dropped. The trigger already has the schedule.
💚 How did you test it?
New
SentryJobListenerTest(the module had no tests).📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Docs: getsentry/sentry-docs#19777