Skip to content

Commit 3c2cc83

Browse files
committed
Merge branch 'master' into ivana/span-first-before-send-span
2 parents 5fa6c96 + 00e617d commit 3c2cc83

304 files changed

Lines changed: 3117 additions & 2434 deletions

File tree

Some content is hidden

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

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ afea4a017bf13f78e82f725ea9d6a56a8e02cb34
33
23a340a9dca60eea36de456def70c00952a33556
44
973dda79311cf6b9cb8f1ba67ca0515dfaf9f49c
55
e275c9e94323b429f39196881fb992d81a2e52ea
6+
015ff31b48d322ddf7270b9391ef2ed16f7a42a3

CHANGELOG.md

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

3+
## 2.60.0
4+
5+
Adds a new `stream_gen_ai_spans` option that controls how `gen_ai` spans are
6+
sent to Sentry. When set, the SDK extracts all `gen_ai` spans out of a
7+
transaction and sends them as v2 envelope items.
8+
9+
Enable this option if `gen_ai` spans are being dropped because the transaction payload exceeds size limits.
10+
11+
```python
12+
import sentry_sdk
13+
14+
sentry_sdk.init(
15+
dsn='https://examplePublicKey@o0.ingest.sentry.io/0',
16+
stream_gen_ai_spans=True,
17+
)
18+
```
19+
20+
### New Features ✨
21+
22+
- (asyncpg) Add cursor span support via BaseCursor method patching by @ericapisani in [#6252](https://github.com/getsentry/sentry-python/pull/6252)
23+
- (integrations) Pass along the conversation ID for openai `responses` calls by @constantinius in [#6199](https://github.com/getsentry/sentry-python/pull/6199)
24+
- (wsgi,asgi) Introduce substitute values for filtered fields in span-streaming mode by @ericapisani in [#6178](https://github.com/getsentry/sentry-python/pull/6178)
25+
- Remove truncation when `stream_gen_ai_spans` is enabled by @alexander-alderman-webb in [#6260](https://github.com/getsentry/sentry-python/pull/6260)
26+
- Add option to send GenAI spans in the new span format by @alexander-alderman-webb in [#6079](https://github.com/getsentry/sentry-python/pull/6079)
27+
28+
### Bug Fixes 🐛
29+
30+
#### Openai
31+
32+
- Guard against `choices=None` by @cla7aye15I4nd in [#6216](https://github.com/getsentry/sentry-python/pull/6216)
33+
- Stop setting transaction status when child span fails by @alexander-alderman-webb in [#6192](https://github.com/getsentry/sentry-python/pull/6192)
34+
- Only finish relevant spans in Responses patches by @alexander-alderman-webb in [#6191](https://github.com/getsentry/sentry-python/pull/6191)
35+
- Only finish relevant spans in Chat Completions patches by @alexander-alderman-webb in [#6190](https://github.com/getsentry/sentry-python/pull/6190)
36+
37+
#### Other
38+
39+
- (stdlib) Instrument response body read for chunked HTTP responses by @sentrivana in [#6202](https://github.com/getsentry/sentry-python/pull/6202)
40+
- (typing) Add `@sentry_sdk.traces.trace` overloads to fix typing by @sentrivana in [#6236](https://github.com/getsentry/sentry-python/pull/6236)
41+
- Use proto version 2 to fix backfilled user agent and IP by @sentrivana in [#6256](https://github.com/getsentry/sentry-python/pull/6256)
42+
- Make sure `http.server` spans are segments by @sentrivana in [#6230](https://github.com/getsentry/sentry-python/pull/6230)
43+
- Handle mypy 2.0 related failures by @alexander-alderman-webb in [#6218](https://github.com/getsentry/sentry-python/pull/6218)
44+
45+
### Internal Changes 🔧
46+
47+
#### Django
48+
49+
- Check transaction annotations on transaction events by @alexander-alderman-webb in [#6251](https://github.com/getsentry/sentry-python/pull/6251)
50+
- Reload middleware on test teardown by @alexander-alderman-webb in [#6249](https://github.com/getsentry/sentry-python/pull/6249)
51+
52+
#### Openai
53+
54+
- Separate sync and async embeddings patches by @alexander-alderman-webb in [#6189](https://github.com/getsentry/sentry-python/pull/6189)
55+
- Separate sync and async Responses patches by @alexander-alderman-webb in [#6188](https://github.com/getsentry/sentry-python/pull/6188)
56+
- Separate sync and async Chat Completions patches by @alexander-alderman-webb in [#6187](https://github.com/getsentry/sentry-python/pull/6187)
57+
58+
#### Other
59+
60+
- (langchain) Inline global state by @alexander-alderman-webb in [#6261](https://github.com/getsentry/sentry-python/pull/6261)
61+
- (stdlib) Only capture relevant telemetry with `capture_items()` by @alexander-alderman-webb in [#6214](https://github.com/getsentry/sentry-python/pull/6214)
62+
- (tests) Replace custom `envelopes_to_x` helpers with `capture_items` by @sentrivana in [#6233](https://github.com/getsentry/sentry-python/pull/6233)
63+
- (traces) Cache valid span statuses in a module-level frozenset by @ericapisani in [#6208](https://github.com/getsentry/sentry-python/pull/6208)
64+
- Assert presence of profile chunks after session shutdown by @alexander-alderman-webb in [#6213](https://github.com/getsentry/sentry-python/pull/6213)
65+
- 🤖 Update test matrix with new releases (05/11) by @github-actions in [#6247](https://github.com/getsentry/sentry-python/pull/6247)
66+
- Make `set_custom_sampling_context()` a classmethod by @alexander-alderman-webb in [#6238](https://github.com/getsentry/sentry-python/pull/6238)
67+
- Rename `_timestamp` to `_end_timestamp` by @sentrivana in [#6235](https://github.com/getsentry/sentry-python/pull/6235)
68+
- Move batcher fork safety test to batcher tests by @sentrivana in [#6225](https://github.com/getsentry/sentry-python/pull/6225)
69+
- Introduce inline type check for whether a span is StreamedSpan by @ericapisani in [#6180](https://github.com/getsentry/sentry-python/pull/6180)
70+
- Add `botocore-stubs` by @alexander-alderman-webb in [#6203](https://github.com/getsentry/sentry-python/pull/6203)
71+
- Add option to drop scrubbed user IP addresses by @juliosuas in [#6241](https://github.com/getsentry/sentry-python/pull/6241)
72+
- Add .warden to .gitignore by @ericapisani in [#6210](https://github.com/getsentry/sentry-python/pull/6210)
73+
- removed universal bdist_wheel option by @Muskaan436 in [#6197](https://github.com/getsentry/sentry-python/pull/6197)
74+
- (transport) Add EnvelopePrinterTransport for debug logging by @ericapisani in [#6181](https://github.com/getsentry/sentry-python/pull/6181)
75+
376
## 2.59.0
477

578
### New Features ✨

docs/conf.py

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

34-
release = "2.59.0"
34+
release = "2.60.0"
3535
version = ".".join(release.split(".")[:2]) # The short X.Y version.
3636

3737

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ select = [
212212
"E", # pycodestyle errors (same as flake8 default)
213213
"W", # pycodestyle warnings (same as flake8 default)
214214
"F", # Pyflakes (same as flake8 default)
215+
"I",
215216
# Note: B and N rules are NOT enabled by default in flake8
216217
# They were only active through the plugins, which may not have been fully enabled
217218
]

scripts/init_serverless_sdk.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
"""
88

99
import os
10-
import sys
1110
import re
11+
import sys
12+
from typing import TYPE_CHECKING
1213

1314
import sentry_sdk
1415
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
1516

16-
from typing import TYPE_CHECKING
17-
1817
if TYPE_CHECKING:
1918
from typing import Any
2019

0 commit comments

Comments
 (0)