Skip to content

Commit 3d1f4dd

Browse files
chore(crons): Improve visual spacing of docs (#6075)
1 parent ca09df1 commit 3d1f4dd

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/docs/product/crons/getting-started.mdx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,42 @@ sidebar_order: 0
88
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:
99

1010
1. Select **“Crons”** from the sidebar.
11+
1112
2. Click the **"Set Up Cron Monitor"** button.
12-
![Set Up Cron Monitor](cron-setup.png)
13+
![Set Up Cron Monitor](cron-setup.png)
14+
1315
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+
1417
4. Name your job. For example, "Generate Daily Invoices".
18+
1519
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+
1621
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-
![Example of an every hour Crontab](cron-setup-crontab-example-1.png)
19-
Example of a Crontab for every hour.
20-
![Example of an every hour Crontab](cron-setup-crontab-example-2.png)
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+
![Example of an every hour Crontab](cron-setup-crontab-example-1.png)
25+
Example of a Crontab for every hour.
26+
![Example of an every hour Crontab](cron-setup-crontab-example-2.png)
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+
2330
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.
2531

32+
8. Click on **"Next Steps"** at the bottom of the page to configure your health checks.
2633

2734
## Step 2: Set Up Health Checks
2835

2936
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.
3037

3138
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:
3239

33-
3440
```bash {tabTitle: CLI}
3541
# sentry-cli monitors run <monitor_id> -- <command> <args>
3642

3743
# Example for a Python job:
3844
sentry-cli monitors run 63261d96-2027-472a-a8bb-9895dbebd793 -- python path/to/file.py
3945
```
46+
4047
```python
4148
import requests
4249

@@ -54,6 +61,7 @@ check_in_id = response.json()['id']
5461
json_data = {'status': 'ok', 'duration': 3000}
5562
response = requests.put(f'https://sentry.io/api/0/monitors/{monitor_id}/checkins/{check_in_id}/', headers=headers, json=json_data)
5663
```
64+
5765
```bash {tabTitle: curl}
5866
# Create the check-in and save the returned CHECK_IN_ID
5967
$ curl -X POST \
@@ -73,6 +81,7 @@ $ curl -X PUT \
7381
```
7482

7583
### Request Parameters
84+
7685
`monitor_id`:
7786

7887
: **Required.** Your monitor ID can be found on the monitor details page.

0 commit comments

Comments
 (0)