Skip to content

fix(core): Pass in cron monitor config correctly #12248

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

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions packages/core/src/server-runtime-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ export class ServerRuntimeClient<
checkin_margin: monitorConfig.checkinMargin,
max_runtime: monitorConfig.maxRuntime,
timezone: monitorConfig.timezone,
failure_issue_threshold: monitorConfig.failureIssueThreshold,
recovery_threshold: monitorConfig.recoveryThreshold,
};
}

Expand Down
4 changes: 4 additions & 0 deletions packages/core/test/lib/serverruntimeclient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ describe('ServerRuntimeClient', () => {
checkinMargin: 2,
maxRuntime: 12333,
timezone: 'Canada/Eastern',
failureIssueThreshold: 2,
recoveryThreshold: 3,
},
);

Expand All @@ -112,6 +114,8 @@ describe('ServerRuntimeClient', () => {
checkin_margin: 2,
max_runtime: 12333,
timezone: 'Canada/Eastern',
failure_issue_threshold: 2,
recovery_threshold: 3,
},
},
],
Expand Down
8 changes: 6 additions & 2 deletions packages/types/src/checkin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export interface SerializedCheckIn {
// A tz database string representing the timezone which the monitor's execution schedule is in.
// See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone?: string;
// How many consecutive failed check-ins it takes to create an issue.
failure_issue_threshold?: number;
// How many consecutive OK check-ins it takes to resolve an issue.
recovery_threshold?: number;
};
contexts?: {
trace?: TraceContext;
Expand Down Expand Up @@ -84,7 +88,7 @@ export interface MonitorConfig {
// See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone?: SerializedMonitorConfig['timezone'];
// How many consecutive failed check-ins it takes to create an issue.
failure_issue_threshold?: number;
failureIssueThreshold?: SerializedMonitorConfig['failure_issue_threshold'];
// How many consecutive OK check-ins it takes to resolve an issue.
recovery_threshold?: number;
Comment on lines -87 to -89
Copy link
Member Author

Choose a reason for hiding this comment

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

Although this is technically a breaking change, these values were not used for anything, and are incorrect format, so I'm fine with removing them (they were also not documented anywhere - I opened getsentry/sentry-docs#10168 to document this PR).

recoveryThreshold?: SerializedMonitorConfig['recovery_threshold'];
}
Loading