@@ -2,7 +2,7 @@ import type { TraceContext } from './context';
2
2
3
3
interface CrontabSchedule {
4
4
type : 'crontab' ;
5
- // The crontab schedule string, e.g. 0 * * * *.
5
+ /** The crontab schedule string, e.g. 0 * * * *. */
6
6
value : string ;
7
7
}
8
8
@@ -14,32 +14,37 @@ interface IntervalSchedule {
14
14
15
15
type MonitorSchedule = CrontabSchedule | IntervalSchedule ;
16
16
17
- // https://develop.sentry.dev/sdk/check-ins/
18
17
export interface SerializedCheckIn {
19
- // Check-In ID (unique and client generated).
18
+ /** Check-In ID (unique and client generated). */
20
19
check_in_id : string ;
21
- // The distinct slug of the monitor.
20
+ /** The distinct slug of the monitor. */
22
21
monitor_slug : string ;
23
- // The status of the check-in.
22
+ /** The status of the check-in. */
24
23
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. */
26
25
duration ?: number ;
27
26
release ?: string ;
28
27
environment ?: string ;
29
28
monitor_config ?: {
30
29
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
+ */
33
34
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
+ */
36
39
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
+ */
39
44
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. */
41
46
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. */
43
48
recovery_threshold ?: number ;
44
49
} ;
45
50
contexts ?: {
@@ -48,27 +53,27 @@ export interface SerializedCheckIn {
48
53
}
49
54
50
55
export interface HeartbeatCheckIn {
51
- // The distinct slug of the monitor.
56
+ /** The distinct slug of the monitor. */
52
57
monitorSlug : SerializedCheckIn [ 'monitor_slug' ] ;
53
- // The status of the check-in.
58
+ /** The status of the check-in. */
54
59
status : 'ok' | 'error' ;
55
60
}
56
61
57
62
export interface InProgressCheckIn {
58
- // The distinct slug of the monitor.
63
+ /** The distinct slug of the monitor. */
59
64
monitorSlug : SerializedCheckIn [ 'monitor_slug' ] ;
60
- // The status of the check-in.
65
+ /** The status of the check-in. */
61
66
status : 'in_progress' ;
62
67
}
63
68
64
69
export interface FinishedCheckIn {
65
- // The distinct slug of the monitor.
70
+ /** The distinct slug of the monitor. */
66
71
monitorSlug : SerializedCheckIn [ 'monitor_slug' ] ;
67
- // The status of the check-in.
72
+ /** The status of the check-in. */
68
73
status : 'ok' | 'error' ;
69
- // Check-In ID (unique and client generated).
74
+ /** Check-In ID (unique and client generated). */
70
75
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. */
72
77
duration ?: SerializedCheckIn [ 'duration' ] ;
73
78
}
74
79
@@ -77,18 +82,27 @@ export type CheckIn = HeartbeatCheckIn | InProgressCheckIn | FinishedCheckIn;
77
82
type SerializedMonitorConfig = NonNullable < SerializedCheckIn [ 'monitor_config' ] > ;
78
83
79
84
export interface MonitorConfig {
85
+ /**
86
+ * The schedule on which the monitor should run. Either a crontab schedule string or an interval.
87
+ */
80
88
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
+ */
83
93
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
+ */
86
98
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
+ */
89
103
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. */
91
105
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. */
93
107
recoveryThreshold ?: SerializedMonitorConfig [ 'recovery_threshold' ] ;
94
108
}
0 commit comments