Skip to content

Commit 054ea35

Browse files
antonpirkerlizokmszokeasaurusrex
authored
Apply suggestions from code review
Co-authored-by: Liza Mock <[email protected]> Co-authored-by: Daniel Szoke <[email protected]>
1 parent 785bdbb commit 054ea35

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

docs/platforms/python/integrations/celery/crons.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Sentry Crons allows you to monitor the uptime and performance of any scheduled,
1010
Use the Celery integration to monitor your [Celery periodic tasks](https://docs.celeryq.dev/en/stable/userguide/periodic-tasks.html) and get notified when a task is missed (or doesn't start when expected), if it fails due to a problem in the runtime (such as an error), or if it fails by exceeding its maximum runtime.
1111

1212
<Note>
13-
Please note that monitors will only be created on the task's first run.
13+
Please note that a cron monitor will only be created the first time your task runs.
1414
</Note>
1515

16-
First, set up your Celery beat schedule:
16+
Get started by setting up your Celery beat schedule:
1717

1818
```python {filename:tasks.py}
1919
# tasks.py
@@ -31,11 +31,11 @@ app.conf.beat_schedule = {
3131
```
3232

3333
<Note>
34-
Please note that only crontab parseable schedules will be successfully
35-
upserted.
34+
Please note that only schedules that can be parsed by crontab will be successfully
35+
updated or inserted.
3636
</Note>
3737

38-
Next, we need to initialize Sentry. Where to do this depends on how you run beat:
38+
Next, initialize Sentry. Where to do this depends on how you run beat:
3939

4040
- If beat is running in your worker process (that is, you're running your worker with the `-B`/`--beat` option), initialize Sentry in either the `celeryd_init` or `beat_init` signal.
4141
- If beat is running in a separate process, you need to initialize Sentry in _both_ the `celeryd_init` and `beat_init` signal.

docs/platforms/python/integrations/celery/index.mdx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@ pip install --upgrade 'sentry-sdk[celery]'
1717

1818
If you have the `celery` package in your dependencies, the Celery integration will be enabled automatically when you initialize the Sentry SDK.
1919

20-
Make sure that the **call to `sentry_sdk.init()` is loaded on worker startup**, and not only in the module where your tasks are defined. Otherwise, the initialization happens too late and events might end up not being reported.
20+
<Alert>
21+
Make sure that the call to `sentry_sdk.init()` is loaded on worker startup and not only in the module where your tasks are defined. Otherwise, the initialization may happen too late and events might not get reported.
22+
</Alert>
2123

22-
### Setup Celery (Without Django)
24+
### Set Up Celery Without Django
2325

24-
To get the most out of Sentry make sure to initialize the Sentry SDK in your Celery worker processes as well as your application that is sending messages to Celery.
26+
When using Celery without Django, you'll need to initialize the Sentry SDK in both your application and the Celery worker process.
2527

2628
In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](/product/explore/profiling/).
2729

2830
Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below.
2931

30-
#### Setup in Celery
32+
#### Set Up Celery
3133

3234
<OnboardingOptionButtons
3335
options={["error-monitoring", "performance", "profiling"]}
@@ -60,7 +62,7 @@ def add(x, y):
6062
return x + y
6163
```
6264

63-
The [`celeryd_init`](https://docs.celeryq.dev/en/stable/userguide/signals.html?#celeryd-init) signal is triggered when the Celery deamon is started, before the worker processes are spawned. You can use the [`worker_init`](https://docs.celeryq.dev/en/stable/userguide/signals.html?#worker-init) signal instead if you want to initialize Sentry on start of each worker process.
65+
The [`celeryd_init`](https://docs.celeryq.dev/en/stable/userguide/signals.html?#celeryd-init) signal is triggered when the Celery deamon starts, before the worker processes are spawned. If you need to initialize Sentry for each individual worker process, us the [`worker_init`](https://docs.celeryq.dev/en/stable/userguide/signals.html?#worker-init) signal instead.
6466

6567
#### Setup in Your Application
6668

@@ -93,13 +95,13 @@ if __name__ == "__main__":
9395
main()
9496
```
9597

96-
### Setup Celery With Django
98+
### Set Up Celery With Django
9799

98-
If you're using Celery with Django in a conventional setup, have already initialized the SDK in your `settings.py` file as described in the [Django integration documentation](/platforms/python/integrations/django/#configure), and have Celery using the same settings with [`config_from_object`](https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html), you don't need to initialize the SDK separately for Celery.
100+
If you're using Celery with Django in a typical setup, have initialized the SDK in your `settings.py` file (as described in the [Django integration documentation](/platforms/python/integrations/django/#configure)), and have your Celery configured to use the same settings as [`config_from_object`](https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html), there's no need to initialize the Celery SDK separately.
99101

100102
## Verify
101103

102-
To verify if your SDK is initialized on worker start, you can pass `debug=True` to `sentry_sdk.init()` to see extra output in your Celery logs when the SDK is initialized. If the output appears during worker startup and not only after a task has started, then it's working properly.
104+
To confirm that your SDK is initialized on worker start, pass `debug=True` to `sentry_sdk.init()`. This will add extra output to your Celery logs when the SDK is initialized. If you see the output during worker startup, and not just after a task has started, then it's working correctly.
103105

104106
<Alert level="info" title="Note on distributed tracing">
105107

0 commit comments

Comments
 (0)