Skip to content

Commit 5e7627c

Browse files
author
getsentry-bot
committed
Merge branch 'release/1.17.0'
2 parents f7b0684 + d65cc68 commit 5e7627c

File tree

4 files changed

+92
-3
lines changed

4 files changed

+92
-3
lines changed

CHANGELOG.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,94 @@
11
# Changelog
22

3+
## 1.17.0
4+
5+
### Various fixes & improvements
6+
7+
- **New:** Monitor Celery Beat tasks with Sentry [Cron Monitoring](https://docs.sentry.io/product/crons/).
8+
9+
With this feature you can make sure that your Celery beat tasks run at the right time and see if they where successful or not.
10+
11+
> **Warning**
12+
> Cron Monitoring is currently in beta. Beta features are still in-progress and may have bugs. We recognize the irony.
13+
> If you have any questions or feedback, please email us at [email protected], reach out via Discord (#cronjobs), or open an issue.
14+
15+
Usage:
16+
17+
```python
18+
# File: tasks.py
19+
20+
from celery import Celery, signals
21+
from celery.schedules import crontab
22+
23+
import sentry_sdk
24+
from sentry_sdk.crons import monitor
25+
from sentry_sdk.integrations.celery import CeleryIntegration
26+
27+
28+
# 1. Setup your Celery beat configuration
29+
30+
app = Celery('mytasks', broker='redis://localhost:6379/0')
31+
app.conf.beat_schedule = {
32+
'set-in-beat-schedule': {
33+
'task': 'tasks.tell_the_world',
34+
'schedule': crontab(hour='10', minute='15'),
35+
'args': ("in beat_schedule set", ),
36+
},
37+
}
38+
39+
40+
# 2. Initialize Sentry either in `celeryd_init` or `beat_init` signal.
41+
42+
#@signals.celeryd_init.connect
43+
@signals.beat_init.connect
44+
def init_sentry(**kwargs):
45+
sentry_sdk.init(
46+
dsn='...',
47+
integrations=[CeleryIntegration()],
48+
environment="local.dev.grace",
49+
release="v1.0.7-a1",
50+
)
51+
52+
53+
# 3. Link your Celery task to a Sentry Cron Monitor
54+
55+
@app.task
56+
@monitor(monitor_slug='3b861d62-ff82-4aa0-9cd6-b2b6403bd0cf')
57+
def tell_the_world(msg):
58+
print(msg)
59+
```
60+
61+
- **New:** Add decorator for Sentry tracing (#1089) by @ynouri
62+
63+
This allows you to use a decorator to setup custom performance instrumentation.
64+
65+
To learn more see [Custom Instrumentation](https://docs.sentry.io/platforms/python/performance/instrumentation/custom-instrumentation/).
66+
67+
Usage: Just add the new decorator to your function, and a span will be created for it:
68+
69+
```python
70+
import sentry_sdk
71+
72+
@sentry_sdk.trace
73+
def my_complex_function():
74+
# do stuff
75+
...
76+
```
77+
78+
- Make Django signals tracing optional (#1929) by @antonpirker
79+
80+
See the [Django Guide](https://docs.sentry.io/platforms/python/guides/django) to learn more.
81+
82+
- Deprecated `with_locals` in favor of `include_local_variables` (#1924) by @antonpirker
83+
- Added top level API to get current span (#1954) by @antonpirker
84+
- Profiling: Add profiler options to init (#1947) by @Zylphrex
85+
- Profiling: Set active thread id for quart (#1830) by @Zylphrex
86+
- Fix: Update `get_json` function call for werkzeug 2.1.0+ (#1939) by @michielderoos
87+
- Fix: Returning the tasks result. (#1931) by @antonpirker
88+
- Fix: Rename MYPY to TYPE_CHECKING (#1934) by @untitaker
89+
- Fix: Fix type annotation for ignore_errors in sentry_sdk.init() (#1928) by @tiangolo
90+
- Tests: Start a real http server instead of mocking libs (#1938) by @antonpirker
91+
392
## 1.16.0
493

594
### Various fixes & improvements

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
copyright = "2019, Sentry Team and Contributors"
3030
author = "Sentry Team and Contributors"
3131

32-
release = "1.16.0"
32+
release = "1.17.0"
3333
version = ".".join(release.split(".")[:2]) # The short X.Y version.
3434

3535

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,4 @@ def _get_default_options():
156156
del _get_default_options
157157

158158

159-
VERSION = "1.16.0"
159+
VERSION = "1.17.0"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_file_text(file_name):
2121

2222
setup(
2323
name="sentry-sdk",
24-
version="1.16.0",
24+
version="1.17.0",
2525
author="Sentry Team and Contributors",
2626
author_email="[email protected]",
2727
url="https://github.com/getsentry/sentry-python",

0 commit comments

Comments
 (0)