Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions docs/platforms/python/agent-tracing/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Link to="/product/agents/conversations/">Conversations</Link>).

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 <PlatformLink to="/agent-tracing/manual-instrumentation/">manual instrumentation</PlatformLink>.
Expand Down
4 changes: 2 additions & 2 deletions docs/platforms/python/agent-tracing/openai-agents/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The support for **OpenAI Agents SDK** is in its beta phase. Please test locally
</Alert>

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.

<AgentSetupCallout skill="sentry-setup-ai-monitoring" platformName="Python" />

Expand Down Expand Up @@ -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+
4 changes: 2 additions & 2 deletions docs/platforms/python/agent-tracing/pydantic-ai/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The support for **Pydantic AI** is in beta. Please test locally before using in
</Alert>

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.

Expand Down Expand Up @@ -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+
1 change: 0 additions & 1 deletion docs/platforms/python/configuration/filtering/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ import re
import sentry_sdk

sentry_sdk.init(
trace_lifecycle="stream",
ignore_spans=[
# String match against span name
"/health",
Expand Down
60 changes: 0 additions & 60 deletions docs/platforms/python/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ def before_send_span(span, hint):

sentry_sdk.init(
# ...
trace_lifecycle="stream",
before_send_span=before_send_span,
)
```
Expand Down Expand Up @@ -410,23 +409,8 @@ If you want to disable all tracing you need to set `traces_sample_rate=None`. In

<PlatformContent includePath="/performance/traces-sampler-config-option" />

<SdkOption name="trace_lifecycle" type='string' defaultValue='"static"' availableSince='2.62.0'>

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 <PlatformLink to="/tracing/streamed-spans/">stream mode</PlatformLink> (`"stream"`), spans are sent in batches as they finish.

</SdkOption>

<SdkOption name="ignore_spans" type='list[str | Pattern | dict]' defaultValue='[]' availableSince='2.62.0'>

<Alert>

Only available in <PlatformLink to="/tracing/streamed-spans">stream mode</PlatformLink>.

</Alert>

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.
Expand All @@ -441,7 +425,6 @@ import re
import sentry_sdk

sentry_sdk.init(
trace_lifecycle="stream",
ignore_spans=[
# String match against span name
"/health",
Expand Down Expand Up @@ -551,16 +534,6 @@ The threshold in milliseconds for adding the source location to an outgoing HTTP

</SdkOption>

<SdkOption name="trace_ignore_status_codes" type='bool' defaultValue='frozenset()'>

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.

</SdkOption>

<SdkOption name="custom_repr" type='function' defaultValue='None'>

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.
Expand Down Expand Up @@ -619,39 +592,6 @@ A number between `0` and `1`, controlling the percentage chance a given session

</SdkOption>

<SdkOption name="stream_gen_ai_spans" type='bool' defaultValue='True' defaultNote='since version 2.64.0' availableSince='2.60.0'>

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.

</SdkOption>

## Logs Options

<SdkOption name="enable_logs" type='bool' defaultValue='False'>

**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.

</SdkOption>

## Experimental Options

<Alert level="warning">
Expand Down
4 changes: 1 addition & 3 deletions docs/platforms/python/enriching-events/attributes/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ Attribute values can be `str`, `int`, `float`, or `bool`, as well as arrays of t

<Alert level="info">

Attributes on spans require <PlatformLink to="/tracing/streamed-spans">stream mode</PlatformLink> (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()`.

</Alert>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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+
12 changes: 1 addition & 11 deletions docs/platforms/python/integrations/aiohttp/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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+
4 changes: 2 additions & 2 deletions docs/platforms/python/integrations/boto3/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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+`

<StepConnector selector="h2" showNumbers={true}>

Expand Down
6 changes: 2 additions & 4 deletions docs/platforms/python/integrations/bottle/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<Include name="python-stream-mode-general-callout.mdx" />

Expand Down Expand Up @@ -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+

<Include name="python-use-older-sdk-for-legacy-support.mdx" />
12 changes: 2 additions & 10 deletions docs/platforms/python/integrations/celery/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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+`

<StepConnector selector="h2" showNumbers={true}>

Expand Down Expand Up @@ -203,14 +203,6 @@ my_task_b.apply_async(
</SplitSection>
</SplitLayout>

<Alert level="warning" title="Note on distributed tracing for Celery versions 4.x">

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.

</Alert>

</OnboardingOption>

## Verify Your Setup
Expand Down
4 changes: 2 additions & 2 deletions docs/platforms/python/integrations/chalice/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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+
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 14 additions & 6 deletions docs/platforms/python/integrations/default-integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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`_
Expand Down Expand Up @@ -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`_
Expand Down
10 changes: 2 additions & 8 deletions docs/platforms/python/integrations/django/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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+`

<Alert>

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/).

</Alert>
- Django `2.0+`
- Python `3.7+`

<StepConnector selector="h2" showNumbers={true}>

Expand Down
4 changes: 2 additions & 2 deletions docs/platforms/python/integrations/dramatiq/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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+

<Include name="python-use-older-sdk-for-legacy-support.mdx" />
6 changes: 3 additions & 3 deletions docs/platforms/python/integrations/falcon/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<Include name="python-stream-mode-general-callout.mdx" />

Expand Down Expand Up @@ -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+

<Include name="python-use-older-sdk-for-legacy-support.mdx" />
2 changes: 1 addition & 1 deletion docs/platforms/python/integrations/fastapi/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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+`

<StepConnector selector="h2" showNumbers={true}>
Expand Down
4 changes: 2 additions & 2 deletions docs/platforms/python/integrations/flask/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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+`

<StepConnector selector="h2" showNumbers={true}>

Expand Down
2 changes: 1 addition & 1 deletion docs/platforms/python/integrations/grpc/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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+

<Include name="python-use-older-sdk-for-legacy-support.mdx" />
2 changes: 1 addition & 1 deletion docs/platforms/python/integrations/httpx/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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+`

<StepConnector selector="h2" showNumbers={true}>

Expand Down
2 changes: 1 addition & 1 deletion docs/platforms/python/integrations/huey/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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+

<Include name="python-use-older-sdk-for-legacy-support.mdx" />
Loading
Loading