Skip to content

Commit 4b0d09b

Browse files
committed
Merge branch 'srothh/async-transport' into srothh/async-transport-integration
2 parents e8d889c + fca8740 commit 4b0d09b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+371
-262
lines changed

CHANGELOG.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 3.0.0a2
3+
## 3.0.0a3
44

55
We're excited to announce that version 3.0 of the Sentry Python SDK is now
66
available. This release is the result of a long-term effort to use OpenTelemetry
@@ -20,25 +20,23 @@ for your feedback. How was the migration? Is everything working as expected? Is
2020
[on GitHub](https://github.com/getsentry/sentry-python/discussions/3936) or
2121
[on Discord](https://discord.com/invite/Ww9hbqr).
2222

23-
## 3.0.0a1
23+
## 2.33.2
2424

25-
We're excited to announce that version 3.0 of the Sentry Python SDK is now
26-
available. This release is the result of a long-term effort to use OpenTelemetry
27-
under the hood for tracing. This switch opens the door for us to leverage the
28-
full power of OpenTelemetry, so stay tuned for more integrations and features
29-
in future releases.
25+
### Various fixes & improvements
3026

31-
Looking to upgrade from Sentry SDK 2.x to 3.x? See the
32-
[full list of changes](MIGRATION_GUIDE.md) for a comprehensive overview
33-
of what's changed. Looking for a more digestible summary? See the
34-
[migration guide in the docs](https://docs.sentry.io/platforms/python/migration/2.x-to-3.x)
35-
with the most common migration patterns.
27+
- ref(spotlight): Do not import `sentry_sdk.spotlight` unless enabled (#4607) by @sentrivana
28+
- ref(gnu-integration): update clickhouse stacktrace parsing (#4598) by @MeredithAnya
3629

37-
⚠️ This is a pre-release. If you feel like taking it for a spin, we'd be grateful
38-
for your feedback. How was the migration? Is everything working as expected? Is
39-
*nothing* working as expected? Something in between? Please let us know
40-
[on GitHub](https://github.com/getsentry/sentry-python/discussions/3936) or
41-
[on Discord](https://discord.com/invite/Ww9hbqr).
30+
## 2.33.1
31+
32+
### Various fixes & improvements
33+
34+
- fix(integrations): allow explicit op parameter in `ai_track` (#4597) by @mshavliuk
35+
- fix: Fix `abs_path` bug in `serialize_frame` (#4599) by @szokeasaurusrex
36+
- Remove pyrsistent from test dependencies (#4588) by @musicinmybrain
37+
- Remove explicit `__del__`'s in threaded classes (#4590) by @sl0thentr0py
38+
- Remove forked from test_transport, separate gevent tests and generalize capturing_server to be module level (#4577) by @sl0thentr0py
39+
- Improve token usage recording (#4566) by @antonpirker
4240

4341
## 2.33.0
4442

docs/conf.py

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

36-
release = "3.0.0a2"
36+
release = "3.0.0a3"
3737
version = ".".join(release.split(".")[:2]) # The short X.Y version.
3838

3939

requirements-testing.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ pytest-forked
66
pytest-localserver
77
pytest-watch
88
jsonschema
9-
pyrsistent
109
executing
1110
asttokens
1211
responses

scripts/populate_tox/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@
158158
"deps": {
159159
"*": ["pytest-asyncio"],
160160
},
161+
"python": ">=3.10",
161162
},
162163
"openfeature": {
163164
"package": "openfeature-sdk",

sentry_sdk/ai/monitoring.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ def ai_track(description: str, **span_kwargs: Any) -> Callable[..., Any]:
2828
def decorator(f: Callable[..., Any]) -> Callable[..., Any]:
2929
def sync_wrapped(*args: Any, **kwargs: Any) -> Any:
3030
curr_pipeline = _ai_pipeline_name.get()
31-
op = span_kwargs.get("op", "ai.run" if curr_pipeline else "ai.pipeline")
31+
op = span_kwargs.pop("op", "ai.run" if curr_pipeline else "ai.pipeline")
3232

3333
with start_span(
34-
name=description, op=op, only_if_parent=True, **span_kwargs
34+
name=description, op=op, only_as_child_span=True, **span_kwargs
3535
) as span:
3636
for k, v in kwargs.pop("sentry_tags", {}).items():
3737
span.set_tag(k, v)
@@ -58,10 +58,10 @@ def sync_wrapped(*args: Any, **kwargs: Any) -> Any:
5858

5959
async def async_wrapped(*args: Any, **kwargs: Any) -> Any:
6060
curr_pipeline = _ai_pipeline_name.get()
61-
op = span_kwargs.get("op", "ai.run" if curr_pipeline else "ai.pipeline")
61+
op = span_kwargs.pop("op", "ai.run" if curr_pipeline else "ai.pipeline")
6262

6363
with start_span(
64-
name=description, op=op, only_if_parent=True, **span_kwargs
64+
name=description, op=op, only_as_child_span=True, **span_kwargs
6565
) as span:
6666
for k, v in kwargs.pop("sentry_tags", {}).items():
6767
span.set_tag(k, v)

sentry_sdk/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
)
4848
from sentry_sdk.scrubber import EventScrubber
4949
from sentry_sdk.monitor import Monitor
50-
from sentry_sdk.spotlight import setup_spotlight
5150

5251
if TYPE_CHECKING:
5352
from typing import (
@@ -359,6 +358,10 @@ def _capture_envelope(envelope: Envelope) -> None:
359358
)
360359

361360
if self.options.get("spotlight"):
361+
# This is intentionally here to prevent setting up spotlight
362+
# stuff we don't need unless spotlight is explicitly enabled
363+
from sentry_sdk.spotlight import setup_spotlight
364+
362365
self.spotlight = setup_spotlight(self.options)
363366
if not self.options["dsn"]:
364367
sample_all = lambda *_args, **_kwargs: 1.0

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,4 +1242,4 @@ def _get_default_options() -> dict[str, Any]:
12421242
del _get_default_options
12431243

12441244

1245-
VERSION = "3.0.0a2"
1245+
VERSION = "3.0.0a3"

sentry_sdk/integrations/aiohttp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ async def on_request_start(
238238
name="%s %s"
239239
% (method, parsed_url.url if parsed_url else SENSITIVE_DATA_SUBSTITUTE),
240240
origin=AioHttpIntegration.origin,
241-
only_if_parent=True,
241+
only_as_child_span=True,
242242
)
243243

244244
data = {

sentry_sdk/integrations/anthropic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def _sentry_patched_create_common(f: Any, *args: Any, **kwargs: Any) -> Any:
161161
op=OP.ANTHROPIC_MESSAGES_CREATE,
162162
description="Anthropic messages create",
163163
origin=AnthropicIntegration.origin,
164-
only_if_parent=True,
164+
only_as_child_span=True,
165165
)
166166
span.__enter__()
167167

sentry_sdk/integrations/arq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ async def _sentry_enqueue_job(
8181
op=OP.QUEUE_SUBMIT_ARQ,
8282
name=function,
8383
origin=ArqIntegration.origin,
84-
only_if_parent=True,
84+
only_as_child_span=True,
8585
):
8686
return await old_enqueue_job(self, function, *args, **kwargs)
8787

0 commit comments

Comments
 (0)