@@ -2,7 +2,7 @@ import type { TraceContext } from './context';
22
33interface CrontabSchedule {
44 type : 'crontab' ;
5- // The crontab schedule string, e.g. 0 * * * *.
5+ /** The crontab schedule string, e.g. 0 * * * *. */
66 value : string ;
77}
88
@@ -14,32 +14,37 @@ interface IntervalSchedule {
1414
1515type MonitorSchedule = CrontabSchedule | IntervalSchedule ;
1616
17- // https://develop.sentry.dev/sdk/check-ins/
1817export interface SerializedCheckIn {
19- // Check-In ID (unique and client generated).
18+ /** Check-In ID (unique and client generated). */
2019 check_in_id : string ;
21- // The distinct slug of the monitor.
20+ /** The distinct slug of the monitor. */
2221 monitor_slug : string ;
23- // The status of the check-in.
22+ /** The status of the check-in. */
2423 status : 'in_progress' | 'ok' | 'error' ;
25- // The duration of the check-in in seconds. Will only take effect if the status is ok or error.
24+ /** The duration of the check-in in seconds. Will only take effect if the status is ok or error. */
2625 duration ?: number ;
2726 release ?: string ;
2827 environment ?: string ;
2928 monitor_config ?: {
3029 schedule : MonitorSchedule ;
31- // The allowed allowed margin of minutes after the expected check-in time that
32- // the monitor will not be considered missed for.
30+ /**
31+ * The allowed allowed margin of minutes after the expected check-in time that
32+ * the monitor will not be considered missed for.
33+ */
3334 checkin_margin ?: number ;
34- // The allowed allowed duration in minutes that the monitor may be `in_progress`
35- // for before being considered failed due to timeout.
35+ /**
36+ * The allowed allowed duration in minutes that the monitor may be `in_progress`
37+ * for before being considered failed due to timeout.
38+ */
3639 max_runtime ?: number ;
37- // A tz database string representing the timezone which the monitor's execution schedule is in.
38- // See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
40+ /**
41+ * A tz database string representing the timezone which the monitor's execution schedule is in.
42+ * See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
43+ */
3944 timezone ?: string ;
40- // How many consecutive failed check-ins it takes to create an issue.
45+ /** How many consecutive failed check-ins it takes to create an issue. */
4146 failure_issue_threshold ?: number ;
42- // How many consecutive OK check-ins it takes to resolve an issue.
47+ /** How many consecutive OK check-ins it takes to resolve an issue. */
4348 recovery_threshold ?: number ;
4449 } ;
4550 contexts ?: {
@@ -48,27 +53,27 @@ export interface SerializedCheckIn {
4853}
4954
5055export interface HeartbeatCheckIn {
51- // The distinct slug of the monitor.
56+ /** The distinct slug of the monitor. */
5257 monitorSlug : SerializedCheckIn [ 'monitor_slug' ] ;
53- // The status of the check-in.
58+ /** The status of the check-in. */
5459 status : 'ok' | 'error' ;
5560}
5661
5762export interface InProgressCheckIn {
58- // The distinct slug of the monitor.
63+ /** The distinct slug of the monitor. */
5964 monitorSlug : SerializedCheckIn [ 'monitor_slug' ] ;
60- // The status of the check-in.
65+ /** The status of the check-in. */
6166 status : 'in_progress' ;
6267}
6368
6469export interface FinishedCheckIn {
65- // The distinct slug of the monitor.
70+ /** The distinct slug of the monitor. */
6671 monitorSlug : SerializedCheckIn [ 'monitor_slug' ] ;
67- // The status of the check-in.
72+ /** The status of the check-in. */
6873 status : 'ok' | 'error' ;
69- // Check-In ID (unique and client generated).
74+ /** Check-In ID (unique and client generated). */
7075 checkInId : SerializedCheckIn [ 'check_in_id' ] ;
71- // The duration of the check-in in seconds. Will only take effect if the status is ok or error.
76+ /** The duration of the check-in in seconds. Will only take effect if the status is ok or error. */
7277 duration ?: SerializedCheckIn [ 'duration' ] ;
7378}
7479
@@ -77,18 +82,27 @@ export type CheckIn = HeartbeatCheckIn | InProgressCheckIn | FinishedCheckIn;
7782type SerializedMonitorConfig = NonNullable < SerializedCheckIn [ 'monitor_config' ] > ;
7883
7984export interface MonitorConfig {
85+ /**
86+ * The schedule on which the monitor should run. Either a crontab schedule string or an interval.
87+ */
8088 schedule : MonitorSchedule ;
81- // The allowed allowed margin of minutes after the expected check-in time that
82- // the monitor will not be considered missed for.
89+ /**
90+ * The allowed allowed margin of minutes after the expected check-in time that
91+ * the monitor will not be considered missed for.
92+ */
8393 checkinMargin ?: SerializedMonitorConfig [ 'checkin_margin' ] ;
84- // The allowed allowed duration in minutes that the monitor may be `in_progress`
85- // for before being considered failed due to timeout.
94+ /**
95+ * The allowed allowed duration in minutes that the monitor may be `in_progress`
96+ * for before being considered failed due to timeout.
97+ */
8698 maxRuntime ?: SerializedMonitorConfig [ 'max_runtime' ] ;
87- // A tz database string representing the timezone which the monitor's execution schedule is in.
88- // See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
99+ /**
100+ * A tz database string representing the timezone which the monitor's execution schedule is in.
101+ * See: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
102+ */
89103 timezone ?: SerializedMonitorConfig [ 'timezone' ] ;
90- // How many consecutive failed check-ins it takes to create an issue.
104+ /** How many consecutive failed check-ins it takes to create an issue. */
91105 failureIssueThreshold ?: SerializedMonitorConfig [ 'failure_issue_threshold' ] ;
92- // How many consecutive OK check-ins it takes to resolve an issue.
106+ /** How many consecutive OK check-ins it takes to resolve an issue. */
93107 recoveryThreshold ?: SerializedMonitorConfig [ 'recovery_threshold' ] ;
94108}
0 commit comments