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/ruby.mdx
+19-1Lines changed: 19 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,20 @@
1
1
## Job Monitoring
2
2
3
-
Standard job frameworks such as `ActiveJob` and `Sidekiq` with a `perform` method can use the `Sentry::Cron::MonitorCheckIns` mixin module to automatically capture check-ins.
3
+
If you're using `sidekiq-cron` or `sidekiq-scheduler`, Sentry can automatically
4
+
capture check-ins for all jobs that are scheduled to run periodically. To
5
+
achieve this, you need to enable the corresponding Sentry plugin:
6
+
7
+
```rb
8
+
Sentry.init do |config|
9
+
config.enabled_patches += [:sidekiq_cron]
10
+
# or, for sidekiq-scheduler:
11
+
config.enabled_patches += [:sidekiq_scheduler]
12
+
end
13
+
```
14
+
15
+
More generally, popular job frameworks such as `ActiveJob` and `Sidekiq` with
16
+
a `perform` method can use the `Sentry::Cron::MonitorCheckIns` mixin module
17
+
to automatically capture check-ins.
4
18
5
19
```rb {tabTitle: ActiveJob}
6
20
classExampleJob < ApplicationJob
@@ -34,6 +48,7 @@ You can pass in optional attributes to `sentry_monitor_check_ins` as follows.
34
48
sentry_monitor_check_ins slug:'custom_slug'
35
49
36
50
# define the monitor config with an interval
51
+
# the units supported are :year, :month, :week, :day, :hour, :minute
If you're using `Clockwork` or `Whenever`, you'll need to instrument your jobs
61
+
manually.
62
+
45
63
### Check-Ins (Recommended)
46
64
47
65
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).
0 commit comments