Skip to content

Commit 9b8318e

Browse files
wedamijaclaude
andauthored
ref(core): Add MonitorConfigUtils to convert schedules to monitor configs (#6217)
* ref(core): Add MonitorConfigUtils to convert schedules to monitor configs Framework-free conversion of a 6 field cron expression, fixed rate or fixed delay into a MonitorConfig, plus period parsing, so the Spring and Quartz integrations can share it. * fix(core): Only send monitor configs Sentry reads the same way Return no config when day of month and day of week are both set, for cron syntax Sentry rejects, and for zones that are not IANA region IDs. Whole-hour fixed offsets map to Etc/GMT zones. Intervals use hours or days when they divide evenly. * ref(core): Add MonitorConfigUtils.fromSpringScheduled Move the Spring day-of-week rewrite and the JVM default zone rule into core so the three Spring modules share them. * fix(core): Return no config for stepped single value ranges Spring and Quartz run 10-10/2 only at 10, cronsim steps to the field max. * fix(core): Read Spring crons per parser and skip fixed delays Spring before 5.3 steps day of month */n from 0 and can run at midnight when both day fields are set; read its crons that way. Spring 5.3 runs #5 in months without a fifth weekday, so return null for it. A fixed delay drifts from any interval, so it gets no config. * fix(core): Keep Sunday-only day of week ranges SUN-SUN was rewritten to 0-7, which crontab reads as every day. Co-Authored-By: Claude <noreply@anthropic.com> * fix(core): Use a 2 minute check-in margin for crons with fixed seconds Dropping a non-zero seconds field makes check-ins arrive up to 59s after the expected minute, which a 1 minute margin barely covers. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent fff7ea5 commit 9b8318e

3 files changed

Lines changed: 1010 additions & 0 deletions

File tree

‎sentry/api/sentry.api‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8148,6 +8148,12 @@ public final class io/sentry/util/MapObjectWriter : io/sentry/ObjectWriter {
81488148
public fun value (Z)Lio/sentry/util/MapObjectWriter;
81498149
}
81508150

8151+
public final class io/sentry/util/MonitorConfigUtils {
8152+
public static fun fromSchedule (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;)Lio/sentry/MonitorConfig;
8153+
public static fun fromSpringScheduled (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Long;Z)Lio/sentry/MonitorConfig;
8154+
public static fun parsePeriodMillis (Ljava/lang/String;Ljava/util/concurrent/TimeUnit;)Ljava/lang/Long;
8155+
}
8156+
81518157
public final class io/sentry/util/Objects {
81528158
public static fun equals (Ljava/lang/Object;Ljava/lang/Object;)Z
81538159
public static fun hash ([Ljava/lang/Object;)I

0 commit comments

Comments
 (0)