Skip to content

Commit cd97287

Browse files
authored
fix(core): Pass in cron monitor config correctly (#12248)
Fixes #12217 Make sure `failure_issue_threshold` and `recovery_threshold` get passed in correctly.
1 parent d5f1caf commit cd97287

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

packages/core/src/server-runtime-client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ export class ServerRuntimeClient<
179179
checkin_margin: monitorConfig.checkinMargin,
180180
max_runtime: monitorConfig.maxRuntime,
181181
timezone: monitorConfig.timezone,
182+
failure_issue_threshold: monitorConfig.failureIssueThreshold,
183+
recovery_threshold: monitorConfig.recoveryThreshold,
182184
};
183185
}
184186

packages/core/test/lib/serverruntimeclient.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ describe('ServerRuntimeClient', () => {
8989
checkinMargin: 2,
9090
maxRuntime: 12333,
9191
timezone: 'Canada/Eastern',
92+
failureIssueThreshold: 2,
93+
recoveryThreshold: 3,
9294
},
9395
);
9496

@@ -112,6 +114,8 @@ describe('ServerRuntimeClient', () => {
112114
checkin_margin: 2,
113115
max_runtime: 12333,
114116
timezone: 'Canada/Eastern',
117+
failure_issue_threshold: 2,
118+
recovery_threshold: 3,
115119
},
116120
},
117121
],

packages/types/src/checkin.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ export interface SerializedCheckIn {
3737
// A tz database string representing the timezone which the monitor's execution schedule is in.
3838
// See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
3939
timezone?: string;
40+
// How many consecutive failed check-ins it takes to create an issue.
41+
failure_issue_threshold?: number;
42+
// How many consecutive OK check-ins it takes to resolve an issue.
43+
recovery_threshold?: number;
4044
};
4145
contexts?: {
4246
trace?: TraceContext;
@@ -84,7 +88,7 @@ export interface MonitorConfig {
8488
// See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
8589
timezone?: SerializedMonitorConfig['timezone'];
8690
// How many consecutive failed check-ins it takes to create an issue.
87-
failure_issue_threshold?: number;
91+
failureIssueThreshold?: SerializedMonitorConfig['failure_issue_threshold'];
8892
// How many consecutive OK check-ins it takes to resolve an issue.
89-
recovery_threshold?: number;
93+
recoveryThreshold?: SerializedMonitorConfig['recovery_threshold'];
9094
}

0 commit comments

Comments
 (0)