diff --git a/docs/platforms/python/agent-tracing/index.mdx b/docs/platforms/python/agent-tracing/index.mdx
index 4e5a91024d072..17b548ad21a35 100644
--- a/docs/platforms/python/agent-tracing/index.mdx
+++ b/docs/platforms/python/agent-tracing/index.mdx
@@ -88,21 +88,6 @@ sentry_sdk.init(
See each integration page for the options that apply to your stack.
-### Streaming Gen AI Spans
-
-From SDK `2.64.0`, `gen_ai` spans are sent as standalone envelope items (avoids large-payload drops; required for Conversations).
-
-Self-hosted Sentry users should set `stream_gen_ai_spans=False` if standalone `gen_ai` spans may not be ingested.
-
-```python
-import sentry_sdk
-
-sentry_sdk.init(
- dsn="___PUBLIC_DSN___",
- stream_gen_ai_spans=False,
-)
-```
-
## Manual Instrumentation
You can also instrument agent spans yourself. See manual instrumentation.
diff --git a/docs/platforms/python/agent-tracing/openai-agents/index.mdx b/docs/platforms/python/agent-tracing/openai-agents/index.mdx
index 79414ead647ec..8b07877654626 100644
--- a/docs/platforms/python/agent-tracing/openai-agents/index.mdx
+++ b/docs/platforms/python/agent-tracing/openai-agents/index.mdx
@@ -11,7 +11,7 @@ The support for **OpenAI Agents SDK** is in its beta phase. Please test locally
This integration connects Sentry with the [OpenAI Python SDK](https://openai.github.io/openai-agents-python/).
-The integration has been confirmed to work with OpenAI Agents version 0.0.19.
+The integration has been confirmed to work with OpenAI Agents version 0.10.3.
@@ -126,5 +126,5 @@ You can pass the following keyword arguments to `OpenAIAgentsIntegration()`:
## Supported Versions
-- OpenAI Agents SDK: 0.0.19+
+- OpenAI Agents SDK: 0.10.3+
- Python: 3.9+
diff --git a/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx b/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx
index 0234e429f0ed4..100fcf0c365ec 100644
--- a/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx
+++ b/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx
@@ -11,7 +11,7 @@ The support for **Pydantic AI** is in beta. Please test locally before using in
This integration connects Sentry with the [Pydantic AI](https://ai.pydantic.dev/) library.
-The integration has been confirmed to work with Pydantic AI version 1.0.0+.
+The integration has been confirmed to work with Pydantic AI version 1.76.0+.
Once you've installed this integration, you can use the [Agents Dashboards](https://sentry.io/orgredirect/organizations/:orgslug/dashboards/?filter=onlyPrebuilt&query=agents&sort=mostPopular) to understand what's going on with your agents.
@@ -251,5 +251,5 @@ You can pass the following keyword arguments to `PydanticAIIntegration()`:
## Supported Versions
-- Pydantic AI: 1.0.0+
+- Pydantic AI: 1.76.0+
- Python: 3.9+
diff --git a/docs/platforms/python/configuration/filtering/index.mdx b/docs/platforms/python/configuration/filtering/index.mdx
index 8c5faa16342bb..af0bfcc094f8a 100644
--- a/docs/platforms/python/configuration/filtering/index.mdx
+++ b/docs/platforms/python/configuration/filtering/index.mdx
@@ -166,7 +166,6 @@ import re
import sentry_sdk
sentry_sdk.init(
- trace_lifecycle="stream",
ignore_spans=[
# String match against span name
"/health",
diff --git a/docs/platforms/python/configuration/options.mdx b/docs/platforms/python/configuration/options.mdx
index ace41198e25b3..3ad25b6dd395d 100644
--- a/docs/platforms/python/configuration/options.mdx
+++ b/docs/platforms/python/configuration/options.mdx
@@ -287,7 +287,6 @@ def before_send_span(span, hint):
sentry_sdk.init(
# ...
- trace_lifecycle="stream",
before_send_span=before_send_span,
)
```
@@ -410,23 +409,8 @@ If you want to disable all tracing you need to set `traces_sample_rate=None`. In
-
-
-Controls how spans are sent to Sentry:
-
-- In transaction mode (`"static"`, the default), all spans are collected in memory and sent to Sentry as a single transaction once the root span ends.
-- In stream mode (`"stream"`), spans are sent in batches as they finish.
-
-
-
-
-
-Only available in stream mode.
-
-
-
A list of strings, compiled regular expressions, or dictionaries describing spans that shouldn't be sent to Sentry. When using strings, a span name containing the string will be filtered out. For exact or more complex pattern matching, use compiled regular expressions instead. You can also provide a dictionary with `name` and/or `attributes` keys to match on multiple conditions. At least one key must be provided.
If the dropped span is a service span, its children are dropped too. If it's a child span, only that span is dropped and its children are reparented to the nearest ancestor.
@@ -441,7 +425,6 @@ import re
import sentry_sdk
sentry_sdk.init(
- trace_lifecycle="stream",
ignore_spans=[
# String match against span name
"/health",
@@ -551,16 +534,6 @@ The threshold in milliseconds for adding the source location to an outgoing HTTP
-
-
-An optional property that disables tracing for HTTP requests with certain status codes.
-
-Requests are not traced if the status code is contained in the provided set.
-
-If `trace_ignore_status_codes` is not provided, requests with any status code may be traced.
-
-
-
A custom [repr](https://docs.python.org/3/library/functions.html#repr) function to run while serializing an object. Use this to control how your custom objects and classes are visible in Sentry.
@@ -619,39 +592,6 @@ A number between `0` and `1`, controlling the percentage chance a given session
-
-
-When enabled, `gen_ai` spans are sent as standalone envelope items instead of being bundled in the transaction payload. This prevents AI spans with large inputs and outputs from being dropped due to transaction payload size limits.
-
-This is enabled by default starting with SDK version `2.64.0` (before that, it defaulted to `False`). Set it to `False` to send `gen_ai` spans as part of the transaction instead.
-
-Self-hosted Sentry users should set this option to `False`, as standalone `gen_ai` spans may not be ingested by their Sentry instance.
-
-
-
-## Logs Options
-
-
-
-**Deprecated:** This option will be removed in the next major version. Use the `capture_sentry_logs` option on the [`logging`](/platforms/python/integrations/logging/#options) and [Loguru](/platforms/python/integrations/loguru/#options) integrations instead.
-
-The `sentry_sdk.logger` API works standalone and is not affected by this option.
-
-For automatic capture of logs from the standard library `logging` module and from Loguru, this option acts as a fallback. If an integration leaves `capture_sentry_logs` unset, `enable_logs=True` turns automatic capture on for that integration. Setting `capture_sentry_logs` on the integration always wins.
-
-| `enable_logs` | `capture_sentry_logs` | Automatic capture |
-| ----------------- | --------------------- | ----------------- |
-| not set / `False` | not set | off |
-| `True` | not set | on |
-| any | `True` | on |
-| any | `False` | off |
-
-In SDK versions prior to `2.68.0`, this option had to be set to `True` to use the `sentry_sdk.logger` API, and it also enabled automatic capture of logs from the standard library `logging` module and from Loguru. In version `2.68.0` only, the option had no effect at all. Upgrade to `2.68.1` or later if you rely on it.
-
-Deprecated in version `2.68.1`. New in SDK version `2.35.0`. Prior to `2.35.0`, this option was experimental.
-
-
-
## Experimental Options
diff --git a/docs/platforms/python/enriching-events/attributes/index.mdx b/docs/platforms/python/enriching-events/attributes/index.mdx
index fecf158f71266..97d22eeb58441 100644
--- a/docs/platforms/python/enriching-events/attributes/index.mdx
+++ b/docs/platforms/python/enriching-events/attributes/index.mdx
@@ -13,9 +13,7 @@ Attribute values can be `str`, `int`, `float`, or `bool`, as well as arrays of t
-Attributes on spans require stream mode (SDK version `2.62.0`+). In stream mode, spans have no contexts, data, or tags — everything is an attribute, so `set_data()`, `set_tag()`, and `set_context()` are replaced by `set_attribute()` and `set_attributes()`.
-
-Attributes on logs and metrics don't require stream mode — they work regardless of your `trace_lifecycle` setting.
+Spans have no contexts, data, or tags — everything is an attribute, so `set_data()`, `set_tag()`, and `set_context()` are replaced by `set_attribute()` and `set_attributes()`.
diff --git a/docs/platforms/python/integrations/aiohttp/aiohttp-client.mdx b/docs/platforms/python/integrations/aiohttp/aiohttp-client.mdx
index 4a87b7bda0bc4..235ae5eb9cbd2 100644
--- a/docs/platforms/python/integrations/aiohttp/aiohttp-client.mdx
+++ b/docs/platforms/python/integrations/aiohttp/aiohttp-client.mdx
@@ -55,5 +55,5 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr
## Supported Versions
-- AIOHTTP: 3.5+
+- AIOHTTP: 3.7+
- Python: 3.7+
diff --git a/docs/platforms/python/integrations/aiohttp/index.mdx b/docs/platforms/python/integrations/aiohttp/index.mdx
index 243b41516d84f..f8a062f81e19e 100644
--- a/docs/platforms/python/integrations/aiohttp/index.mdx
+++ b/docs/platforms/python/integrations/aiohttp/index.mdx
@@ -19,16 +19,6 @@ pip install sentry-sdk
uv add sentry-sdk
```
-If you're on Python 3.6, you also need the `aiocontextvars` package:
-
-```bash {tabTitle:pip}
-pip install "aiocontextvars"
-```
-
-```bash {tabTitle:uv}
-uv add "aiocontextvars"
-```
-
## Configure
If you have the `aiohttp` package in your dependencies, the AIOHTTP integration will be enabled automatically when you initialize the Sentry SDK.
@@ -111,5 +101,5 @@ Regardless of how `failed_request_status_codes` is set, any exceptions raised by
## Supported Versions
-- AIOHTTP: 3.4+
+- AIOHTTP: 3.7+
- Python: 3.7+
diff --git a/docs/platforms/python/integrations/boto3/index.mdx b/docs/platforms/python/integrations/boto3/index.mdx
index 7264c52e2209a..b03170d2f26b7 100644
--- a/docs/platforms/python/integrations/boto3/index.mdx
+++ b/docs/platforms/python/integrations/boto3/index.mdx
@@ -12,8 +12,8 @@ The Boto3 integration instruments requests made to Amazon Web Services done with
You need:
- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/)
- Your application up and running
-- botocore `1.12+`
-- Python `3.6+`
+- botocore `1.16+`
+- Python `3.7+`
diff --git a/docs/platforms/python/integrations/bottle/index.mdx b/docs/platforms/python/integrations/bottle/index.mdx
index 50ca24365aecd..6447c4748688c 100644
--- a/docs/platforms/python/integrations/bottle/index.mdx
+++ b/docs/platforms/python/integrations/bottle/index.mdx
@@ -4,8 +4,6 @@ description: "Learn about using Sentry with Bottle."
---
The Bottle integration adds support for the [Bottle web framework](https://bottlepy.org/).
-Currently it works well with the stable version of Bottle (0.12).
-However the integration with the development version (0.13) doesn't work properly.
@@ -115,7 +113,7 @@ Regardless of how `failed_request_status_codes` is configured, any non-`HTTPResp
## Supported Versions
-- Bottle: 0.12.13+
-- Python: 3.6+
+- Bottle: 0.12+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/celery/index.mdx b/docs/platforms/python/integrations/celery/index.mdx
index 8e48fa449ab45..7631790231f6b 100644
--- a/docs/platforms/python/integrations/celery/index.mdx
+++ b/docs/platforms/python/integrations/celery/index.mdx
@@ -11,8 +11,8 @@ You need:
- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/)
- Your application up and running
-- Celery `4.4.7+`
-- Python `3.6+`
+- Celery `5.0.0+`
+- Python `3.7+`
@@ -203,14 +203,6 @@ my_task_b.apply_async(
-
-
-Sentry uses custom message headers for distributed tracing. For Celery versions 4.x, with [message protocol version 1](https://docs.celeryq.dev/en/stable/internals/protocol.html#version-1), this functionality is broken, and Celery fails to propagate custom headers to the worker. Protocol version 2, the default since Celery 4.0, is not affected.
-
-The fix for the custom headers propagation issue was introduced to the Celery project ([PR](https://github.com/celery/celery/pull/6374)) starting with version 5.0.1. However, the fix was not backported to versions 4.x.
-
-
-
## Verify Your Setup
diff --git a/docs/platforms/python/integrations/chalice/index.mdx b/docs/platforms/python/integrations/chalice/index.mdx
index 3e766a85beca9..155d2a46f9d8d 100644
--- a/docs/platforms/python/integrations/chalice/index.mdx
+++ b/docs/platforms/python/integrations/chalice/index.mdx
@@ -49,5 +49,5 @@ When you enter the `"/"` route or the scheduled task is run, an error event will
## Supported Versions
-- Chalice: 1.16.0+
-- Python: 3.6+
+- Chalice: 1.22.0+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/cloudresourcecontext/index.mdx b/docs/platforms/python/integrations/cloudresourcecontext/index.mdx
index d9025b69d540f..f26192b7c90f1 100644
--- a/docs/platforms/python/integrations/cloudresourcecontext/index.mdx
+++ b/docs/platforms/python/integrations/cloudresourcecontext/index.mdx
@@ -83,5 +83,5 @@ In Google Cloud Platform GCE the context looks like this:
## Supported Versions
-- Python: 3.6+
+- Python: 3.7+
- Cloud platforms: Amazon EC2, Google Compute Engine
diff --git a/docs/platforms/python/integrations/default-integrations.mdx b/docs/platforms/python/integrations/default-integrations.mdx
index dcfb5c8e04254..6bd0ab6acafb0 100644
--- a/docs/platforms/python/integrations/default-integrations.mdx
+++ b/docs/platforms/python/integrations/default-integrations.mdx
@@ -44,6 +44,20 @@ You can pass the following keyword arguments to `ExcepthookIntegration()`:
By default, the SDK does not capture errors occurring in the REPL (`always_run=False`).
+## Unraisablehook
+
+_Import name: `sentry_sdk.integrations.unraisablehook.UnraisablehookIntegration`_
+
+This integration registers with the interpreter's unraisable hook system, which
+handles exceptions Python can't propagate to the caller — for example, an
+exception raised inside a `__del__` finalizer or in a garbage collection
+callback. Python would otherwise print these to `stderr` and continue, so
+without this integration they never reach Sentry. The integration marks these
+events as unhandled.
+
+This integration requires Python 3.8 or later. The SDK doesn't enable it on
+Python 3.7.
+
## Deduplication
_Import name: `sentry_sdk.integrations.dedupe.DedupeIntegration`_
@@ -72,12 +86,6 @@ _Import name: `sentry_sdk.integrations.argv.ArgvIntegration`_
Adds `sys.argv` as an `extra` attribute to each event.
-## Logging
-
-_Import name: `sentry_sdk.integrations.logging.LoggingIntegration`_
-
-See [_Logging_](/platforms/python/integrations/logging/)
-
## Threading
_Import name: `sentry_sdk.integrations.threading.ThreadingIntegration`_
diff --git a/docs/platforms/python/integrations/django/index.mdx b/docs/platforms/python/integrations/django/index.mdx
index 14e20a608cba7..6aec55e256bdc 100644
--- a/docs/platforms/python/integrations/django/index.mdx
+++ b/docs/platforms/python/integrations/django/index.mdx
@@ -13,14 +13,8 @@ You need:
- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/)
- Your application up and running
-- Django `1.8+`
-- Python `3.6+`
-
-
-
-If you're using Python 3.7, Django applications with `channels` 2.0 will be correctly instrumented. Older versions of Python will require the installation of [aiocontextvars](https://pypi.org/project/aiocontextvars/).
-
-
+- Django `2.0+`
+- Python `3.7+`
diff --git a/docs/platforms/python/integrations/dramatiq/index.mdx b/docs/platforms/python/integrations/dramatiq/index.mdx
index 60aff86e60b47..bcb966c514f25 100644
--- a/docs/platforms/python/integrations/dramatiq/index.mdx
+++ b/docs/platforms/python/integrations/dramatiq/index.mdx
@@ -65,7 +65,7 @@ Running this will create an error event (`ZeroDivisionError`) that you should be
## Supported Versions
-- Dramatiq: 1.13+
-- Python: 3.6+
+- Dramatiq: 1.9+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/falcon/index.mdx b/docs/platforms/python/integrations/falcon/index.mdx
index 98c292eb6db4e..21a2f02f8354e 100644
--- a/docs/platforms/python/integrations/falcon/index.mdx
+++ b/docs/platforms/python/integrations/falcon/index.mdx
@@ -4,7 +4,7 @@ description: "Learn about using Sentry with Falcon."
---
The Falcon integration adds support for the [Falcon web framework](https://falconframework.org/).
-The integration has been confirmed to work with Falcon 1.4 and 2.0.
+The integration has been confirmed to work with Falcon 3.0 and later.
@@ -103,7 +103,7 @@ You can pass the following keyword arguments to `FalconIntegration()`:
## Supported Versions
-- Falcon: 1.4+
-- Python: 3.6+
+- Falcon: 3.0+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/fastapi/index.mdx b/docs/platforms/python/integrations/fastapi/index.mdx
index 299ae9ebe47e9..18e88709e8040 100644
--- a/docs/platforms/python/integrations/fastapi/index.mdx
+++ b/docs/platforms/python/integrations/fastapi/index.mdx
@@ -12,7 +12,7 @@ You need:
- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/)
- Your application up and running
-- FastAPI `0.79.0+`
+- FastAPI `0.85.0+`
- Python `3.7+`
diff --git a/docs/platforms/python/integrations/flask/index.mdx b/docs/platforms/python/integrations/flask/index.mdx
index 403f562684b8f..da21e2c70447a 100644
--- a/docs/platforms/python/integrations/flask/index.mdx
+++ b/docs/platforms/python/integrations/flask/index.mdx
@@ -11,8 +11,8 @@ You need:
- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/)
- Your application up and running
-- Flask `1.1.4+`
-- Python `3.6+`
+- Flask `2.0.0+`
+- Python `3.7+`
diff --git a/docs/platforms/python/integrations/grpc/index.mdx b/docs/platforms/python/integrations/grpc/index.mdx
index 5d780caa6f278..621229b420957 100644
--- a/docs/platforms/python/integrations/grpc/index.mdx
+++ b/docs/platforms/python/integrations/grpc/index.mdx
@@ -162,7 +162,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr
## Supported Versions
-- grpcio: 1.39+
+- grpcio: 1.32.0+
- Python: 3.7+
diff --git a/docs/platforms/python/integrations/httpx/index.mdx b/docs/platforms/python/integrations/httpx/index.mdx
index fa7792d84c5c0..8341412b9419a 100644
--- a/docs/platforms/python/integrations/httpx/index.mdx
+++ b/docs/platforms/python/integrations/httpx/index.mdx
@@ -13,7 +13,7 @@ You need:
- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/)
- Your application up and running
- HTTPX `0.16+`
-- Python `3.6+`
+- Python `3.7+`
diff --git a/docs/platforms/python/integrations/huey/index.mdx b/docs/platforms/python/integrations/huey/index.mdx
index e34533f8cfb15..9ba6b30652a9c 100644
--- a/docs/platforms/python/integrations/huey/index.mdx
+++ b/docs/platforms/python/integrations/huey/index.mdx
@@ -51,6 +51,6 @@ take a couple of moments for the transaction to show up.
## Supported Versions
- huey: 2.0+
-- Python: 3.6+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/index.mdx b/docs/platforms/python/integrations/index.mdx
index 0af118124ce5d..083948aab820d 100644
--- a/docs/platforms/python/integrations/index.mdx
+++ b/docs/platforms/python/integrations/index.mdx
@@ -24,7 +24,7 @@ The Sentry SDK uses integrations to hook into the functionality of popular libra
| | ✓ |
| | ✓ |
| | ✓ |
-| | |
+| | ✓ |
| | ✓ |
### Databases
@@ -106,20 +106,20 @@ The Sentry SDK uses integrations to hook into the functionality of popular libra
| | ✓ |
| | ✓ |
| | ✓ |
-| | ✓ |
+| | |
### RPC
| | **Auto-enabled** |
| ------------------------------------------------------------------------------------------------------ | :--------------: |
-| | ✓ |
+| | |
### Logging
| | **Auto-enabled** |
| --------------------------------------------------------------------------------------------------------------- | :--------------: |
-| | ✓ |
-| | ✓ |
+| | |
+| | |
### Miscellaneous
@@ -139,16 +139,16 @@ The Sentry SDK uses integrations to hook into the functionality of popular libra
### Default Integrations
-| Integration |
-| ---------------------------------------------------- |
-| [Argv](default-integrations/#argv) |
-| [Atexit](default-integrations/#atexit) |
-| [Excepthook](default-integrations/#excepthook) |
-| [Deduplication](default-integrations/#deduplication) |
-| [Stdlib](default-integrations/#stdlib) |
-| [Modules](default-integrations/#modules) |
-| [Logging](default-integrations/#logging) |
-| [Threading](default-integrations/#threading) |
+| Integration |
+| -------------------------------------------------------- |
+| [Argv](default-integrations/#argv) |
+| [Atexit](default-integrations/#atexit) |
+| [Excepthook](default-integrations/#excepthook) |
+| [Unraisablehook](default-integrations/#unraisablehook) |
+| [Deduplication](default-integrations/#deduplication) |
+| [Stdlib](default-integrations/#stdlib) |
+| [Modules](default-integrations/#modules) |
+| [Threading](default-integrations/#threading) |
## Configuration
diff --git a/docs/platforms/python/integrations/logging/index.mdx b/docs/platforms/python/integrations/logging/index.mdx
index 5cc0d10f6754c..0d09a68dac1fd 100644
--- a/docs/platforms/python/integrations/logging/index.mdx
+++ b/docs/platforms/python/integrations/logging/index.mdx
@@ -3,13 +3,7 @@ title: Logging
description: "Learn about logging with Python."
---
-The logging integration adds support for the `logging` framework from Python's standard library. Depending on your settings, logs can be captured as Sentry logs, as error events, or as breadcrumbs, or a combination of those.
-
-
-
-Enable the Sentry Logs feature with `LoggingIntegration(capture_sentry_logs=True)` to unlock Sentry's full logging power. With Sentry Logs, you can search, filter, and analyze logs from across your entire application in one place.
-
-
+The logging integration adds support for the `logging` framework from Python's standard library. Log records can be captured as [Sentry logs](/platforms/python/logs/), as breadcrumbs, as error events, or any combination of those.
## Install
@@ -25,7 +19,7 @@ uv add "sentry-sdk"
## Configure
-The logging integration is a default integration, so it will be enabled automatically when you initialize the Sentry SDK. To capture log records as [Sentry logs](/platforms/python/logs/), set `capture_sentry_logs` to `True` on the integration.
+Add `LoggingIntegration` to your `sentry_sdk.init()` call:
```python
import sentry_sdk
@@ -37,11 +31,13 @@ sentry_sdk.init(
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
integrations=[
- LoggingIntegration(capture_sentry_logs=True),
+ LoggingIntegration(),
],
)
```
+Once enabled, the integration captures log records as Sentry logs and as breadcrumbs. It doesn't create error events unless you ask it to with the [`event_level` option](#options).
+
## Verify
```python
@@ -55,15 +51,15 @@ def main():
main()
```
-This will capture both logs and send them to Sentry Logs. Additionally, an error event will be created from the `ERROR`-level log. In addition to that, a breadcrumb will be created from the `INFO`-level log.
+Both records are sent to Sentry as logs. Neither creates an error event, because `event_level` defaults to `None`.
## Behavior
-When the integration is capturing Sentry logs, logs with a level of `INFO` and higher will be captured as Sentry logs if the log level set in the `logging` module is `INFO` or below. The threshold can be configured via the [`sentry_logs_level` option](#options).
+Log records with a level of `INFO` and higher are captured as Sentry logs, as long as the log level set in the `logging` module is `INFO` or below. Adjust the threshold with the [`level` option](#options), or set it to `None` to stop capturing Sentry logs.
-Additionally, the logging integration will create an error event from all `ERROR`-level logs. This feature is configurable via the [`event_level` integration option](#options).
+`INFO` and above records are also captured as breadcrumbs. Use the [`breadcrumb_level` option](#options) to adjust that threshold.
-`INFO` and above logs will also be captured as breadcrumbs. Use the [`level` integration option](#options) to adjust the threshold.
+Error events are off by default. Set [`event_level`](#options) to start creating events from log records.
```python
import logging
@@ -74,7 +70,7 @@ from sentry_sdk.integrations.logging import LoggingIntegration
sentry_sdk.init(
...,
integrations=[
- LoggingIntegration(capture_sentry_logs=True),
+ LoggingIntegration(event_level=logging.ERROR),
],
)
@@ -88,12 +84,11 @@ logging.debug("I'm a DEBUG log")
```
- All of the above logs except for the `DEBUG` level message will be sent to Sentry as logs.
-- An error event with the message `"I'm an ERROR log"` will be created.
+- Because `event_level=logging.ERROR` is set, an error event with the message `"I'm an ERROR log"` will be created.
- `"I'm an INFO log"` will be attached as a breadcrumb to that event.
- `bar` will end up in the `extra` attributes of that event.
- `"I'm an exception log"` will send the current exception from `sys.exc_info()` with the stack trace to Sentry. If there's no exception, the current stack will be attached.
-- The debug message `"I'm a DEBUG log"` will not be captured by Sentry. See the [`sentry_logs_level` option](#option) to adjust which levels should be sent to Sentry as logs, and the [`level` option](#option) to do adjust the level for capturing breadcrumbs.
-
+- The debug message `"I'm a DEBUG log"` will not be captured by Sentry. See the [`level` option](#options) to adjust which levels are sent to Sentry as logs, and the [`breadcrumb_level` option](#options) to adjust the level for capturing breadcrumbs.
### Working with Extra Fields
@@ -107,7 +102,7 @@ from sentry_sdk.integrations.logging import LoggingIntegration
sentry_sdk.init(
# ...
integrations=[
- LoggingIntegration(capture_sentry_logs=True),
+ LoggingIntegration(),
],
)
@@ -115,10 +110,10 @@ logger = logging.getLogger(__name__)
# Extra fields become top-level searchable attributes
logger.error(
- "Payment processing failed",
+ "Payment processing failed",
extra={
"user_id": 12345,
- "transaction_id": "txn_abc123",
+ "transaction_id": "txn_abc123",
"payment_method": "credit_card",
"amount": 99.99
}
@@ -129,7 +124,7 @@ In this example, `user_id`, `transaction_id`, `payment_method`, and `amount` wil
## Options
-To change the default behavior of the logging integration, instantiate the integration manually and pass it to Sentry's `init` function:
+To change the default behavior of the logging integration, pass options to `LoggingIntegration()`:
```python
import logging
@@ -145,10 +140,9 @@ sentry_sdk.init(
# ...
integrations=[
LoggingIntegration(
- capture_sentry_logs=True, # Capture log records as Sentry logs
- sentry_logs_level=logging.INFO, # Capture INFO and above as logs
- level=logging.INFO, # Capture INFO and above as breadcrumbs
- event_level=logging.ERROR, # Send ERROR records as events
+ level=logging.INFO, # Capture INFO and above as Sentry logs
+ breadcrumb_level=logging.INFO, # Capture INFO and above as breadcrumbs
+ event_level=logging.ERROR, # Send ERROR records as events
),
],
)
@@ -156,20 +150,21 @@ sentry_sdk.init(
You can pass the following keyword arguments to `LoggingIntegration()`:
-- `capture_sentry_logs` (default: unset, which behaves as `False`): Set to `True` to capture log records as [Sentry structured logs](/platforms/python/logs/). If you leave this unset and have the deprecated [`enable_logs`](/platforms/python/configuration/options/#enable_logs) set to `True`, the SDK captures records as Sentry logs. Setting this option explicitly always wins over `enable_logs`.
-
-- `sentry_logs_level` (default `INFO`): The Sentry Python SDK will capture records with a level higher than or equal to `sentry_logs_level` as [Sentry structured logs](/platforms/python/logs/), as long as the integration is capturing Sentry logs.
+- `level` (default `INFO`): The Sentry Python SDK will capture records with a level higher than or equal to `level` as [Sentry structured logs](/platforms/python/logs/). Set it to `None` to stop capturing Sentry logs.
-- `level` (default `INFO`): The Sentry Python SDK will record log records with a level higher than or equal to `level` as breadcrumbs. Inversely, the SDK completely ignores any log record with a level lower than this one. If a value of `None` occurs, the SDK won't send log records as breadcrumbs.
+- `breadcrumb_level` (default `INFO`): The Sentry Python SDK will record log records with a level higher than or equal to `breadcrumb_level` as breadcrumbs. Set it to `None` to stop capturing breadcrumbs.
-- `event_level` (default `ERROR`): The Sentry Python SDK will report log records with a level higher than or equal to `event_level` as events as long as the logger itself is set to output records of those log levels (see note below). If a value of `None` occurs, the SDK won't send log records as events.
+- `event_level` (default `None`): The Sentry Python SDK will report log records with a level higher than or equal to `event_level` as events, as long as the logger itself is set to output records of those log levels (see note below). While this is `None`, no events are created from log records.
+
+The logging integration used to be enabled automatically, and used a different set of option names. If you're upgrading from 2.x, see the migration guide — in short, `sentry_logs_level` is now `level`, the old `level` is now `breadcrumb_level`, `event_level` now defaults to `None` instead of `ERROR`, and the `capture_sentry_logs` option is gone (use `level=None` to opt out of log capture). The `ignore_logger` helper now targets Sentry logs; its old behavior is `ignore_logger_for_events`.
+
## Ignoring a logger
-Sometimes a logger is extremely noisy and spams you with pointless errors. You can ignore that logger by calling `ignore_logger`:
+Sometimes a logger is extremely noisy and spams you with pointless records. To stop capturing it as Sentry logs, call `ignore_logger`:
```python
from sentry_sdk.integrations.logging import ignore_logger
@@ -177,24 +172,27 @@ from sentry_sdk.integrations.logging import ignore_logger
ignore_logger("a.spammy.logger")
logger = logging.getLogger("a.spammy.logger")
-logger.error("hi") # no error sent to sentry
+logger.error("hi") # no log sent to sentry
```
-You can also use `before-send` and `before-breadcrumb` to ignore
-only certain messages. See Filtering Events for more information.
+To silence a logger for breadcrumbs and events instead, use `ignore_logger_for_events`:
-
+```python
+from sentry_sdk.integrations.logging import ignore_logger_for_events
-Using `ignore_logger` removes the entries from specified logger **only** for breadcrumbs and events.
-If you **do not** wish to collect logs from the specified logger altogether, use also `ignore_logger_for_sentry_logs`.
+ignore_logger_for_events("a.spammy.logger")
+```
-
+The two denylists are separate, so a framework logger you've silenced for events can still be captured as Sentry logs. Both have a counterpart that reverses them: `unignore_logger` and `unignore_logger_for_events`.
+
+You can also use `before-send` and `before-breadcrumb` to ignore
+only certain messages. See Filtering Events for more information.
-## Handler classes
+## Handler Classes
-Instead of using `LoggingIntegration`, you can use two regular logging `logging.Handler` subclasses that the integration exports.
+Instead of using `LoggingIntegration`, you can wire up the regular `logging.Handler` subclasses that the integration exports: `LogsHandler`, `BreadcrumbHandler`, and `EventHandler`.
-**Usually, you don't need this.** You _can_ use this together with `default_integrations=False` if you want to opt into what the Sentry Python SDK captures. However, correctly setting up logging is difficult. Also, an opt-in approach to capture data will miss errors you may not think of on your own.
+**Usually, you don't need this.** Attaching the handlers yourself gives you full control over what gets captured, but correctly setting up logging is difficult, and an opt-in approach will miss errors you may not think of on your own.
See the [API documentation](https://getsentry.github.io/sentry-python/integrations.html#module-sentry_sdk.integrations.logging) for more information.
@@ -202,10 +200,16 @@ See the [API documentation](https://getsentry.github.io/sentry-python/integratio
- First, make sure you're on the latest version of the SDK. If you're using the `sentry_sdk.logger` API directly (e.g., `sentry_sdk.logger.info(...)`), logs are sent automatically. If you're using Python's `logging` module and want those log records captured as Sentry logs, make sure you have `capture_sentry_logs=True` set on your `LoggingIntegration`. Setting the deprecated `enable_logs=True` also works, but only if `capture_sentry_logs` is left unset on the integration.
+ First, make sure you're on the latest version of the SDK. If you're using the `sentry_sdk.logger` API directly (e.g., `sentry_sdk.logger.info(...)`), logs are sent automatically. If you're using Python's `logging` module and want those records captured as Sentry logs, make sure you've added `LoggingIntegration` to the `integrations` list in your `sentry_sdk.init()` — it's no longer enabled for you.
The SDK will honor the configured level of each logger (set with `logger.setLevel(level)` or `logging.basicConfig(level=level)`). That means that you will not see any `INFO` or `DEBUG` events from a logger with the level set to `WARNING`, regardless of how you configure the integration. If not set explicitly, the logging level defaults to `WARNING`.
Some frameworks, such as `uvicorn`, may reset or override your `logging` configuration. To ensure your log level is applied and logs at or above the configured level are picked up by the SDK, you can use the `force=True` flag when configuring your log level. For example `logger.setLevel(level, force=True)` and `logging.basicConfig(level=level, force=True)`.
+
+
+
+ Event capture is off by default. Set the [`event_level` option](#options) — for example `LoggingIntegration(event_level=logging.ERROR)` — to create events from log records at that level and above.
+
+
diff --git a/docs/platforms/python/integrations/loguru/index.mdx b/docs/platforms/python/integrations/loguru/index.mdx
index f297e27eb8f00..2e54326a1443d 100644
--- a/docs/platforms/python/integrations/loguru/index.mdx
+++ b/docs/platforms/python/integrations/loguru/index.mdx
@@ -7,13 +7,6 @@ The [Loguru](https://github.com/Delgan/loguru#readme) integration lets you captu
The [`logging`](/platforms/python/integrations/logging) integration provides most of the Loguru functionality and most examples on that page work with Loguru.
-
-
-Enable the Sentry Logs feature with `LoguruIntegration(capture_sentry_logs=True)` to unlock Sentry's full logging power. With Sentry Logs, you can search, filter, and analyze logs from across your entire application in one place.
-
-
-
-
## Install
Install `sentry-sdk` from PyPI:
@@ -28,7 +21,7 @@ uv add sentry-sdk
## Configure
-If you have the `loguru` package in your dependencies, the Loguru integration will be enabled automatically when you initialize the Sentry SDK. To capture Loguru log records as [Sentry logs](/platforms/python/logs/), set `capture_sentry_logs` to `True` on the integration.
+Add `LoguruIntegration` to your `sentry_sdk.init()` call:
```python
import sentry_sdk
@@ -40,11 +33,13 @@ sentry_sdk.init(
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
integrations=[
- LoguruIntegration(capture_sentry_logs=True),
+ LoguruIntegration(),
],
)
```
+Once enabled, the integration captures Loguru records as Sentry logs and as breadcrumbs. It doesn't create error events unless you ask it to with the [`event_level` option](#options).
+
## Verify
```python
@@ -58,28 +53,26 @@ def main():
main()
```
-This will capture both logs and send them to Sentry Logs. Additionally, an error event will be created from the `ERROR`-level log. In addition to that, a breadcrumb will be created from the `INFO`-level log.
+Both records are sent to Sentry as logs. Neither creates an error event, because `event_level` defaults to `None`.
## Behavior
-Logs with a level of `INFO` and higher will be captured as Sentry logs as long as the integration is capturing Sentry logs and the log level set in the `logging` module is `INFO` or below. The threshold can be configured via the [`sentry_logs_level` option](#options).
+Logs with a level of `INFO` and higher are captured as Sentry logs, as long as the log level set in the `logging` module is `INFO` or below. Adjust the threshold with the [`level` option](#options), or set it to `None` to stop capturing Sentry logs.
-Additionally, the Loguru integration will create an error event from all `ERROR`-level logs. This feature is configurable via the [`event_level` integration option](#options).
+`INFO` and above logs are also captured as breadcrumbs. Use the [`breadcrumb_level` option](#options) to adjust that threshold.
-`INFO` and above logs will also be captured as breadcrumbs. Use the [`level` integration option](#options) to adjust the threshold.
-
-The following snippet demonstrates the default behavior:
+Error events are off by default. Set [`event_level`](#options) to start creating events from log records:
```python
import sentry_sdk
from loguru import logger
-from sentry_sdk.integrations.loguru import LoguruIntegration
+from sentry_sdk.integrations.loguru import LoguruIntegration, LoggingLevels
sentry_sdk.init(
...,
integrations=[
- LoguruIntegration(capture_sentry_logs=True),
+ LoguruIntegration(event_level=LoggingLevels.ERROR.value),
],
)
@@ -93,26 +86,28 @@ logger.debug("I'm a DEBUG log")
```
- All of the above logs except for the `DEBUG`-level message will be sent to Sentry as logs.
-- An error event with the message `"I'm an ERROR log"` will be created.
+- Because `event_level` is set, an error event with the message `"I'm an ERROR log"` will be created.
- `"I'm an INFO log"` will be attached as a breadcrumb to that event.
- `bar` will end up in the `extra` attributes of that event.
- `"I'm an exception log"` will send the current exception from `sys.exc_info()` with the stack trace to Sentry. If there's no exception, the current stack will be attached.
-- The debug message `"I'm a DEBUG log"` will not be captured by Sentry. See the [`sentry_logs_level` option](#option) to adjust which log levels should be sent to Sentry as logs, and the [`level` option](#option) to adjust the level for capturing breadcrumbs.
+- The debug message `"I'm a DEBUG log"` will not be captured by Sentry. See the [`level` option](#options) to adjust which log levels are sent to Sentry as logs, and the [`breadcrumb_level` option](#options) to adjust the level for capturing breadcrumbs.
### Ignoring a logger
-Loggers can be noisy. You can ignore a logger by calling `ignore_logger`.
+Loggers can be noisy. To stop capturing one as Sentry logs, call `ignore_logger`.
-Since most of the logic is proxied to `logging` integration, we use it instead of the Loguru integration:
+Since most of the logic is proxied to the `logging` integration, we use it instead of the Loguru integration:
```python
-# Import form `logging` integration
+# Import from the `logging` integration
from sentry_sdk.integrations.logging import ignore_logger
ignore_logger("a.spammy.logger")
```
+To silence a logger for breadcrumbs and events instead, use `ignore_logger_for_events`.
+
In `a.spammy.logger` module:
```python
@@ -144,45 +139,44 @@ sentry_sdk.init(
# ...
integrations=[
LoguruIntegration(
- capture_sentry_logs=True, # Capture Loguru logs as Sentry logs
- sentry_logs_level=LoggingLevels.INFO.value, # Capture INFO and above as logs
- level=LoggingLevels.INFO.value, # Capture INFO and above as breadcrumbs
- event_level=LoggingLevels.ERROR.value, # Send ERROR logs as events
+ level=LoggingLevels.INFO.value, # Capture INFO and above as Sentry logs
+ breadcrumb_level=LoggingLevels.INFO.value, # Capture INFO and above as breadcrumbs
+ event_level=LoggingLevels.ERROR.value, # Send ERROR logs as events
)
],
)
```
-- `capture_sentry_logs`
+- `level`
- Set to `True` to capture Loguru log records as [Sentry structured logs](/platforms/python/logs/). If you leave this unset and have the deprecated [`enable_logs`](/platforms/python/configuration/options/#enable_logs) set to `True`, the SDK captures records as Sentry logs. Setting this option explicitly always wins over `enable_logs`.
+ The Sentry Python SDK will capture log records with a level higher than or equal to `level` as [Sentry structured logs](/platforms/python/logs/). If set to `None`, the SDK won't send records as logs.
- Default: unset, which behaves as `False`
+ Default: `INFO`
-- `sentry_logs_level`
+- `breadcrumb_level`
- The Sentry Python SDK will capture log records with a level higher than or equal to `sentry_logs_level` as [Sentry structured logs](/platforms/python/logs/). If set to `None`, the SDK won't send records as logs. Only applies when the integration is capturing Sentry logs.
+ The Sentry Python SDK will record log records with a level higher than or equal to `breadcrumb_level` as breadcrumbs. Inversely, the SDK will not capture breadcrumbs for logs with a level lower than this one. If set to `None`, the SDK won't send log records as breadcrumbs.
Default: `INFO`
-- `level`
+- `event_level`
- The Sentry Python SDK will record log records with a level higher than or equal to `level` as breadcrumbs. Inversely, the SDK will not capture breadcrumbs for logs with a level lower than this one. If set to `None`, the SDK won't send log records as breadcrumbs.
+ The Sentry Python SDK will report log records with a level higher than or equal to `event_level` as events. While this is `None`, no events are created from log records.
- Default: `INFO`
+ Default: `None`
-- `event_level`
+
- The Sentry Python SDK will report log records with a level higher than or equal to `event_level` as events. If set to `None`, the SDK won't send log records as events.
+The Loguru integration used to be enabled automatically, and used a different set of option names. If you're upgrading from 2.x, see the migration guide — in short, `sentry_logs_level` is now `level`, the old `level` is now `breadcrumb_level`, `event_level` now defaults to `None` instead of `ERROR`, and the `capture_sentry_logs` option is gone (use `level=None` to opt out of log capture).
- Default: `ERROR`
+
## Troubleshooting
- First, make sure you're on the latest version of the SDK. If you're using the `sentry_sdk.logger` API directly (e.g., `sentry_sdk.logger.info(...)`), logs are sent automatically. If you're using Loguru and want those log records captured as Sentry logs, make sure you have `capture_sentry_logs=True` set on your `LoguruIntegration`. Setting the deprecated `enable_logs=True` also works, but only if `capture_sentry_logs` is left unset on the integration.
+ First, make sure you're on the latest version of the SDK. If you're using the `sentry_sdk.logger` API directly (e.g., `sentry_sdk.logger.info(...)`), logs are sent automatically. If you're using Loguru and want those log records captured as Sentry logs, make sure you've added `LoguruIntegration` to the `integrations` list in your `sentry_sdk.init()` — it's no longer enabled for you.
Your logs could be missing because of the logging level of the logger. The SDK will honor the configured level of each logger. That means that you won't see any `INFO` or `DEBUG` data in Sentry from a logger with the level set to `WARNING`, regardless of how you configure the integration.
@@ -194,7 +188,7 @@ sentry_sdk.init(
## Supported Versions
-- Loguru: 0.5+
-- Python: 3.6+
+- Loguru: 0.7.0+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/mcp/index.mdx b/docs/platforms/python/integrations/mcp/index.mdx
index 6faddc2a7e0d9..02c689f587ef7 100644
--- a/docs/platforms/python/integrations/mcp/index.mdx
+++ b/docs/platforms/python/integrations/mcp/index.mdx
@@ -253,6 +253,6 @@ You can pass the following keyword arguments to `MCPIntegration()`:
## Supported Versions
-- MCP SDK: 1.15.0+
+- MCP SDK: 2.0+
- Python: 3.9+
diff --git a/docs/platforms/python/integrations/pure_eval/index.mdx b/docs/platforms/python/integrations/pure_eval/index.mdx
index 877dda86ce6a1..1f722beb09c8c 100644
--- a/docs/platforms/python/integrations/pure_eval/index.mdx
+++ b/docs/platforms/python/integrations/pure_eval/index.mdx
@@ -55,6 +55,6 @@ When you run this example script an error will be sent to Sentry. Through the `P
## Supported Versions
-- Python: 3.6+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/pymongo/index.mdx b/docs/platforms/python/integrations/pymongo/index.mdx
index 59ef912ea58f4..ea662e2b0eedc 100644
--- a/docs/platforms/python/integrations/pymongo/index.mdx
+++ b/docs/platforms/python/integrations/pymongo/index.mdx
@@ -58,7 +58,7 @@ The following information about your MongoDB queries will be available to you on
- Performance traces for all MongoDB queries
- Breadcrumbs for all MongoDB queries
-- Personal identifiable information (PII) will be stripped from all MongoDB queries if `send_default_pii` is disabled in the SDK. (This was tested for PyMongo 4.2 and below, but "should" also be future proof)
+- Personal identifiable information (PII) will be stripped from all MongoDB queries if `send_default_pii` is disabled in the SDK.
### Other MongoDB libraries
@@ -76,7 +76,7 @@ driver. This integration will not generate any breadcrumbs or spans from `mongom
## Supported Versions
-- PyMongo: 3.1+
-- Python: Python 3.6+
+- PyMongo: 3.5.0+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/pyramid/index.mdx b/docs/platforms/python/integrations/pyramid/index.mdx
index bdba509591301..319bbe61ed519 100644
--- a/docs/platforms/python/integrations/pyramid/index.mdx
+++ b/docs/platforms/python/integrations/pyramid/index.mdx
@@ -58,7 +58,7 @@ When you point your browser to [http://localhost:6543/](http://localhost:6543/)
- The SDK will report all exceptions leading to an Internal Server Error. These two kinds of exceptions are:
- exceptions that are not handled by any exception view
- - exceptions whose exception view returns a status code of 500 (Pyramid version 1.9+ only)
+ - exceptions whose exception view returns a status code of 500
- Request data is attached to all events: **HTTP method, URL, headers, form data, JSON payloads**. Sentry excludes raw bodies and multipart file uploads. Sentry also excludes personally identifiable information (such as user ids, usernames, cookies, authorization headers, IP addresses) unless you set `send_default_pii` to `True`.
@@ -105,7 +105,7 @@ You can pass the following keyword arguments to `PyramidIntegration()`:
## Supported Versions
-- Pyramid: 1.6+
-- Python: 3.6+
+- Pyramid: 2.0+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/quart/index.mdx b/docs/platforms/python/integrations/quart/index.mdx
index af01fa749908c..aa8fcc271bdc7 100644
--- a/docs/platforms/python/integrations/quart/index.mdx
+++ b/docs/platforms/python/integrations/quart/index.mdx
@@ -60,5 +60,5 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr
## Supported Versions
-- Quart: 0.16.1+
+- Quart: 0.19.0+
- Python: 3.7+
diff --git a/docs/platforms/python/integrations/ray/index.mdx b/docs/platforms/python/integrations/ray/index.mdx
index 92be689bb23f1..ef0561d2212ba 100644
--- a/docs/platforms/python/integrations/ray/index.mdx
+++ b/docs/platforms/python/integrations/ray/index.mdx
@@ -110,5 +110,5 @@ Running this will create an error event (`ZeroDivisionError`) that will be sent
## Supported Versions
-- Ray: 2.34+
+- Ray: 2.7.0+
- Python: 3.8+
diff --git a/docs/platforms/python/integrations/redis/index.mdx b/docs/platforms/python/integrations/redis/index.mdx
index 38298c3e93f8d..e3258933a783a 100644
--- a/docs/platforms/python/integrations/redis/index.mdx
+++ b/docs/platforms/python/integrations/redis/index.mdx
@@ -9,7 +9,8 @@ description: "Learn how to set up Sentry's Redis integration and how to capture
You need:
- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/)
- Your application up and running
-- Python `3.6+`
+- redis `4.2.0+`
+- Python `3.7+`
diff --git a/docs/platforms/python/integrations/rq/index.mdx b/docs/platforms/python/integrations/rq/index.mdx
index 31556fde89f97..3211ade4187a0 100644
--- a/docs/platforms/python/integrations/rq/index.mdx
+++ b/docs/platforms/python/integrations/rq/index.mdx
@@ -196,7 +196,7 @@ The `--sentry-dsn` CLI option has been removed from RQ. Initialize the Sentry SD
## Supported Versions
-- RQ: 0.6+
-- Python: 3.6+
+- RQ: 1.0+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/sanic/index.mdx b/docs/platforms/python/integrations/sanic/index.mdx
index 1786214129bcb..1cc0a1e4b26f3 100644
--- a/docs/platforms/python/integrations/sanic/index.mdx
+++ b/docs/platforms/python/integrations/sanic/index.mdx
@@ -19,16 +19,6 @@ pip install sentry-sdk
uv add sentry-sdk
```
-If you're on Python 3.6, you also need the `aiocontextvars` package:
-
-```bash {tabTitle:pip}
-pip install "aiocontextvars"
-```
-
-```bash {tabTitle:uv}
-uv add "aiocontextvars"
-```
-
## Configure
If you have the `sanic` package in your dependencies, the Sanic integration will be enabled automatically when you initialize the Sentry SDK.
@@ -143,5 +133,5 @@ When you point your browser to [http://localhost:8000/](http://localhost:8000/)
## Supported Versions
-- Sanic: 0.8+
-- Python: 3.6+ (Sanic 0.8+), 3.7+ (Sanic 21.0+)
+- Sanic: 22.0+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/socket/index.mdx b/docs/platforms/python/integrations/socket/index.mdx
index 1aa8421bee700..bfd7278369c95 100644
--- a/docs/platforms/python/integrations/socket/index.mdx
+++ b/docs/platforms/python/integrations/socket/index.mdx
@@ -81,6 +81,6 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr
## Supported Versions
-- Python: 3.6+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/spark/index.mdx b/docs/platforms/python/integrations/spark/index.mdx
index 13c4d8f59403f..2d2c57a03e7d5 100644
--- a/docs/platforms/python/integrations/spark/index.mdx
+++ b/docs/platforms/python/integrations/spark/index.mdx
@@ -63,7 +63,7 @@ if __name__ == "__main__":
### Worker
-The spark worker integration is supported for Spark versions 2.4.x and 3.1.x.
+The spark worker integration is supported for Spark versions 3.0 and later.
Create a file called `sentry-daemon.py` with the following content:
@@ -132,7 +132,7 @@ pip install --upgrade sentry-sdk
## Google Cloud Dataproc
-This integration can be set up for [Google Cloud Dataproc](https://cloud.google.com/dataproc/). It's recommended that Cloud Dataproc image version 1.4 or 2.0 be used with Spark 2.4 and 3.1, respectively, (as required by the worker integration).
+This integration can be set up for [Google Cloud Dataproc](https://cloud.google.com/dataproc/). The worker integration requires Spark 3.0 or later, so use Cloud Dataproc image version 2.0 or later.
1. Set up an [Initialization action](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/init-actions) to install the `sentry-sdk` on your Dataproc cluster.
diff --git a/docs/platforms/python/integrations/sqlalchemy/index.mdx b/docs/platforms/python/integrations/sqlalchemy/index.mdx
index 63777bea995fe..d880d974cc1ce 100644
--- a/docs/platforms/python/integrations/sqlalchemy/index.mdx
+++ b/docs/platforms/python/integrations/sqlalchemy/index.mdx
@@ -11,8 +11,8 @@ You need:
- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/)
- Your application up and running
-- SQLAlchemy `1.2+`
-- Python `3.6+`
+- SQLAlchemy `1.4+`
+- Python `3.7+`
diff --git a/docs/platforms/python/integrations/starlette/index.mdx b/docs/platforms/python/integrations/starlette/index.mdx
index 701f656eff319..4aadd4d3607b3 100644
--- a/docs/platforms/python/integrations/starlette/index.mdx
+++ b/docs/platforms/python/integrations/starlette/index.mdx
@@ -11,7 +11,7 @@ You need:
- A Sentry [account](https://sentry.io/signup/) and [project](/product/projects/)
- Your application up and running
-- Starlette: `0.16+`
+- Starlette: `0.20+`
- Python: `3.7+`
diff --git a/docs/platforms/python/integrations/tornado/index.mdx b/docs/platforms/python/integrations/tornado/index.mdx
index 03289a2e6171c..1ee3aabbd161e 100644
--- a/docs/platforms/python/integrations/tornado/index.mdx
+++ b/docs/platforms/python/integrations/tornado/index.mdx
@@ -19,16 +19,6 @@ pip install sentry-sdk
uv add sentry-sdk
```
-If you're on Python 3.6, you also need the `aiocontextvars` package:
-
-```bash {tabTitle:pip}
-pip install "aiocontextvars"
-```
-
-```bash {tabTitle:uv}
-uv add "aiocontextvars"
-```
-
## Configure
If you have the `tornado` package in your dependencies, the Tornado integration will be enabled automatically when you initialize the Sentry SDK.
diff --git a/docs/platforms/python/integrations/tryton/index.mdx b/docs/platforms/python/integrations/tryton/index.mdx
index acca6c0f71225..6c0ec167c060f 100644
--- a/docs/platforms/python/integrations/tryton/index.mdx
+++ b/docs/platforms/python/integrations/tryton/index.mdx
@@ -86,7 +86,7 @@ Each request has a separate scope. Changes to the scope within a view, for examp
## Supported Versions
-- Tryton: 4.6+
-- Python: 3.6+
+- Tryton: 5.4+
+- Python: 3.7+
diff --git a/docs/platforms/python/integrations/wsgi/index.mdx b/docs/platforms/python/integrations/wsgi/index.mdx
index 30e7d312b1ec6..7844598a9df48 100644
--- a/docs/platforms/python/integrations/wsgi/index.mdx
+++ b/docs/platforms/python/integrations/wsgi/index.mdx
@@ -97,6 +97,6 @@ Each request has a separate scope. Changes to the scope within a view, for examp
## Supported Versions
-- Python: 3.6+
+- Python: 3.7+
diff --git a/docs/platforms/python/migration/2.x-to-3.x.mdx b/docs/platforms/python/migration/2.x-to-3.x.mdx
new file mode 100644
index 0000000000000..f0a0070f90e8e
--- /dev/null
+++ b/docs/platforms/python/migration/2.x-to-3.x.mdx
@@ -0,0 +1,198 @@
+---
+title: Migrate from 2.x to 3.x
+sidebar_order: 8997
+description: "Learn about migrating from sentry-python 2.x to 3.x"
+---
+
+This guide describes the common patterns involved in migrating to version 3.x of the `sentry-python` SDK.
+
+The top-level API stays the same for the most part, but `3.0` drops a number of older dependency versions, removes APIs that were deprecated in `2.x`, and stops auto-enabling some integrations. This guide captures the changes that will affect most users. For the full list, check out the [detailed migration guide in the repository](https://github.com/getsentry/sentry-python/blob/master/MIGRATION_GUIDE.md).
+
+## Python Version Support
+
+Sentry Python SDK `3.0` requires Python 3.7 or higher. If you're on Python 3.6, stay on `2.x`.
+
+Because `contextvars` is always available on Python 3.7+, you no longer need the `aiocontextvars` backport. You can drop it from your dependencies.
+
+## Dependency Support
+
+`3.0` raises the minimum supported version of many instrumented packages. If you're below one of these, the SDK won't instrument that package anymore:
+
+| Package | Minimum |
+| ------------- | ------- |
+| aiohttp | 3.7 |
+| Celery | 5.0 |
+| Chalice | 1.22 |
+| Django | 2.0 |
+| Falcon | 3.0 |
+| FastAPI | 0.85 |
+| Flask | 2.0 |
+| gevent | 20.9 |
+| greenlet | 0.4.17 |
+| huey | 2.0 |
+| Litestar | 2.0 |
+| MCP | 2.0 |
+| OpenAI Agents | 0.10.3 |
+| Pydantic AI | 1.76 |
+| Pyramid | 2.0 |
+| PySpark | 3.0 |
+| Quart | 0.19 |
+| redis-py | 4.2 |
+| RQ | 1.0 |
+| Sanic | 22.0 |
+| SQLAlchemy | 1.4 |
+| Starlette | 0.20 |
+| trytond | 5.4 |
+
+## Install Extras
+
+Most `sentry-sdk[extra-name]` extras were removed. Install the base package instead — there's no difference in functionality:
+
+```bash diff
+- pip install "sentry-sdk[flask]"
++ pip install "sentry-sdk"
+```
+
+The `asyncio`, `flask`, `grpcio`, `http2`, `opentelemetry-otlp`, `pure-eval`, and `quart` extras remain, because those integrations need additional dependencies.
+
+## Configuration Options
+
+Several options were removed:
+
+```python diff
+import sentry_sdk
+
+sentry_sdk.init(
+ dsn="___PUBLIC_DSN___",
+
+ # Replace enable_tracing
+- enable_tracing=True,
++ traces_sample_rate=1.0,
+
+ # Sentry's logging API now works without opting in
+- enable_logs=True,
+
+ # Replace propagate_traces
+- propagate_traces=False,
++ trace_propagation_targets=[],
+
+ # Replace continuous_profiling_mode
+- _experiments={"continuous_profiling_mode": "thread"},
++ profiler_mode="thread",
+)
+```
+
+`enable_metrics`, `stream_gen_ai_spans`, `trace_ignore_status_codes`, and the experimental `max_spans`, `otel_powered_performance`, and `suppress_asgi_chained_exceptions` options were also removed. The experimental `before_send_log`, `before_send_metric`, `before_send_span`, and `ignore_spans` options are now top-level options of the same name.
+
+`attach_stacktrace` now defaults to `True`, so the SDK attaches stack traces to messages unless you turn it off.
+
+The `failed_request_status_codes` integration option now only accepts a set of integers. Lists and other containers are no longer supported.
+
+`sentry_sdk.init()` can no longer be used as a context manager.
+
+## Integrations That No Longer Auto-Enable
+
+The standard library `logging`, Loguru, and Strawberry integrations are no longer turned on for you. Add the ones you need to `integrations`:
+
+```python diff
+import sentry_sdk
+from sentry_sdk.integrations.logging import LoggingIntegration
+from sentry_sdk.integrations.loguru import LoguruIntegration
+from sentry_sdk.integrations.strawberry import StrawberryIntegration
+
+sentry_sdk.init(
+ dsn="___PUBLIC_DSN___",
++ integrations=[
++ LoggingIntegration(),
++ LoguruIntegration(),
++ StrawberryIntegration(async_execution=True), # or False
++ ],
+)
+```
+
+`StrawberryIntegration` requires you to set `async_execution` explicitly, to either `True` or `False` depending on whether your app is async or sync.
+
+Going the other way, `UnraisablehookIntegration` is now a default integration, so exceptions raised in places like `__del__` finalizers are reported without any setup.
+
+## Logging and Loguru Options
+
+Both logging integrations were reorganized around Sentry logs. Enabling either one now captures Sentry logs and breadcrumbs, and creates events only if you opt in with `event_level`.
+
+| Old name | New name | Old default | New default | What it does |
+| --------------------- | ------------------ | ----------- | ----------- | ------------------------------------------------------ |
+| `sentry_logs_level` | `level` | `INFO` | `INFO` | Captures logs of that level and higher as Sentry logs. |
+| `level` | `breadcrumb_level` | `INFO` | `INFO` | Captures logs of that level and higher as breadcrumbs. |
+| `event_level` | `event_level` | `ERROR` | `None` | Captures logs of that level and higher as events. |
+| `capture_sentry_logs` | removed | `False` | n/a | Use `level=None` to opt out of capturing Sentry logs. |
+
+```python diff
+import logging
+import sentry_sdk
+from sentry_sdk.integrations.logging import LoggingIntegration
+
+sentry_sdk.init(
+ dsn="___PUBLIC_DSN___",
+ integrations=[
+ LoggingIntegration(
+- capture_sentry_logs=True,
+- sentry_logs_level=logging.INFO,
+- level=logging.INFO,
++ level=logging.INFO,
++ breadcrumb_level=logging.INFO,
+ event_level=logging.ERROR,
+ ),
+ ],
+)
+```
+
+The logger helpers in `sentry_sdk.integrations.logging` were renamed to match. `ignore_logger` now silences a logger for Sentry logs; use `ignore_logger_for_events` for the old behavior of silencing breadcrumbs and events. The same applies to `unignore_logger` and `unignore_logger_for_events`. `SentryHandler` was removed — use `EventHandler`.
+
+See the logging and Loguru integration pages for the full current behavior.
+
+## Tracing
+
+Transactions are gone. All tracing now uses spans, and every span is streamed. The `trace_lifecycle` option was removed along with transaction mode — stream is the only mode, so there's nothing to set. If you have custom instrumentation built on `start_transaction`, `Transaction`, or `start_child`, follow the stream mode migration guide to update it.
+
+`update_current_span` and the deprecated `set_measurement` API were removed, and the `@trace` decorator no longer accepts a `template` parameter.
+
+Transaction-based profiling was removed along with transactions. Continuous profiling is the only mode, and `start_profile_session` and `stop_profile_session` are now `start_profiler` and `stop_profiler`.
+
+## Scopes
+
+`push_scope` and `configure_scope` were deprecated in `2.x` and are now removed, along with the `Hub` class and every hub-based API.
+
+```python diff
+import sentry_sdk
+
+- with sentry_sdk.push_scope() as scope:
++ with sentry_sdk.new_scope() as scope:
+ scope.set_tag("key", "value")
+
+- with sentry_sdk.configure_scope() as scope:
+- scope.set_tag("key", "value")
++ scope = sentry_sdk.get_current_scope()
++ scope.set_tag("key", "value")
+```
+
+Direct assignment to `Scope.level` and `Scope.user` was removed. Use `Scope.set_level()` and `Scope.set_user()` instead. `Scope.iter_headers` was also removed.
+
+## OpenTelemetry
+
+`SentrySpanProcessor`, `SentryPropagator`, the `instrumenter` option, the `SentryPropagator` entry point, and the `opentelemetry` and `opentelemetry-experimental` extras were all removed. Use the OTLP integration instead.
+
+## Other Behavior Changes
+
+- The FastAPI and Starlette integrations no longer eagerly read the request body. It's only included in events if your handler already parsed it with `Request.json()` or `Request.form()` before the event was captured.
+- The ASGI and asyncio integrations no longer suppress chained exceptions by default.
+- The SDK no longer sets any tags on its own.
+- `SanicIntegration` no longer accepts `unsampled_statuses`.
+- The `RedisIntegration` `max_data_size` option and the `LangchainIntegration` `max_spans` option were removed.
+- `LaunchDarklyIntegration` no longer accepts a specific client.
+- The Django Spotlight integration was removed.
+- `ThreadingIntegration` no longer accepts the deprecated `propagate_hub` parameter. Use `propagate_scope`.
+- The deprecated `@ai_track` decorator and the `auto_session_tracing` decorator were removed. Use `track_session` in place of the latter.
+- Deprecation warnings are now always emitted with `warnings.warn()`; other warnings use `logger.warning()`.
+
+## Transport
+
+`Transport.capture_event` and function transports were removed. Custom transports must subclass `sentry_sdk.transport.Transport` and implement `capture_envelope`. `Baggage.from_options` and `configure_debug_hub` were also removed.
diff --git a/docs/platforms/python/tracing/configure-sampling/index.mdx b/docs/platforms/python/tracing/configure-sampling/index.mdx
index 3594e5cfdec6b..dec118c29eef1 100644
--- a/docs/platforms/python/tracing/configure-sampling/index.mdx
+++ b/docs/platforms/python/tracing/configure-sampling/index.mdx
@@ -111,7 +111,6 @@ def traces_sampler(sampling_context: SamplingContext) -> float:
sentry_sdk.init(
# ...
traces_sampler=traces_sampler,
- trace_lifecycle="stream",
)
```
@@ -204,7 +203,6 @@ def traces_sampler(sampling_context: SamplingContext) -> float:
sentry_sdk.init(
# ...
traces_sampler=traces_sampler,
- trace_lifecycle="stream",
)
# Custom attributes need to be set on the scope, after continue_trace
@@ -300,7 +298,6 @@ def traces_sampler(sampling_context: SamplingContext) -> float:
sentry_sdk.init(
# ...
traces_sampler=traces_sampler,
- trace_lifecycle="stream",
)
# To set custom attributes for this example:
@@ -417,7 +414,6 @@ def traces_sampler(sampling_context: SamplingContext) -> float:
sentry_sdk.init(
# ...
traces_sampler=traces_sampler,
- trace_lifecycle="stream",
)
# To set custom attributes for this example:
@@ -518,7 +514,6 @@ def traces_sampler(sampling_context: SamplingContext) -> float:
sentry_sdk.init(
# ...
traces_sampler=traces_sampler,
- trace_lifecycle="stream",
)
# To set custom attributes for this example:
diff --git a/docs/platforms/python/tracing/streamed-spans/index.mdx b/docs/platforms/python/tracing/streamed-spans/index.mdx
index 777c17dfd7aeb..00b75dfbf2445 100644
--- a/docs/platforms/python/tracing/streamed-spans/index.mdx
+++ b/docs/platforms/python/tracing/streamed-spans/index.mdx
@@ -48,40 +48,10 @@ You need:
- Tracing configured in
your app
-- Sentry SDK `>=2.62.0`
-## Enable Stream Mode
+## Span Flushing
-
-
-
-
-Opt in by adding the `trace_lifecycle` option when initializing the SDK:
-
-
-
-
-```python
-import sentry_sdk
-
-sentry_sdk.init(
- dsn="___PUBLIC_DSN___",
- traces_sample_rate=1.0,
- # enables stream mode
- trace_lifecycle="stream",
-)
-
-```
-
-
-
-
-
-To revert to transaction mode, remove the `trace_lifecycle` option or set it to `"static"` (the default).
-
-
-
-When stream mode is enabled, the SDK maintains an internal buffer that groups spans by trace ID.
+The SDK maintains an internal buffer that groups spans by trace ID.
Spans are flushed:
@@ -91,8 +61,6 @@ Spans are flushed:
Each flush sends only the spans accumulated since the last flush, grouped into envelopes by trace ID.
-
-
## Manual Instrumentation (Optional)
### Start a Span
@@ -337,7 +305,6 @@ def postprocess_span(span, hint):
sentry_sdk.init(
dsn="___PUBLIC_DSN___",
traces_sample_rate=1.0,
- trace_lifecycle="stream",
before_send_span=postprocess_span,
)
```
@@ -370,7 +337,6 @@ import sentry_sdk
sentry_sdk.init(
dsn="___PUBLIC_DSN___",
traces_sample_rate=1.0,
- trace_lifecycle="stream",
ignore_spans=[
# String match against span name
"/health",
diff --git a/docs/platforms/python/tracing/streamed-spans/migration-guide.mdx b/docs/platforms/python/tracing/streamed-spans/migration-guide.mdx
index 4f61b11d1dc9f..45b1afd62a60f 100644
--- a/docs/platforms/python/tracing/streamed-spans/migration-guide.mdx
+++ b/docs/platforms/python/tracing/streamed-spans/migration-guide.mdx
@@ -4,23 +4,15 @@ sidebar_order: 10
description: "Learn how to migrate your custom instrumentation from transaction mode to stream mode."
---
-Stream mode requires the streamed Span API. If you use custom instrumentation (creating spans manually, setting span data, or filtering spans) you'll need to update that code before you can switch to stream mode. This guide walks through the changes.
+Stream mode uses the streamed Span API. If you use custom instrumentation (creating spans manually, setting span data, or filtering spans) you'll need to update that code. This guide walks through the changes.
For an introduction to stream mode itself, see Streamed Spans.
-## Enable Stream Mode
+
-Add the `trace_lifecycle` option when initializing the SDK:
+Stream mode is the only mode — there's nothing to turn on. Transactions were removed in SDK `3.0`.
-```python diff
-import sentry_sdk
-
-sentry_sdk.init(
- dsn="___PUBLIC_DSN___",
- traces_sample_rate=1.0,
-+ trace_lifecycle="stream",
-)
-```
+
## Span Creation
@@ -194,7 +186,6 @@ def traces_sampler(sampling_context):
sentry_sdk.init(
traces_sampler=traces_sampler,
- trace_lifecycle="stream",
)
```
@@ -230,7 +221,6 @@ sentry_sdk.init(
dsn="___PUBLIC_DSN___",
traces_sample_rate=1.0,
- before_send_transaction=my_filter,
-+ trace_lifecycle="stream",
+ ignore_spans=[
+ "/health",
+ re.compile(r"^GET /api/v1/internal"),
diff --git a/docs/platforms/python/troubleshooting.mdx b/docs/platforms/python/troubleshooting.mdx
index f0ff2fb88f678..6d709c51666a3 100644
--- a/docs/platforms/python/troubleshooting.mdx
+++ b/docs/platforms/python/troubleshooting.mdx
@@ -69,17 +69,11 @@ Use the information in this page to help answer these questions:
#### Python 3: Context Variables or Thread Locals
Python 3 introduced `asyncio`, which, just like Twisted, had the problem of not
- having any concept of attaching contextual data to your control flow. That
- means in Python 3.6 and lower, the SDK is not able to prevent leaks of
- contextual data.
+ having any concept of attaching contextual data to your control flow.
Python 3.7 rectified this problem with the `contextvars` stdlib module which is
- basically thread locals that also work in asyncio-based code. The SDK will
- attempt to use that module instead of thread locals if available.
-
- **For Python 3.6 and older, install `aiocontextvars` from PyPI** which is a
- fully-functional backport of `contextvars`. The SDK will check for this package
- and use it instead of thread locals.
+ basically thread locals that also work in asyncio-based code. The SDK uses that
+ module instead of thread locals.
diff --git a/platform-includes/configuration/before-send-span/python.mdx b/platform-includes/configuration/before-send-span/python.mdx
index f4f55869e99cf..ebbfd4c2cb710 100644
--- a/platform-includes/configuration/before-send-span/python.mdx
+++ b/platform-includes/configuration/before-send-span/python.mdx
@@ -12,7 +12,6 @@ def postprocess_span(span, hint):
return span
sentry_sdk.init(
- trace_lifecycle="stream",
before_send_span=postprocess_span,
)
```
diff --git a/platform-includes/performance/dropping-spans/python.mdx b/platform-includes/performance/dropping-spans/python.mdx
index a5c0f017fc65c..3c5def4d652f4 100644
--- a/platform-includes/performance/dropping-spans/python.mdx
+++ b/platform-includes/performance/dropping-spans/python.mdx
@@ -7,7 +7,6 @@ import re
import sentry_sdk
sentry_sdk.init(
- trace_lifecycle="stream",
ignore_spans=[
# String match against span name
"/health",
diff --git a/platform-includes/performance/traces-sampler-as-sampler/python.mdx b/platform-includes/performance/traces-sampler-as-sampler/python.mdx
index f3a388c4a9410..1a69946120968 100644
--- a/platform-includes/performance/traces-sampler-as-sampler/python.mdx
+++ b/platform-includes/performance/traces-sampler-as-sampler/python.mdx
@@ -61,6 +61,5 @@ def traces_sampler(sampling_context: SamplingContext) -> float:
sentry_sdk.init(
# ...
traces_sampler=traces_sampler,
- trace_lifecycle="stream",
)
```
diff --git a/platform-includes/tracing/span-metrics/add-all-spans/python.mdx b/platform-includes/tracing/span-metrics/add-all-spans/python.mdx
index 9cf5ddfd9c867..0efab97889eaa 100644
--- a/platform-includes/tracing/span-metrics/add-all-spans/python.mdx
+++ b/platform-includes/tracing/span-metrics/add-all-spans/python.mdx
@@ -48,7 +48,6 @@ def before_send_span(span, hint):
sentry_sdk.init(
# ...
- trace_lifecycle="stream",
before_send_span=before_send_span,
)
```