Skip to content

Commit 6266de9

Browse files
author
David Wang
authored
ref(crons): Use latest keyword in cron instrumentation examples (#6444)
* ref(crons): Use latest keyword in cron instrumentation examples * remove unused variable * dont mention saving the check in id
1 parent 6d527d8 commit 6266de9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,17 @@ org_slug = '___ORG_SLUG___' # Write your organization slug here
5757

5858
# Create the check-in
5959
json_data = {'status': 'in_progress'}
60-
response = requests.post(f'https://sentry.io/api/0/organizations/{org_slug}/monitors/{monitor_id}/checkins/', headers=headers, json=json_data)
61-
checkin_id = response.json()['id']
60+
requests.post(f'https://sentry.io/api/0/organizations/{org_slug}/monitors/{monitor_id}/checkins/', headers=headers, json=json_data)
6261

6362
# Execute your scheduled task code here...
6463

6564
# Update the check-in status (required) and duration (optional)
6665
json_data = {'status': 'ok', 'duration': 3000}
67-
response = requests.put(f'https://sentry.io/api/0/organizations/{org_slug}/monitors/{monitor_id}/checkins/{checkin_id}/', headers=headers, json=json_data)
66+
requests.put(f'https://sentry.io/api/0/organizations/{org_slug}/monitors/{monitor_id}/checkins/latest/', headers=headers, json=json_data)
6867
```
6968

7069
```bash {tabTitle: curl}
71-
# Create the check-in and save the returned CHECKIN_ID
70+
# Create the check-in
7271
$ curl -X POST \
7372
'https://sentry.io/api/0/organizations/___ORG_SLUG___/monitors/{MONITOR_ID}/checkins/' \
7473
--header 'Authorization: DSN ___PUBLIC_DSN___' \
@@ -79,7 +78,7 @@ $ curl -X POST \
7978

8079
# Update the check-in status (required) and duration (optional)
8180
$ curl -X PUT \
82-
'https://sentry.io/api/0/organizations/___ORG_SLUG___/monitors/{MONITOR_ID}/checkins/{CHECKIN_ID}/' \
81+
'https://sentry.io/api/0/organizations/___ORG_SLUG___/monitors/{MONITOR_ID}/checkins/latest/' \
8382
--header 'Authorization: DSN ___PUBLIC_DSN___' \
8483
--header 'Content-Type: application/json' \
8584
--data-raw '{"status": "ok", "duration": 3000}'

0 commit comments

Comments
 (0)