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/docs/product/crons/getting-started.mdx
+18-9Lines changed: 18 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -8,35 +8,42 @@ sidebar_order: 0
8
8
Sentry Cron Monitoring allows you to monitor any job running on a scheduled interval. To get started, create a new cron monitoring service for one of your projects:
9
9
10
10
1. Select **“Crons”** from the sidebar.
11
+
11
12
2. Click the **"Set Up Cron Monitor"** button.
12
-

13
+

14
+
13
15
3. In the details section, select the project to which you'd like your Cron Monitor to be attached. That's where you'll see any job execution issues.
16
+
14
17
4. Name your job. For example, "Generate Daily Invoices".
18
+
15
19
5. In the configuration section, enter the maximum number of minutes allowed for a job to run before it's considered failed. For example, if you enter 30, any job running for more than 30 minutes will be considered failed and a new issue will be generated.
20
+
16
21
6. Select whether you'd like to schedule job monitors using Crontab syntax or time intervals:
17
-
-**Crontab:** A Crontab schedule uses Crontab syntax. This works well if your job runs on a very rigorous schedule. Crontab syntax lets you verify if your job has run every day, every hour, or even in smaller increments. *Learn more about the [Crontab syntax](https://en.wikipedia.org/wiki/Cron).* Crontab examples:
18
-

19
-
Example of a Crontab for every hour.
20
-

21
-
Example of a Crontab for every month on the 1st and 15th day.
22
-
-**Interval:** If getting granular with scheduling is less important, the Interval schedule type may be better suited for your needs. It allows you to schedule your job to run every X years, hours, minutes, or anything in-between.
22
+
23
+
-**Crontab:** A Crontab schedule uses Crontab syntax. This works well if your job runs on a very rigorous schedule. Crontab syntax lets you verify if your job has run every day, every hour, or even in smaller increments. _Learn more about the [Crontab syntax](https://en.wikipedia.org/wiki/Cron)._ Crontab examples:
24
+

25
+
Example of a Crontab for every hour.
26
+

27
+
Example of a Crontab for every month on the 1st and 15th day.
28
+
-**Interval:** If getting granular with scheduling is less important, the Interval schedule type may be better suited for your needs. It allows you to schedule your job to run every X years, hours, minutes, or anything in-between.
29
+
23
30
7. Enter the acceptable number of minutes an expected check-in can be late by before it's considered failed, based on the schedule above. For example, if your monitor is configured as a Crontab of `0 * * * *` (every hour at minute 0) and the check-in margin is defined as 10 minutes, your job won't be considered failed as long as it checks in by hour X, minute 10.
24
-
8. Click on **"Next Steps"** at the bottom of the page to configure your health checks.
25
31
32
+
8. Click on **"Next Steps"** at the bottom of the page to configure your health checks.
26
33
27
34
## Step 2: Set Up Health Checks
28
35
29
36
Sentry monitors your job status via regular health checks emitted by your application. A health check consists of two (2) HTTP "check-in" requests: an initial request emitted before the start of your job execution to create a check-in, and a final update request emitted after your job completes, to update the status of your check-in.
30
37
31
38
Creating these health checks can be done automatically, using Sentry's CLI, or manually via HTTP. To get started, [install](/product/cli/installation) and [configure](/product/cli/configuration) your CLI, or simply use the example below to construct an HTTP request in your favorite language:
32
39
33
-
34
40
```bash {tabTitle: CLI}
35
41
# sentry-cli monitors run <monitor_id> -- <command> <args>
36
42
37
43
# Example for a Python job:
38
44
sentry-cli monitors run 63261d96-2027-472a-a8bb-9895dbebd793 -- python path/to/file.py
0 commit comments