You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/platform-includes/crons/setup/java.mdx
+54Lines changed: 54 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,60 @@ If you are using [Quartz](http://www.quartz-scheduler.org/), please see <Platfor
4
4
5
5
Check-in monitoring allows you to track a job's progress by completing two check-ins: one at the start of your job and another at the end of your job. This two-step process allows Sentry to notify you if your job didn't start when expected (missed) or if it exceeded its maximum runtime (failed).
6
6
7
+
### Wrapper
8
+
9
+
The Sentry Java SDK offers a helper that takes care of wrapping your code and sending a check-in at the start and one at the end. It checks for exceptions and sets the status of the check-in accordingly.
10
+
11
+
```java
12
+
importio.sentry.util.CheckInUtils;
13
+
14
+
String result =CheckInUtils.withCheckIn("<monitor-slug>", () -> {
15
+
// Execute your scheduled task here...
16
+
return"computed result";
17
+
});
18
+
```
19
+
20
+
```kotlin
21
+
importio.sentry.util.CheckInUtils
22
+
23
+
CheckInUtils.withCheckIn("<monitor-slug>") {
24
+
// Execute your scheduled task here...
25
+
}
26
+
```
27
+
28
+
You may also send a `MonitorConfig` with a `MontiorSchedule` so the monitor is created or updated (upsert) automatically.
0 commit comments