Skip to content

Commit 40f0bd0

Browse files
merge master
2 parents a45c287 + 294db4a commit 40f0bd0

51 files changed

Lines changed: 5202 additions & 3234 deletions

Some content is hidden

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

‎.github/workflows/test-integrations-ai.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ jobs:
6969
run: |
7070
set -x # print commands that are executed
7171
./scripts/runtox.sh "py${{ matrix.python-version }}-openai-notiktoken"
72+
- name: Test typesafe
73+
run: |
74+
set -x # print commands that are executed
75+
./scripts/runtox.sh "py${{ matrix.python-version }}-typesafe"
7276
- name: Upload coverage data
7377
if: ${{ !cancelled() }}
7478
continue-on-error: true

‎CHANGELOG.md‎

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

3+
## 2.71.0
4+
5+
### New Features ✨
6+
7+
- **New integration:** TypeSafe (#4733) by @alexander-alderman-webb
8+
9+
Add the TypeSafe integration to your `sentry_sdk.init` call:
10+
11+
```python
12+
import sentry_sdk
13+
from sentry_sdk.integrations.typesafe import TypeSafeIntegration
14+
15+
sentry_sdk.init(
16+
dsn="...",
17+
traces_sample_rate=1.0,
18+
integrations=[
19+
TypeSafeIntegration(),
20+
]
21+
)
22+
```
23+
24+
#### Typesafe
25+
26+
- Record `gen_ai.output.messages` by @alexander-alderman-webb in [#7720](https://github.com/getsentry/sentry-python/pull/7720)
27+
- Set token usage attributes by @alexander-alderman-webb in [#7719](https://github.com/getsentry/sentry-python/pull/7719)
28+
- Record `gen_ai.input.messages` by @alexander-alderman-webb in [#7718](https://github.com/getsentry/sentry-python/pull/7718)
29+
- Record `gen_ai.response.model` by @alexander-alderman-webb in [#7717](https://github.com/getsentry/sentry-python/pull/7717)
30+
- Add integration with `system_one()` patches by @alexander-alderman-webb in [#7716](https://github.com/getsentry/sentry-python/pull/7716)
31+
32+
### Bug Fixes 🐛
33+
34+
- Keep event if processor raises by @sentrivana in [#7701](https://github.com/getsentry/sentry-python/pull/7701)
35+
- Isolate user callbacks, emit client reports by @sentrivana in [#7692](https://github.com/getsentry/sentry-python/pull/7692)
36+
37+
### Documentation 📚
38+
39+
- Promote `data_collection` in changelog by @sentrivana in [#7565](https://github.com/getsentry/sentry-python/pull/7565)
40+
41+
### Internal Changes 🔧
42+
43+
- (aws-lambda) Add `.gitignore` to lambda handlers by @pabloDeputter in [#7638](https://github.com/getsentry/sentry-python/pull/7638)
44+
- (litellm) Set `LITELLM_LOCAL_MODEL_COST_MAP=true` by @alexander-alderman-webb in [#7630](https://github.com/getsentry/sentry-python/pull/7630)
45+
- (otlp) Adjust to `OTLPSpanExporter._headers` removal by @alexander-alderman-webb in [#7722](https://github.com/getsentry/sentry-python/pull/7722)
46+
- Use top-level flush API in tests by @sentrivana in [#7725](https://github.com/getsentry/sentry-python/pull/7725)
47+
- Unsample on sampler exception by @sentrivana in [#7723](https://github.com/getsentry/sentry-python/pull/7723)
48+
- Use `sentry_init` fixture by @sentrivana in [#7577](https://github.com/getsentry/sentry-python/pull/7577)
49+
350
## 2.70.0
451

552
### 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.70.0"
34+
release = "2.71.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
@@ -81,6 +81,7 @@ typing = [
8181
"aiohttp>=3.14.3",
8282
"openai-agents>=0.22.0",
8383
"mistralai>=2.10.1",
84+
"typesafe-sdk>=0.7.2",
8485
]
8586
test = [
8687
"dataclasses ; python_full_version < '3.7'",

‎scripts/populate_tox/config.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@
244244
"package": "huggingface_hub",
245245
"deps": {
246246
"*": ["responses", "pytest-httpx"],
247+
">=2": ["httpx2-pytest"],
247248
},
248249
},
249250
"langchain-base": {
@@ -497,7 +498,6 @@
497498
"pytest-asyncio",
498499
"python-multipart",
499500
"requests",
500-
"anyio<4.0.0",
501501
"jinja2",
502502
"httpx",
503503
],
@@ -561,6 +561,13 @@
561561
"package": "typer",
562562
"num_versions": 2,
563563
},
564+
"typesafe": {
565+
"package": "typesafe-sdk",
566+
"integration_name": "typesafe",
567+
"deps": {
568+
"*": ["pytest-asyncio"],
569+
},
570+
},
564571
"unleash": {
565572
"package": "UnleashClient",
566573
"num_versions": 2,

‎scripts/populate_tox/package_dependencies.jsonl‎

Lines changed: 73 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/populate_tox/releases.jsonl‎

Lines changed: 17 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/split_tox_gh_actions/split_tox_gh_actions.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
"mistral",
9696
"openai-base",
9797
"openai-notiktoken",
98+
"typesafe",
9899
],
99100
"Cloud": [
100101
"aws_lambda",

‎sentry_sdk/client.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,21 @@ def _get_options(*args: "Optional[str]", **kwargs: "Any") -> "Dict[str, Any]":
403403
stacklevel=2,
404404
)
405405

406+
if has_profiling_enabled(rv):
407+
warnings.warn(
408+
"Transaction-based profiling is deprecated and will be removed in the next major version of the SDK. "
409+
"Please use continuous profiling instead: https://docs.sentry.io/platforms/python/profiling/",
410+
DeprecationWarning,
411+
stacklevel=2,
412+
)
413+
if has_span_streaming_enabled(rv):
414+
warnings.warn(
415+
"Transaction-based profiling has no effect when `trace_lifecycle` is set to `stream`. "
416+
"Please use continuous profiling instead: https://docs.sentry.io/platforms/python/profiling/",
417+
UserWarning,
418+
stacklevel=2,
419+
)
420+
406421
return rv
407422

408423

‎sentry_sdk/consts.py‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,14 @@ class SPANDATA:
11641164
Example: "prod"
11651165
"""
11661166

1167+
SENTRY_IS_LOCALHOST = "sentry.is_localhost"
1168+
"""
1169+
Indicates whether a telemetry item was sent on a host, device or browser on
1170+
a localhost URL or IP address.
1171+
1172+
Used in inbound filters.
1173+
"""
1174+
11671175
SENTRY_RELEASE = "sentry.release"
11681176
"""
11691177
The Sentry release.
@@ -1194,6 +1202,13 @@ class SPANDATA:
11941202
Example: ["AtexitIntegration", "StdlibIntegration"]
11951203
"""
11961204

1205+
USER_AGENT_ORIGINAL = "user_agent.original"
1206+
"""
1207+
Value of the HTTP User-Agent header sent by the client.
1208+
1209+
Used in inbound filters.
1210+
"""
1211+
11971212

11981213
class SPANSTATUS:
11991214
"""
@@ -1238,6 +1253,7 @@ class OP:
12381253
GEN_AI_CHAT = "gen_ai.chat"
12391254
GEN_AI_CREATE_AGENT = "gen_ai.create_agent"
12401255
GEN_AI_EMBEDDINGS = "gen_ai.embeddings"
1256+
GEN_AI_EVALUATE = "gen_ai.evaluate"
12411257
GEN_AI_EXECUTE_TOOL = "gen_ai.execute_tool"
12421258
GEN_AI_TEXT_COMPLETION = "gen_ai.text_completion"
12431259
GEN_AI_HANDOFF = "gen_ai.handoff"
@@ -1848,4 +1864,4 @@ def _get_default_options() -> "dict[str, Any]":
18481864
del _get_default_options
18491865

18501866

1851-
VERSION = "2.70.0"
1867+
VERSION = "2.71.0"

0 commit comments

Comments
 (0)