Skip to content

Commit c5fc834

Browse files
authored
Add documentation on how to check-in to an environment with CheckInUtils (#11826)
1 parent 39be89f commit c5fc834

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

platform-includes/crons/setup/java.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,29 @@ CheckInUtils.withCheckIn("<monitor-slug>", monitorConfig) {
5454
}
5555
```
5656

57+
You can also check-in to a specific environment.
58+
59+
```java
60+
import io.sentry.MonitorSchedule;
61+
import io.sentry.MonitorScheduleUnit;
62+
import io.sentry.util.CheckInUtils;
63+
64+
String result = CheckInUtils.withCheckIn("<monitor-slug>", "<environment-name>", () -> {
65+
// Execute your scheduled task here...
66+
return "computed result";
67+
});
68+
```
69+
70+
```kotlin
71+
import io.sentry.MonitorSchedule
72+
import io.sentry.MonitorScheduleUnit
73+
import io.sentry.util.CheckInUtils
74+
75+
CheckInUtils.withCheckIn("<monitor-slug>", "<environment-name>") {
76+
// Execute your scheduled task here...
77+
}
78+
```
79+
5780
### Manually sending check-ins
5881

5982
It is also possible to manually send check-ins.

0 commit comments

Comments
 (0)