Skip to content

Commit ea19248

Browse files
authored
Merge branch 'master' into szokeasaurusrex/transaction-not-started-warning
2 parents 314ef01 + ac4d657 commit ea19248

36 files changed

+553
-243
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
timeout-minutes: 10
2525

2626
steps:
27-
- uses: actions/checkout@v4.1.4
27+
- uses: actions/checkout@v4.1.5
2828
- uses: actions/setup-python@v5
2929
with:
3030
python-version: 3.12
@@ -39,7 +39,7 @@ jobs:
3939
timeout-minutes: 10
4040

4141
steps:
42-
- uses: actions/checkout@v4.1.4
42+
- uses: actions/checkout@v4.1.5
4343
- uses: actions/setup-python@v5
4444
with:
4545
python-version: 3.12
@@ -54,7 +54,7 @@ jobs:
5454
timeout-minutes: 10
5555

5656
steps:
57-
- uses: actions/checkout@v4.1.4
57+
- uses: actions/checkout@v4.1.5
5858
- uses: actions/setup-python@v5
5959
with:
6060
python-version: 3.12
@@ -82,7 +82,7 @@ jobs:
8282
timeout-minutes: 10
8383

8484
steps:
85-
- uses: actions/checkout@v4.1.4
85+
- uses: actions/checkout@v4.1.5
8686
- uses: actions/setup-python@v5
8787
with:
8888
python-version: 3.12

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
steps:
4848
- name: Checkout repository
49-
uses: actions/checkout@v4.1.4
49+
uses: actions/checkout@v4.1.5
5050

5151
# Initializes the CodeQL tools for scanning.
5252
- name: Initialize CodeQL

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
name: "Release a new version"
2020
steps:
21-
- uses: actions/checkout@v4.1.4
21+
- uses: actions/checkout@v4.1.5
2222
with:
2323
token: ${{ secrets.GH_RELEASE_PAT }}
2424
fetch-depth: 0

.github/workflows/test-integrations-aws-lambda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
os: [ubuntu-20.04]
6666
needs: check-permissions
6767
steps:
68-
- uses: actions/checkout@v4.1.4
68+
- uses: actions/checkout@v4.1.5
6969
with:
7070
ref: ${{ github.event.pull_request.head.sha || github.ref }}
7171
- uses: actions/setup-python@v5

.github/workflows/test-integrations-cloud-computing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3333
os: [ubuntu-20.04]
3434
steps:
35-
- uses: actions/checkout@v4.1.4
35+
- uses: actions/checkout@v4.1.5
3636
- uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ matrix.python-version }}
@@ -80,7 +80,7 @@ jobs:
8080
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
8181
os: [ubuntu-20.04]
8282
steps:
83-
- uses: actions/checkout@v4.1.4
83+
- uses: actions/checkout@v4.1.5
8484
- uses: actions/setup-python@v5
8585
with:
8686
python-version: ${{ matrix.python-version }}

.github/workflows/test-integrations-common.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3333
os: [ubuntu-20.04]
3434
steps:
35-
- uses: actions/checkout@v4.1.4
35+
- uses: actions/checkout@v4.1.5
3636
- uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ matrix.python-version }}

.github/workflows/test-integrations-data-processing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3333
os: [ubuntu-20.04]
3434
steps:
35-
- uses: actions/checkout@v4.1.4
35+
- uses: actions/checkout@v4.1.5
3636
- uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ matrix.python-version }}
@@ -104,7 +104,7 @@ jobs:
104104
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
105105
os: [ubuntu-20.04]
106106
steps:
107-
- uses: actions/checkout@v4.1.4
107+
- uses: actions/checkout@v4.1.5
108108
- uses: actions/setup-python@v5
109109
with:
110110
python-version: ${{ matrix.python-version }}

.github/workflows/test-integrations-databases.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
5151
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
5252
steps:
53-
- uses: actions/checkout@v4.1.4
53+
- uses: actions/checkout@v4.1.5
5454
- uses: actions/setup-python@v5
5555
with:
5656
python-version: ${{ matrix.python-version }}
@@ -125,7 +125,7 @@ jobs:
125125
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
126126
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
127127
steps:
128-
- uses: actions/checkout@v4.1.4
128+
- uses: actions/checkout@v4.1.5
129129
- uses: actions/setup-python@v5
130130
with:
131131
python-version: ${{ matrix.python-version }}

.github/workflows/test-integrations-graphql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3333
os: [ubuntu-20.04]
3434
steps:
35-
- uses: actions/checkout@v4.1.4
35+
- uses: actions/checkout@v4.1.5
3636
- uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ matrix.python-version }}
@@ -80,7 +80,7 @@ jobs:
8080
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
8181
os: [ubuntu-20.04]
8282
steps:
83-
- uses: actions/checkout@v4.1.4
83+
- uses: actions/checkout@v4.1.5
8484
- uses: actions/setup-python@v5
8585
with:
8686
python-version: ${{ matrix.python-version }}

.github/workflows/test-integrations-miscellaneous.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3333
os: [ubuntu-20.04]
3434
steps:
35-
- uses: actions/checkout@v4.1.4
35+
- uses: actions/checkout@v4.1.5
3636
- uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ matrix.python-version }}
@@ -80,7 +80,7 @@ jobs:
8080
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
8181
os: [ubuntu-20.04]
8282
steps:
83-
- uses: actions/checkout@v4.1.4
83+
- uses: actions/checkout@v4.1.5
8484
- uses: actions/setup-python@v5
8585
with:
8686
python-version: ${{ matrix.python-version }}

.github/workflows/test-integrations-networking.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3333
os: [ubuntu-20.04]
3434
steps:
35-
- uses: actions/checkout@v4.1.4
35+
- uses: actions/checkout@v4.1.5
3636
- uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ matrix.python-version }}
@@ -80,7 +80,7 @@ jobs:
8080
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
8181
os: [ubuntu-20.04]
8282
steps:
83-
- uses: actions/checkout@v4.1.4
83+
- uses: actions/checkout@v4.1.5
8484
- uses: actions/setup-python@v5
8585
with:
8686
python-version: ${{ matrix.python-version }}

.github/workflows/test-integrations-web-frameworks-1.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
5151
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
5252
steps:
53-
- uses: actions/checkout@v4.1.4
53+
- uses: actions/checkout@v4.1.5
5454
- uses: actions/setup-python@v5
5555
with:
5656
python-version: ${{ matrix.python-version }}
@@ -116,7 +116,7 @@ jobs:
116116
SENTRY_PYTHON_TEST_POSTGRES_USER: postgres
117117
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry
118118
steps:
119-
- uses: actions/checkout@v4.1.4
119+
- uses: actions/checkout@v4.1.5
120120
- uses: actions/setup-python@v5
121121
with:
122122
python-version: ${{ matrix.python-version }}

.github/workflows/test-integrations-web-frameworks-2.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3333
os: [ubuntu-20.04]
3434
steps:
35-
- uses: actions/checkout@v4.1.4
35+
- uses: actions/checkout@v4.1.5
3636
- uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ matrix.python-version }}
@@ -100,7 +100,7 @@ jobs:
100100
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
101101
os: [ubuntu-20.04]
102102
steps:
103-
- uses: actions/checkout@v4.1.4
103+
- uses: actions/checkout@v4.1.5
104104
- uses: actions/setup-python@v5
105105
with:
106106
python-version: ${{ matrix.python-version }}

CHANGELOG.md

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

3+
## 2.4.0
4+
5+
### Various fixes & improvements
6+
7+
- Celery: Made `cache.key` span data field a list (#3110) by @antonpirker
8+
- Celery Beat: Refactor the Celery Beat integration (#3105) by @antonpirker
9+
- GRPC: Add None check for grpc.aio interceptor (#3109) by @ordinary-jamie
10+
- Docs: Remove `last_event_id` from migration guide (#3126) by @szokeasaurusrex
11+
- fix(django): Proper transaction names for i18n routes (#3104) by @sentrivana
12+
- fix(scope): Copy `_last_event_id` in `Scope.__copy__` (#3123) by @szokeasaurusrex
13+
- fix(tests): Adapt to new Anthropic version (#3119) by @sentrivana
14+
- build(deps): bump checkouts/data-schemas from `4381a97` to `59f9683` (#3066) by @dependabot
15+
316
## 2.3.1
417

518
### Various fixes & improvements

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ This project follows [semver](https://semver.org/), with three additions:
163163

164164
- Certain features (e.g. integrations) may be explicitly called out as "experimental" or "unstable" in the documentation. They come with their own versioning policy described in the documentation.
165165

166-
We recommend to pin your version requirements against `1.x.*` or `1.x.y`.
166+
We recommend to pin your version requirements against `2.x.*` or `2.x.y`.
167167
Either one of the following is fine:
168168

169169
```
170-
sentry-sdk>=1.0.0,<2.0.0
171-
sentry-sdk==1.5.0
170+
sentry-sdk>=2.0.0,<3.0.0
171+
sentry-sdk==2.4.0
172172
```
173173

174174
A major release `N` implies the previous release `N-1` will no longer receive updates. We generally do not backport bugfixes to older versions unless they are security relevant. However, feel free to ask for backports of specific commits on the bugtracker.

MIGRATION_GUIDE.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,25 +24,28 @@ Looking to upgrade from Sentry SDK 1.x to 2.x? Here's a comprehensive list of wh
2424
- `sentry_sdk.utils.is_sentry_url()` now takes a `Client` instead of a `Hub` as first parameter.
2525
- `sentry_sdk.utils._get_contextvars` does not return a tuple with three values, but a tuple with two values. The `copy_context` was removed.
2626
- You no longer have to use `configure_scope` to mutate a transaction. Instead, you simply get the current scope to mutate the transaction. Here is a recipe on how to change your code to make it work:
27-
Your existing implementation:
28-
```python
29-
transaction = sentry_sdk.transaction(...)
27+
Your existing implementation:
3028

31-
# later in the code execution:
29+
```python
30+
transaction = sentry_sdk.transaction(...)
31+
32+
# later in the code execution:
3233

33-
with sentry_sdk.configure_scope() as scope:
34-
scope.set_transaction_name("new-transaction-name")
35-
```
34+
with sentry_sdk.configure_scope() as scope:
35+
scope.set_transaction_name("new-transaction-name")
36+
```
3637

37-
needs to be changed to this:
38-
```python
39-
transaction = sentry_sdk.transaction(...)
38+
needs to be changed to this:
4039

41-
# later in the code execution:
40+
```python
41+
transaction = sentry_sdk.transaction(...)
42+
43+
# later in the code execution:
44+
45+
scope = sentry_sdk.Scope.get_current_scope()
46+
scope.set_transaction_name("new-transaction-name")
47+
```
4248

43-
scope = sentry_sdk.Scope.get_current_scope()
44-
scope.set_transaction_name("new-transaction-name")
45-
```
4649
- The classes listed in the table below are now abstract base classes. Therefore, they can no longer be instantiated. Subclasses can only be instantiated if they implement all of the abstract methods.
4750
<details>
4851
<summary><b>Show table</b></summary>
@@ -64,7 +67,6 @@ Looking to upgrade from Sentry SDK 1.x to 2.x? Here's a comprehensive list of wh
6467
- Removed support for Flask 0.\*.
6568
- Removed support for gRPC < 1.39.
6669
- Removed support for Tornado < 6.
67-
- Removed `last_event_id()` top level API. The last event ID is still returned by `capture_event()`, `capture_exception()` and `capture_message()` but the top level API `sentry_sdk.last_event_id()` has been removed.
6870
- Removed support for sending events to the `/store` endpoint. Everything is now sent to the `/envelope` endpoint. If you're on SaaS you don't have to worry about this, but if you're running Sentry yourself you'll need version `20.6.0` or higher of self-hosted Sentry.
6971
- The deprecated `with_locals` configuration option was removed. Use `include_local_variables` instead. See https://docs.sentry.io/platforms/python/configuration/options/#include-local-variables.
7072
- The deprecated `request_bodies` configuration option was removed. Use `max_request_body_size`. See https://docs.sentry.io/platforms/python/configuration/options/#max-request-body-size.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
copyright = "2019-{}, Sentry Team and Contributors".format(datetime.now().year)
2929
author = "Sentry Team and Contributors"
3030

31-
release = "2.3.1"
31+
release = "2.4.0"
3232
version = ".".join(release.split(".")[:2]) # The short X.Y version.
3333

3434

scripts/split-tox-gh-actions/templates/test_group.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
{% endif %}
4040

4141
steps:
42-
- uses: actions/checkout@v4.1.4
42+
- uses: actions/checkout@v4.1.5
4343
{% if needs_github_secrets %}
4444
{% raw %}
4545
with:

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,4 +508,4 @@ def _get_default_options():
508508
del _get_default_options
509509

510510

511-
VERSION = "2.3.1"
511+
VERSION = "2.4.0"

sentry_sdk/integrations/celery/__init__.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@ def __init__(
7070
self.monitor_beat_tasks = monitor_beat_tasks
7171
self.exclude_beat_tasks = exclude_beat_tasks
7272

73-
if monitor_beat_tasks:
74-
_patch_beat_apply_entry()
75-
_patch_redbeat_maybe_due()
76-
_setup_celery_beat_signals()
73+
_patch_beat_apply_entry()
74+
_patch_redbeat_maybe_due()
75+
_setup_celery_beat_signals()
7776

7877
@staticmethod
7978
def setup_once():
@@ -167,11 +166,11 @@ def _update_celery_task_headers(original_headers, span, monitor_beat_tasks):
167166
"""
168167
updated_headers = original_headers.copy()
169168
with capture_internal_exceptions():
170-
headers = {}
171-
if span is not None:
172-
headers = dict(
173-
Scope.get_current_scope().iter_trace_propagation_headers(span=span)
174-
)
169+
# if span is None (when the task was started by Celery Beat)
170+
# this will return the trace headers from the scope.
171+
headers = dict(
172+
Scope.get_isolation_scope().iter_trace_propagation_headers(span=span)
173+
)
175174

176175
if monitor_beat_tasks:
177176
headers.update(

0 commit comments

Comments
 (0)