Skip to content

Commit 322f5f8

Browse files
Merge branch 'master' into webb/fastapi-change-integration-order
2 parents 11366c0 + 87f8f39 commit 322f5f8

File tree

8 files changed

+54
-8
lines changed

8 files changed

+54
-8
lines changed

CHANGELOG.md

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

3+
## 2.40.0
4+
5+
### Various fixes & improvements
6+
7+
- Add LiteLLM integration (#4864) by @constantinius
8+
Once you've enabled the [new LiteLLM integration](https://docs.sentry.io/platforms/python/integrations/litellm/), you can use the Sentry AI Agents Monitoring, a Sentry dashboard that helps you understand what's going on with your AI requests:
9+
10+
```python
11+
import sentry_sdk
12+
from sentry_sdk.integrations.litellm import LiteLLMIntegration
13+
sentry_sdk.init(
14+
dsn="<your-dsn>",
15+
# Set traces_sample_rate to 1.0 to capture 100%
16+
# of transactions for tracing.
17+
traces_sample_rate=1.0,
18+
# Add data like inputs and responses;
19+
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
20+
send_default_pii=True,
21+
integrations=[
22+
LiteLLMIntegration(),
23+
],
24+
)
25+
```
26+
27+
- Litestar: Copy request info to prevent cookies mutation (#4883) by @alexander-alderman-webb
28+
- Add tracing to `DramatiqIntegration` (#4571) by @Igreh
29+
- Also emit spans for MCP tool calls done by the LLM (#4875) by @constantinius
30+
- Option to not trace HTTP requests based on status codes (#4869) by @alexander-alderman-webb
31+
You can now disable transactions for incoming requests with specific HTTP status codes. The [new `trace_ignore_status_codes` option](https://docs.sentry.io/platforms/python/configuration/options/#trace_ignore_status_codes) accepts a `set` of status codes as integers. If a transaction wraps a request that results in one of the provided status codes, the transaction will be unsampled.
32+
33+
```python
34+
import sentry_sdk
35+
36+
sentry_sdk.init(
37+
trace_ignore_status_codes={301, 302, 303, *range(305, 400), 404},
38+
)
39+
```
40+
41+
- Move `_set_agent_data` call to `ai_client_span` function (#4876) by @constantinius
42+
- Add script to determine lowest supported versions (#4867) by @sentrivana
43+
- Update `CONTRIBUTING.md` (#4870) by @sentrivana
44+
345
## 2.39.0
446

547
### Various fixes & improvements

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.39.0"
34+
release = "2.40.0"
3535
version = ".".join(release.split(".")[:2]) # The short X.Y version.
3636

3737

scripts/populate_tox/releases.jsonl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@
191191
{"info": {"classifiers": ["Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries"], "name": "statsig", "requires_python": ">=3.7", "version": "0.55.3", "yanked": false}}
192192
{"info": {"classifiers": ["Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries"], "name": "statsig", "requires_python": ">=3.7", "version": "0.65.0", "yanked": false}}
193193
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], "name": "strawberry-graphql", "requires_python": ">=3.8,<4.0", "version": "0.209.8", "yanked": false}}
194-
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], "name": "strawberry-graphql", "requires_python": "<4.0,>=3.9", "version": "0.282.0", "yanked": false}}
194+
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules"], "name": "strawberry-graphql", "requires_python": "<4.0,>=3.9", "version": "0.283.0", "yanked": false}}
195195
{"info": {"classifiers": ["License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy"], "name": "tornado", "requires_python": ">= 3.5", "version": "6.0.4", "yanked": false}}
196196
{"info": {"classifiers": ["License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy"], "name": "tornado", "requires_python": ">=3.9", "version": "6.5.2", "yanked": false}}
197197
{"info": {"classifiers": ["Development Status :: 5 - Production/Stable", "Environment :: No Input/Output (Daemon)", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Natural Language :: French", "Natural Language :: German", "Natural Language :: Spanish", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Application Frameworks"], "name": "trytond", "requires_python": null, "version": "1.2.10", "yanked": false}}

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1343,4 +1343,4 @@ def _get_default_options():
13431343
del _get_default_options
13441344

13451345

1346-
VERSION = "2.39.0"
1346+
VERSION = "2.40.0"

sentry_sdk/integrations/litestar.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from collections.abc import Set
2+
from copy import deepcopy
3+
24
import sentry_sdk
35
from sentry_sdk.consts import OP
46
from sentry_sdk.integrations import (
@@ -260,7 +262,7 @@ def event_processor(event, _):
260262

261263
event.update(
262264
{
263-
"request": request_info,
265+
"request": deepcopy(request_info),
264266
"transaction": tx_name,
265267
"transaction_info": tx_info,
266268
}

sentry_sdk/integrations/starlite.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from copy import deepcopy
2+
13
import sentry_sdk
24
from sentry_sdk.consts import OP
35
from sentry_sdk.integrations import DidNotEnable, Integration
@@ -237,7 +239,7 @@ def event_processor(event, _):
237239

238240
event.update(
239241
{
240-
"request": request_info,
242+
"request": deepcopy(request_info),
241243
"transaction": tx_name,
242244
"transaction_info": tx_info,
243245
}

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="2.39.0",
24+
version="2.40.0",
2525
author="Sentry Team and Contributors",
2626
author_email="[email protected]",
2727
url="https://github.com/getsentry/sentry-python",

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ envlist =
151151
{py3.8,py3.12,py3.13}-graphene-v3.4.3
152152

153153
{py3.8,py3.10,py3.11}-strawberry-v0.209.8
154-
{py3.9,py3.12,py3.13}-strawberry-v0.282.0
154+
{py3.9,py3.12,py3.13}-strawberry-v0.283.0
155155

156156

157157
# ~~~ Network ~~~
@@ -475,7 +475,7 @@ deps =
475475
{py3.6}-graphene: aiocontextvars
476476

477477
strawberry-v0.209.8: strawberry-graphql[fastapi,flask]==0.209.8
478-
strawberry-v0.282.0: strawberry-graphql[fastapi,flask]==0.282.0
478+
strawberry-v0.283.0: strawberry-graphql[fastapi,flask]==0.283.0
479479
strawberry: httpx
480480
strawberry-v0.209.8: pydantic<2.11
481481

0 commit comments

Comments
 (0)