From 545ce3354e5f2636a75a3ca49606f0a423646cc6 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Wed, 21 Oct 2026 13:27:20 +0200 Subject: [PATCH 1/4] docs(python): Add data_collection alternatives to integration docs Integration and AI agent pages only described send_default_pii. Document the data_collection key that controls each behavior instead: - Web frameworks: mention data_collection next to send_default_pii - Django, Flask: user_info - Redis, PyMongo, clickhouse-driver: database_query_data - GQL, Graphene, Ariadne, Strawberry: graphql and http_bodies - MCP and agent tracing: gen_ai, and that include_prompts is ignored when data_collection is set - Rust Tracing: data_collection doesn't affect include_tracing_fields Also fix the http_bodies docs in Data Collected: outgoing_response is a valid body type and part of the default. --- .../python/agent-tracing/anthropic/index.mdx | 14 ++++++++++ .../agent-tracing/google-genai/index.mdx | 14 ++++++++++ .../agent-tracing/huggingface_hub/index.mdx | 14 ++++++++++ docs/platforms/python/agent-tracing/index.mdx | 16 ++++++++++- .../python/agent-tracing/langchain/index.mdx | 14 ++++++++++ .../python/agent-tracing/langgraph/index.mdx | 2 ++ .../python/agent-tracing/litellm/index.mdx | 14 ++++++++++ .../python/agent-tracing/mistral/index.mdx | 12 ++++++++ .../agent-tracing/openai-agents/index.mdx | 14 ++++++++++ .../python/agent-tracing/openai/index.mdx | 14 ++++++++++ .../agent-tracing/pydantic-ai/index.mdx | 14 ++++++++++ .../python/data-management/data-collected.mdx | 6 ++-- .../python/integrations/ariadne/index.mdx | 28 +++++++++++++++---- .../python/integrations/asgi/index.mdx | 2 +- .../manual-instrumentation/index.mdx | 2 +- .../python/integrations/bottle/index.mdx | 2 +- .../python/integrations/chalice/index.mdx | 2 +- .../integrations/clickhouse-driver/index.mdx | 2 +- .../python/integrations/django/index.mdx | 2 +- .../python/integrations/falcon/index.mdx | 2 +- .../python/integrations/fastapi/index.mdx | 2 +- .../python/integrations/flask/index.mdx | 2 +- .../integrations/gcp-functions/index.mdx | 2 +- .../python/integrations/gql/index.mdx | 25 +++++++++++++---- .../python/integrations/graphene/index.mdx | 23 ++++++++++++--- .../python/integrations/mcp/index.mdx | 20 +++++++++++-- .../python/integrations/pymongo/index.mdx | 2 +- .../python/integrations/pyramid/index.mdx | 2 +- .../python/integrations/quart/index.mdx | 2 +- .../python/integrations/redis/index.mdx | 2 +- .../integrations/rust_tracing/index.mdx | 2 ++ .../python/integrations/sanic/index.mdx | 2 +- .../python/integrations/serverless/index.mdx | 2 +- .../python/integrations/starlette/index.mdx | 2 +- .../python/integrations/strawberry/index.mdx | 25 ++++++++++++++--- .../python/integrations/tornado/index.mdx | 2 +- .../python/integrations/tryton/index.mdx | 2 +- .../python/integrations/wsgi/index.mdx | 2 +- 38 files changed, 265 insertions(+), 46 deletions(-) diff --git a/docs/platforms/python/agent-tracing/anthropic/index.mdx b/docs/platforms/python/agent-tracing/anthropic/index.mdx index 0536774383c1f..32c9d7eb7e9a9 100644 --- a/docs/platforms/python/agent-tracing/anthropic/index.mdx +++ b/docs/platforms/python/agent-tracing/anthropic/index.mdx @@ -70,6 +70,18 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. + Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: + + ```python + sentry_sdk.init( + # ... + data_collection={ + # Record LLM inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, + ) + ``` + ## Options By adding `AnthropicIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `AnthropicIntegration` to change its behavior: @@ -97,6 +109,8 @@ You can pass the following keyword arguments to `AnthropicIntegration()`: Whether LLM inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + The default is `True`. ## Supported Versions diff --git a/docs/platforms/python/agent-tracing/google-genai/index.mdx b/docs/platforms/python/agent-tracing/google-genai/index.mdx index 2a9c185c599a1..2d7053d5475eb 100644 --- a/docs/platforms/python/agent-tracing/google-genai/index.mdx +++ b/docs/platforms/python/agent-tracing/google-genai/index.mdx @@ -83,6 +83,18 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. + Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: + + ```python + sentry_sdk.init( + # ... + data_collection={ + # Record LLM inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, + ) + ``` + ## Options You can set options for `GoogleGenAIIntegration` to change its behavior: @@ -110,6 +122,8 @@ You can pass the following keyword arguments to `GoogleGenAIIntegration()`: Whether LLM inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + The default is `True`. ## Supported Versions diff --git a/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx b/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx index 308b4522b23c8..4d10b8f42e0ca 100644 --- a/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx +++ b/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx @@ -102,6 +102,18 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. + Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: + + ```python + sentry_sdk.init( + # ... + data_collection={ + # Record LLM inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, + ) + ``` + ## Options By adding `HuggingfaceHubIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `HuggingfaceHubIntegration` to change its behavior: @@ -129,6 +141,8 @@ You can pass the following keyword arguments to `HuggingfaceHubIntegration()`: Whether LLM and tokenizer inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + The default is `True`. ## Supported Versions diff --git a/docs/platforms/python/agent-tracing/index.mdx b/docs/platforms/python/agent-tracing/index.mdx index a983557512fd9..500ba6168ad9a 100644 --- a/docs/platforms/python/agent-tracing/index.mdx +++ b/docs/platforms/python/agent-tracing/index.mdx @@ -13,7 +13,7 @@ With Sentry Agent Tracing, you can ## Getting Started -Enable tracing. Supported AI libraries are instrumented automatically when their packages are installed. Prompt and response content is off by default — set `send_default_pii=True` to capture it (or configure `include_prompts` per integration). +Enable tracing. Supported AI libraries are instrumented automatically when their packages are installed. Prompt and response content is off by default — set `send_default_pii=True` to capture it (or configure `include_prompts` per integration), or use the `gen_ai` key of the `data_collection` option. ```python import sentry_sdk @@ -88,6 +88,20 @@ sentry_sdk.init( ) ``` +Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: + +```python +import sentry_sdk + +sentry_sdk.init( + dsn="___PUBLIC_DSN___", + data_collection={ + # Record LLM inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, +) +``` + See each integration page for the options that apply to your stack. ### Streaming Gen AI Spans diff --git a/docs/platforms/python/agent-tracing/langchain/index.mdx b/docs/platforms/python/agent-tracing/langchain/index.mdx index ef0a65978bfde..071fab02272a2 100644 --- a/docs/platforms/python/agent-tracing/langchain/index.mdx +++ b/docs/platforms/python/agent-tracing/langchain/index.mdx @@ -164,6 +164,18 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. + Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: + + ```python + sentry_sdk.init( + # ... + data_collection={ + # Record LLM inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, + ) + ``` + ## Options By adding `LangchainIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `LangchainIntegration` to change its behavior: @@ -191,6 +203,8 @@ You can pass the following keyword arguments to `LangchainIntegration()`: Whether LLM and tokenizer inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + The default is `True`. ## Supported Versions diff --git a/docs/platforms/python/agent-tracing/langgraph/index.mdx b/docs/platforms/python/agent-tracing/langgraph/index.mdx index a9a2aa0f40174..0a31cd4092991 100644 --- a/docs/platforms/python/agent-tracing/langgraph/index.mdx +++ b/docs/platforms/python/agent-tracing/langgraph/index.mdx @@ -124,6 +124,8 @@ You can pass the following keyword arguments to `LanggraphIntegration()`: Controls whether LLM inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + The default is `True`. ## Supported Versions diff --git a/docs/platforms/python/agent-tracing/litellm/index.mdx b/docs/platforms/python/agent-tracing/litellm/index.mdx index 3c110af96a172..b4245991dd9d3 100644 --- a/docs/platforms/python/agent-tracing/litellm/index.mdx +++ b/docs/platforms/python/agent-tracing/litellm/index.mdx @@ -84,6 +84,18 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. + Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: + + ```python + sentry_sdk.init( + # ... + data_collection={ + # Record LLM inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, + ) + ``` + ## Options By adding `LiteLLMIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `LiteLLMIntegration` to change its behavior: @@ -111,6 +123,8 @@ You can pass the following keyword arguments to `LiteLLMIntegration()`: Whether LLM inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + The default is `True`. ## Supported Versions diff --git a/docs/platforms/python/agent-tracing/mistral/index.mdx b/docs/platforms/python/agent-tracing/mistral/index.mdx index 7f46f22e57aa4..2c03dad582c79 100644 --- a/docs/platforms/python/agent-tracing/mistral/index.mdx +++ b/docs/platforms/python/agent-tracing/mistral/index.mdx @@ -89,6 +89,18 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. + Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default: + + ```python + sentry_sdk.init( + # ... + data_collection={ + # Record LLM inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, + ) + ``` + ## Supported Versions - Mistral AI (`mistralai`): 2.0.5+ diff --git a/docs/platforms/python/agent-tracing/openai-agents/index.mdx b/docs/platforms/python/agent-tracing/openai-agents/index.mdx index 27eee28342142..7d6a3b5b81e34 100644 --- a/docs/platforms/python/agent-tracing/openai-agents/index.mdx +++ b/docs/platforms/python/agent-tracing/openai-agents/index.mdx @@ -95,6 +95,18 @@ Data on the following will be collected: Sentry considers LLM and tool inputs/outputs as PII and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. +Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: + +```python +sentry_sdk.init( + # ... + data_collection={ + # Record LLM and tool inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, +) +``` + ## Options By adding `OpenAIAgentsIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `OpenAIAgentsIntegration` to change its behavior: @@ -122,6 +134,8 @@ You can pass the following keyword arguments to `OpenAIAgentsIntegration()`: Whether LLM and tool inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + The default is `True`. ## Supported Versions diff --git a/docs/platforms/python/agent-tracing/openai/index.mdx b/docs/platforms/python/agent-tracing/openai/index.mdx index 86d11124e7766..65ab17b779f2d 100644 --- a/docs/platforms/python/agent-tracing/openai/index.mdx +++ b/docs/platforms/python/agent-tracing/openai/index.mdx @@ -81,6 +81,18 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. + Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: + + ```python + sentry_sdk.init( + # ... + data_collection={ + # Record LLM inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, + ) + ``` + ## Options By adding `OpenAIIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `OpenAIIntegration` to change its behavior: @@ -109,6 +121,8 @@ You can pass the following keyword arguments to `OpenAIIntegration()`: Whether LLM and tokenizer inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + The default is `True`. - `tiktoken_encoding_name`: diff --git a/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx b/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx index 9289f13479102..aec16fd42fa39 100644 --- a/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx +++ b/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx @@ -213,6 +213,18 @@ Data on the following will be collected: Sentry considers LLM and tool inputs/outputs as PII and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the Options section below. +Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: + +```python +sentry_sdk.init( + # ... + data_collection={ + # Record LLM and tool inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, +) +``` + ## Options By adding `PydanticAIIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `PydanticAIIntegration` to change its behavior: @@ -240,6 +252,8 @@ You can pass the following keyword arguments to `PydanticAIIntegration()`: Whether LLM and tool inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + The default is `True`. - `handled_tool_call_exceptions`: diff --git a/docs/platforms/python/data-management/data-collected.mdx b/docs/platforms/python/data-management/data-collected.mdx index 76f8e740d8072..bed718ac5a216 100644 --- a/docs/platforms/python/data-management/data-collected.mdx +++ b/docs/platforms/python/data-management/data-collected.mdx @@ -161,7 +161,7 @@ The request body of incoming HTTP requests can be sent to Sentry. Whether it's s If you want to prevent bodies from being sent to Sentry altogether, set `max_request_body_size` to `"never"`. -When using `data_collection`, incoming and outgoing request bodies are collected by default. To disable body collection, set `http_bodies` to an empty list, or provide only the body types you want: +When using `data_collection`, incoming and outgoing request bodies, as well as outgoing response bodies, are collected by default. To disable body collection, set `http_bodies` to an empty list, or provide only the body types you want: ```python import sentry_sdk @@ -175,7 +175,7 @@ sentry_sdk.init( ) ``` -The valid body types are `"incoming_request"` and `"outgoing_request"`. The Python SDK doesn't capture response bodies, so there are no response body types. +The valid body types are `"incoming_request"`, `"outgoing_request"`, and `"outgoing_response"`. Currently, only the Ariadne and Strawberry integrations use `"outgoing_response"`, to attach the GraphQL response to error events. The Python SDK doesn't capture incoming response bodies. `max_request_body_size` still applies on top of `http_bodies`. @@ -300,7 +300,7 @@ sentry_sdk.init( | `user_info` | `bool` | `True` | Populate `user.*` fields (`id`, `email`, `username`, `ip_address`) from instrumentation. | | `cookies` | key-value behavior | `{"mode": "denylist"}` | Collect cookies. | | `http_headers` | `{"request": key-value behavior}` | `{"request": {"mode": "denylist"}}` | Collect HTTP request headers. The Python SDK currently doesn't capture response headers. | -| `http_bodies` | `list[str]` | `["incoming_request", "outgoing_request"]` | Body types to collect. Set to `[]` to disable. The Python SDK currently doesn't capture response bodies. | +| `http_bodies` | `list[str]` | `["incoming_request", "outgoing_request", "outgoing_response"]` | Body types to collect. Set to `[]` to disable. The Python SDK currently doesn't capture incoming response bodies. | | `url_query_params` | key-value behavior | `{"mode": "denylist"}` | Collect URL query parameters. | | `graphql` | `{"document": bool, "variables": bool}` | both `True` | Collect the GraphQL query document and its variables. | | `gen_ai` | `{"inputs": bool, "outputs": bool}` | both `True` | Collect generative AI input and output content. Metadata such as the model ID and token counts is always collected. | diff --git a/docs/platforms/python/integrations/ariadne/index.mdx b/docs/platforms/python/integrations/ariadne/index.mdx index 25c8f37b42b7b..7b72283143dea 100644 --- a/docs/platforms/python/integrations/ariadne/index.mdx +++ b/docs/platforms/python/integrations/ariadne/index.mdx @@ -78,12 +78,27 @@ This will create a corresponding `GraphQLError` in the Issues section of ## Options The Ariadne integration can capture request and response payload for each GraphQL -error that happens. Since these may contain sensitive data, the SDK needs to be -initialized with the -[send_default_pii](/platforms/python/configuration/options/#send-default-pii) -option set to `True`. +error that happens. Since these may contain sensitive data, no request and response +data will be attached by default. -By default, no request and response data will be attached. +To attach this data, use the `data_collection` option. The `graphql` key controls the query document and its variables in the request +payload, and the `outgoing_response` entry in `http_bodies` controls the response +payload: + +```python +sentry_sdk.init( + # same options as above + data_collection={ + "graphql": {"document": True, "variables": True}, + "http_bodies": ["incoming_request", "outgoing_request", "outgoing_response"], + }, +) +``` + +These are also the defaults when you pass a `data_collection` dictionary, so you only +need to set the keys you want to change. See Data Collected for all available keys. + +Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`: ```python sentry_sdk.init( @@ -96,7 +111,8 @@ sentry_sdk.init( Since `send_default_pii` is a global SDK option, setting it to `True` will affect all integrations, not just Ariadne. Please make sure to [scrub sensitive data](/platforms/python/data-management/sensitive-data/) -from events before enabling this option. +from events before enabling this option. With `data_collection`, you can enable +only the categories you need instead. diff --git a/docs/platforms/python/integrations/asgi/index.mdx b/docs/platforms/python/integrations/asgi/index.mdx index 22e2bebd6016b..0066d66511d06 100644 --- a/docs/platforms/python/integrations/asgi/index.mdx +++ b/docs/platforms/python/integrations/asgi/index.mdx @@ -102,7 +102,7 @@ Additionally, a transaction will show up in the "Performance" section on [sentry ## Behavior -- Request data is attached to all events: **HTTP method, URL, headers**. 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`. +- Request data is attached to all events: **HTTP method, URL, headers**. 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` or configure which categories to collect with the `data_collection` option. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx b/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx index 4675d89591cbb..7ab3d3db498e4 100644 --- a/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx +++ b/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx @@ -95,7 +95,7 @@ With the AWS Lambda integration enabled, the Python SDK will: You can add more data as described here. -- Request data including **HTTP method, URL, headers, form data, and JSON payloads** will be attached to all events. Sentry excludes raw bodies and multipart file uploads. Sentry also excludes personally identifiable information such as user ids, usernames, cookies, authorization headers, and IP addresses (unless you set `send_default_pii` to `True`). +- Request data including **HTTP method, URL, headers, form data, and JSON payloads** will be attached to all events. Sentry excludes raw bodies and multipart file uploads. Sentry also excludes personally identifiable information such as user ids, usernames, cookies, authorization headers, and IP addresses, unless you set `send_default_pii` to `True` or configure which categories to collect with the `data_collection` option. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/bottle/index.mdx b/docs/platforms/python/integrations/bottle/index.mdx index 2ee76609557e0..8690a07fc5b8a 100644 --- a/docs/platforms/python/integrations/bottle/index.mdx +++ b/docs/platforms/python/integrations/bottle/index.mdx @@ -54,7 +54,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to an Internal Server Error are reported. -- 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`. +- 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` or configure which categories to collect with the `data_collection` option. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/chalice/index.mdx b/docs/platforms/python/integrations/chalice/index.mdx index 8b54681be4d30..90c55411d5f13 100644 --- a/docs/platforms/python/integrations/chalice/index.mdx +++ b/docs/platforms/python/integrations/chalice/index.mdx @@ -43,7 +43,7 @@ When you enter the `"/"` route or the scheduled task is run, an error event will ## Behavior -- 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. +- 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` or configure which categories to collect with the `data_collection` option. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/clickhouse-driver/index.mdx b/docs/platforms/python/integrations/clickhouse-driver/index.mdx index cecfb707cf04d..462bb8edc42c4 100644 --- a/docs/platforms/python/integrations/clickhouse-driver/index.mdx +++ b/docs/platforms/python/integrations/clickhouse-driver/index.mdx @@ -27,7 +27,7 @@ If you have the `clickhouse-driver` package in your dependencies, the clickhouse -By default, the parameters of the query are not retrieved. To see the query parameters in Sentry, enable `send_default_pii`. See Basic Options for details. +By default, the parameters of the query are not retrieved. To see the query parameters in Sentry, enable `send_default_pii`, or enable `database_query_data` in the `data_collection` option. ## Verify diff --git a/docs/platforms/python/integrations/django/index.mdx b/docs/platforms/python/integrations/django/index.mdx index 574b1ad3771d3..6c1e54c0623ed 100644 --- a/docs/platforms/python/integrations/django/index.mdx +++ b/docs/platforms/python/integrations/django/index.mdx @@ -76,7 +76,7 @@ To further customize your setup, review the [Options section](#options) below. Sentry automatically captures errors and reports issues for you. You can also expect the following for your Django project: -- If you use `django.contrib.auth`, and you've set `send_default_pii=True` in your call to `init`, user data (such as current user ID, email address, username) will be attached to error events. +- If you use `django.contrib.auth`, and you've either set `send_default_pii=True` in your call to `init` or enabled `user_info` in the `data_collection` option, user data (such as current user ID, email address, username) will be attached to error events. - Request data will be attached to all events: **HTTP method, URL, headers, form data, JSON payloads**. Sentry excludes raw bodies and multipart file uploads. - Logs emitted by any logger will be recorded as breadcrumbs by the [Logging](/platforms/python/integrations/logging/) integration (this integration is enabled by default). diff --git a/docs/platforms/python/integrations/falcon/index.mdx b/docs/platforms/python/integrations/falcon/index.mdx index cf55207a13aeb..82cd5363a408c 100644 --- a/docs/platforms/python/integrations/falcon/index.mdx +++ b/docs/platforms/python/integrations/falcon/index.mdx @@ -57,7 +57,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to an Internal Server Error are reported. -- 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`. +- 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` or configure which categories to collect with the `data_collection` option. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/fastapi/index.mdx b/docs/platforms/python/integrations/fastapi/index.mdx index 7b7752cdcec82..69bc085f0a5df 100644 --- a/docs/platforms/python/integrations/fastapi/index.mdx +++ b/docs/platforms/python/integrations/fastapi/index.mdx @@ -59,7 +59,7 @@ You can also expect the following for your FastAPI project: - By default, all exceptions leading to an Internal Server Error are captured and reported. The HTTP status codes to report on are configurable via the `failed_request_status_codes` [option](#options). - Request data will be 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`. +- Sentry also excludes personally identifiable information (such as user ids, usernames, cookies, authorization headers, IP addresses) unless you set `send_default_pii` to `True` or configure which categories to collect with the `data_collection` option. To learn how to manually report issues, see Capturing Errors. diff --git a/docs/platforms/python/integrations/flask/index.mdx b/docs/platforms/python/integrations/flask/index.mdx index 970c6ccd891a7..e33092a012f94 100644 --- a/docs/platforms/python/integrations/flask/index.mdx +++ b/docs/platforms/python/integrations/flask/index.mdx @@ -59,7 +59,7 @@ To further customize your setup, review the [Options section](#options) below. Sentry automatically captures errors and reports issues for you. You can also expect the following for your Flask app: -- If you use `flask-login`, and you've set `send_default_pii=True` in your call to `init`, user data (such as current user ID, email address, username) will be attached to error events. +- If you use `flask-login`, and you've either set `send_default_pii=True` in your call to `init` or enabled `user_info` in the `data_collection` option, user data (such as current user ID, email address, username) will be attached to error events. - Request data will be attached to all events: HTTP method, URL, headers, form data, JSON payloads. Sentry excludes raw bodies and multipart file uploads. - Logs emitted by any `app.logger` or _any_ logger will be recorded by the [Logging](/platforms/python/integrations/logging/) integration (this integration is enabled by default). diff --git a/docs/platforms/python/integrations/gcp-functions/index.mdx b/docs/platforms/python/integrations/gcp-functions/index.mdx index 9b35ef21b0ec1..ef4b9fdc3db0c 100644 --- a/docs/platforms/python/integrations/gcp-functions/index.mdx +++ b/docs/platforms/python/integrations/gcp-functions/index.mdx @@ -105,6 +105,6 @@ With the Google Cloud Functions integration enabled, the Python SDK will: - Function configured time (in seconds) - You can add more data as described here -- 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`. +- 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` or configure which categories to collect with the `data_collection` option. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/gql/index.mdx b/docs/platforms/python/integrations/gql/index.mdx index 83dabd42c16e2..da079a5356c8e 100644 --- a/docs/platforms/python/integrations/gql/index.mdx +++ b/docs/platforms/python/integrations/gql/index.mdx @@ -28,17 +28,24 @@ If you have the `gql` package in your dependencies, the GQL integration will be ## Data Privacy and the GQL Integration -To ensure data privacy, the SDK avoids sending any information that may potentially contain personally identifiable information (PII) by default. See the docs for the [`send_default_pii` flag](/platforms/python/configuration/options/#send-default-pii) for more information. +To ensure data privacy, the SDK avoids sending any information that may potentially contain personally identifiable information (PII) by default. See the docs for the `data_collection` and `send_default_pii` options for more information. -For the GQL integration, this policy means that the SDK **doesn't send** the GraphQL queries and the `errors` information that the GraphQL server returns, unless you override the default configuration via the `send_default_pii` flag. +For the GQL integration, this policy means that the SDK **doesn't send** the GraphQL queries and the `errors` information that the GraphQL server returns, unless you override the default configuration. - +To have Sentry record the GraphQL queries and the `errors` information returned by the GraphQL server, enable the `graphql` key of the `data_collection` option in your SDK init. The `document` key controls the queries and the `errors` information, and the `variables` key controls the query variables: -Before enabling the `send_default_pii` flag, ensure you've configured Sentry's [sensitive data scrubbing](/platforms/python/data-management/sensitive-data/) tools to scrub all PII. +```python +sentry_sdk.init( + # ... + data_collection={ + "graphql": {"document": True, "variables": True}, + }, +) +``` - +These are also the defaults when you pass a `data_collection` dictionary. See Data Collected for all available keys. -To have Sentry record the GraphQL queries and the `errors` information returned by the GraphQL server, add the following to your SDK init: +Alternatively, you can set `send_default_pii` to `True`: ```python sentry_sdk.init( @@ -48,3 +55,9 @@ sentry_sdk.init( send_default_pii=True, ) ``` + + + +Before enabling the `send_default_pii` flag, ensure you've configured Sentry's [sensitive data scrubbing](/platforms/python/data-management/sensitive-data/) tools to scrub all PII. Since `send_default_pii` affects all integrations, consider using `data_collection` to enable only the categories you need instead. + + diff --git a/docs/platforms/python/integrations/graphene/index.mdx b/docs/platforms/python/integrations/graphene/index.mdx index 31a27b69e7acd..e3d99c4363771 100644 --- a/docs/platforms/python/integrations/graphene/index.mdx +++ b/docs/platforms/python/integrations/graphene/index.mdx @@ -62,10 +62,24 @@ by default. To capture request bodies: -- Initialize the SDK with the - [send_default_pii](/platforms/python/configuration/options/#send-default-pii) - option set to `True`. - Make sure the integration for the web framework you're using is enabled. +- Initialize the SDK with the `data_collection` option. The `graphql` key's `document` setting controls whether the GraphQL + request body is attached. If you set `http_bodies`, it must include + `incoming_request` so that your web framework integration captures the body + in the first place. + +```python +sentry_sdk.init( + # same options as above + data_collection={ + "graphql": {"document": True}, + }, +) +``` + +Both are enabled by default when you pass a `data_collection` dictionary. See Data Collected for all available keys. + +Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`: ```python sentry_sdk.init( @@ -81,7 +95,8 @@ sentry_sdk.init( Since `send_default_pii` is a global SDK option, setting it to `True` affects all integrations, not just Graphene. Please make sure to take care of [scrubbing sensitive data](/platforms/python/data-management/sensitive-data/) -from events before enabling this option. +from events before enabling this option. With `data_collection`, you can enable +only the categories you need instead. diff --git a/docs/platforms/python/integrations/mcp/index.mdx b/docs/platforms/python/integrations/mcp/index.mdx index 9c979a418cc82..64ba1d7c1b45f 100644 --- a/docs/platforms/python/integrations/mcp/index.mdx +++ b/docs/platforms/python/integrations/mcp/index.mdx @@ -195,6 +195,20 @@ Data on the following will be collected: Sentry considers tool inputs/outputs and prompt content as PII and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude this data despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. +Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default, and `include_prompts` is ignored: + +```python +sentry_sdk.init( + # ... + data_collection={ + # Collect tool and prompt inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, +) +``` + +Setting `inputs` to `False` removes the `mcp.request.argument.*` attributes from spans, and setting `outputs` to `False` removes tool results and prompt message content. + ### Captured Span Data For each operation, the following span data attributes are captured: @@ -208,7 +222,7 @@ For each operation, the following span data attributes are captured: **Tools:** - `mcp.tool.name`: The name of the tool being executed - `mcp.request.argument.*`: Tool input arguments -- `mcp.tool.result.content`: Tool output (when `send_default_pii=True`) +- `mcp.tool.result.content`: Tool output (when `send_default_pii=True`, or when `gen_ai.outputs` is enabled in `data_collection`) - `mcp.tool.result.is_error`: Whether the tool execution resulted in an error **Prompts:** @@ -216,7 +230,7 @@ For each operation, the following span data attributes are captured: - `mcp.request.argument.*`: Prompt input arguments - `mcp.prompt.result.message.count`: Number of messages in the prompt result - `mcp.prompt.result.message.role`: Role of the message (for single-message prompts) -- `mcp.prompt.result.message.content`: Message content (for single-message prompts, when `send_default_pii=True`) +- `mcp.prompt.result.message.content`: Message content (for single-message prompts, when `send_default_pii=True`, or when `gen_ai.outputs` is enabled in `data_collection`) **Resources:** - `mcp.resource.uri`: The URI of the resource being accessed @@ -249,6 +263,8 @@ You can pass the following keyword arguments to `MCPIntegration()`: Whether tool inputs/outputs and prompt content should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + The default is `True`. ## Supported Versions diff --git a/docs/platforms/python/integrations/pymongo/index.mdx b/docs/platforms/python/integrations/pymongo/index.mdx index 6eb54dff069c4..9707c997e8d22 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 unless you set `send_default_pii` to `True` or enable `database_query_data` in the `data_collection` option. (This was tested for PyMongo 4.2 and below, but "should" also be future proof) ### Other MongoDB libraries diff --git a/docs/platforms/python/integrations/pyramid/index.mdx b/docs/platforms/python/integrations/pyramid/index.mdx index 5f6b80953790b..2c25b6e2feb36 100644 --- a/docs/platforms/python/integrations/pyramid/index.mdx +++ b/docs/platforms/python/integrations/pyramid/index.mdx @@ -60,7 +60,7 @@ When you point your browser to [http://localhost:6543/](http://localhost:6543/) - exceptions that are not handled by any exception view - 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`. +- 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` or configure which categories to collect with the `data_collection` option. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/quart/index.mdx b/docs/platforms/python/integrations/quart/index.mdx index 7945c3a2773d6..71c95f4fd661b 100644 --- a/docs/platforms/python/integrations/quart/index.mdx +++ b/docs/platforms/python/integrations/quart/index.mdx @@ -52,7 +52,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to an Internal Server Error, from before/after serving functions, and background tasks are reported. -- Request data is attached to all events: **HTTP method, URL, headers**. Sentry also excludes personally identifiable information (such as user IDs, usernames, cookies, authorization headers, IP addresses) unless you set `send_default_pii` to `True`. +- Request data is attached to all events: **HTTP method, URL, headers**. Sentry also excludes personally identifiable information (such as user IDs, usernames, cookies, authorization headers, IP addresses) unless you set `send_default_pii` to `True` or configure which categories to collect with the `data_collection` option. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/redis/index.mdx b/docs/platforms/python/integrations/redis/index.mdx index 85548a6199279..a8375f6dab499 100644 --- a/docs/platforms/python/integrations/redis/index.mdx +++ b/docs/platforms/python/integrations/redis/index.mdx @@ -27,7 +27,7 @@ The following information will be available to you on Sentry: - Performance information about requests to Redis will be available in the waterfall diagram in the [Traces](https://sentry.io/orgredirect/organizations/:orgslug/explore/traces/) section on Sentry. - Redis commands will be added as [breadcrumbs](/product/issues/issue-details/breadcrumbs/). -- If `send_default_pii` is set to `True` in your app's `sentry_sdk.init()` call, you will also see the data used in your Redis commands. +- If `send_default_pii` is set to `True` in your app's `sentry_sdk.init()` call, or if you enable `database_query_data` in the `data_collection` option, you will also see the data used in your Redis commands. - Sentry will never collect data of the `AUTH` command. ## Verify Your Setup diff --git a/docs/platforms/python/integrations/rust_tracing/index.mdx b/docs/platforms/python/integrations/rust_tracing/index.mdx index 6bbbadc783af4..8e611fe332728 100644 --- a/docs/platforms/python/integrations/rust_tracing/index.mdx +++ b/docs/platforms/python/integrations/rust_tracing/index.mdx @@ -189,6 +189,8 @@ The `pyo3-python-tracing-subscriber` crate has [a working example of a Sentry in If it is `None`, this behavior will be controlled by the `send_default_pii` option set during SDK initialization. If it is `False`, field values will be redacted on Sentry spans. If it is `True`, field values will be included on Sentry spans. + The `data_collection` option doesn't affect this behavior. If you use `data_collection` and want field values on your spans, set `include_tracing_fields` to `True` explicitly. + The default value of this option is `None`. diff --git a/docs/platforms/python/integrations/sanic/index.mdx b/docs/platforms/python/integrations/sanic/index.mdx index 544edd9cf7c14..b0be1ec8ea8cd 100644 --- a/docs/platforms/python/integrations/sanic/index.mdx +++ b/docs/platforms/python/integrations/sanic/index.mdx @@ -123,7 +123,7 @@ When you point your browser to [http://localhost:8000/](http://localhost:8000/) - All exceptions leading to an Internal Server Error are reported. -- 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`. +- 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` or configure which categories to collect with the `data_collection` option. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/serverless/index.mdx b/docs/platforms/python/integrations/serverless/index.mdx index 08dd0a45cc6b6..a2bfa60047cc2 100644 --- a/docs/platforms/python/integrations/serverless/index.mdx +++ b/docs/platforms/python/integrations/serverless/index.mdx @@ -89,7 +89,7 @@ Now deploy your function. When you now run your function an error event will be - You can add more context as described here. -- 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`. +- 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` or configure which categories to collect with the `data_collection` option. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/starlette/index.mdx b/docs/platforms/python/integrations/starlette/index.mdx index f48f8c2937c43..3cb847e47c9f2 100644 --- a/docs/platforms/python/integrations/starlette/index.mdx +++ b/docs/platforms/python/integrations/starlette/index.mdx @@ -58,7 +58,7 @@ You can also expect the following for your Starlette project: - By default, all exceptions leading to an Internal Server Error are reported. The HTTP status codes to report on are configurable via the `failed_request_status_codes` [option](#options). - Request data will be 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`. +- Sentry also excludes personally identifiable information (such as user ids, usernames, cookies, authorization headers, IP addresses) unless you set `send_default_pii` to `True` or configure which categories to collect with the `data_collection` option. To learn how to manually report issues, see Capturing Errors. diff --git a/docs/platforms/python/integrations/strawberry/index.mdx b/docs/platforms/python/integrations/strawberry/index.mdx index c808028f585af..e6c5b7f5728e6 100644 --- a/docs/platforms/python/integrations/strawberry/index.mdx +++ b/docs/platforms/python/integrations/strawberry/index.mdx @@ -139,9 +139,25 @@ sentry_sdk.init( The Strawberry integration can capture request and response bodies for each GraphQL error that happens. Since these may contain sensitive data, -this is the default behavior. To enable capturing request and response bodies, the -SDK needs to be initialized with the -[send_default_pii](/platforms/python/configuration/options/#send-default-pii) option set to `True`. +this isn't the default behavior. + +To enable capturing request and response bodies, use the `data_collection` option. The `graphql` key controls the query document and its variables in the request +body, and the `outgoing_response` entry in `http_bodies` controls the response body: + +```python +sentry_sdk.init( + # ... + data_collection={ + "graphql": {"document": True, "variables": True}, + "http_bodies": ["incoming_request", "outgoing_request", "outgoing_response"], + }, +) +``` + +These are also the defaults when you pass a `data_collection` dictionary, so you only +need to set the keys you want to change. See Data Collected for all available keys. + +Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`: ```python sentry_sdk.init( @@ -155,7 +171,8 @@ sentry_sdk.init( Since `send_default_pii` is a global SDK option, setting it to `True` will affect all integrations, not just Strawberry. Please make sure to [remove sensitive data](/platforms/python/data-management/sensitive-data/) -from events before enabling this option. +from events before enabling this option. With `data_collection`, you can enable +only the categories you need instead. diff --git a/docs/platforms/python/integrations/tornado/index.mdx b/docs/platforms/python/integrations/tornado/index.mdx index 1ee3aabbd161e..f97e496d6fa52 100644 --- a/docs/platforms/python/integrations/tornado/index.mdx +++ b/docs/platforms/python/integrations/tornado/index.mdx @@ -61,7 +61,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to a Internal Server Error are reported. -- 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`. +- 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` or configure which categories to collect with the `data_collection` option. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/tryton/index.mdx b/docs/platforms/python/integrations/tryton/index.mdx index 0c198d334133a..2bbe9bc3c258b 100644 --- a/docs/platforms/python/integrations/tryton/index.mdx +++ b/docs/platforms/python/integrations/tryton/index.mdx @@ -80,7 +80,7 @@ def _(app, request, e): - All uncaught exceptions not inherited from Tryton exceptions are reported. -- 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`. +- 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` or configure which categories to collect with the `data_collection` option. Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/wsgi/index.mdx b/docs/platforms/python/integrations/wsgi/index.mdx index b63b9f59ab842..296023e266b53 100644 --- a/docs/platforms/python/integrations/wsgi/index.mdx +++ b/docs/platforms/python/integrations/wsgi/index.mdx @@ -89,7 +89,7 @@ make_server('', 8000, app).serve_forever() -- Request data is attached to all events: **HTTP method, URL, headers**. 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`. +- Request data is attached to all events: **HTTP method, URL, headers**. 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` or configure which categories to collect with the `data_collection` option. Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. From 8e42febfe87457ac50a6ea15dc78d7b9fe20b322 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Wed, 21 Oct 2026 13:50:18 +0200 Subject: [PATCH 2/4] docs(python): Mention data_collection first and note send_default_pii removal Wherever a page mentions both options, describe data_collection first and send_default_pii as the alternative, and note that send_default_pii will be removed in the next major version of the SDK. Also update the Options, Data Collected and Sensitive Data pages, which said send_default_pii would only be deprecated eventually. --- .../python/agent-tracing/anthropic/index.mdx | 10 ++++---- .../agent-tracing/google-genai/index.mdx | 10 ++++---- .../agent-tracing/huggingface_hub/index.mdx | 10 ++++---- docs/platforms/python/agent-tracing/index.mdx | 24 +++++++++---------- .../python/agent-tracing/langchain/index.mdx | 10 ++++---- .../python/agent-tracing/langgraph/index.mdx | 4 ++-- .../python/agent-tracing/litellm/index.mdx | 10 ++++---- .../python/agent-tracing/mistral/index.mdx | 6 ++--- .../agent-tracing/openai-agents/index.mdx | 10 ++++---- .../python/agent-tracing/openai/index.mdx | 10 ++++---- .../agent-tracing/pydantic-ai/index.mdx | 10 ++++---- .../python/configuration/options.mdx | 2 +- .../python/data-management/data-collected.mdx | 24 +++++++++---------- .../data-management/sensitive-data/index.mdx | 2 +- .../python/integrations/ariadne/index.mdx | 2 +- .../python/integrations/asgi/index.mdx | 2 +- .../manual-instrumentation/index.mdx | 2 +- .../python/integrations/bottle/index.mdx | 2 +- .../python/integrations/chalice/index.mdx | 2 +- .../integrations/clickhouse-driver/index.mdx | 2 +- .../python/integrations/django/index.mdx | 2 +- .../python/integrations/falcon/index.mdx | 2 +- .../python/integrations/fastapi/index.mdx | 2 +- .../python/integrations/flask/index.mdx | 2 +- .../integrations/gcp-functions/index.mdx | 2 +- .../python/integrations/gql/index.mdx | 2 +- .../python/integrations/graphene/index.mdx | 2 +- .../python/integrations/mcp/index.mdx | 14 +++++------ .../python/integrations/pymongo/index.mdx | 2 +- .../python/integrations/pyramid/index.mdx | 2 +- .../python/integrations/quart/index.mdx | 2 +- .../python/integrations/redis/index.mdx | 2 +- .../integrations/rust_tracing/index.mdx | 4 ++-- .../python/integrations/sanic/index.mdx | 2 +- .../python/integrations/serverless/index.mdx | 2 +- .../python/integrations/starlette/index.mdx | 2 +- .../python/integrations/strawberry/index.mdx | 2 +- .../python/integrations/tornado/index.mdx | 2 +- .../python/integrations/tryton/index.mdx | 2 +- .../python/integrations/wsgi/index.mdx | 2 +- 40 files changed, 104 insertions(+), 104 deletions(-) diff --git a/docs/platforms/python/agent-tracing/anthropic/index.mdx b/docs/platforms/python/agent-tracing/anthropic/index.mdx index 32c9d7eb7e9a9..0a047612d57ec 100644 --- a/docs/platforms/python/agent-tracing/anthropic/index.mdx +++ b/docs/platforms/python/agent-tracing/anthropic/index.mdx @@ -68,9 +68,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - The supported function is currently `messages.create` (both sync and async). -- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. - - Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( @@ -82,6 +80,8 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + ## Options By adding `AnthropicIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `AnthropicIntegration` to change its behavior: @@ -107,9 +107,9 @@ You can pass the following keyword arguments to `AnthropicIntegration()`: - `include_prompts`: - Whether LLM inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + Whether LLM inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/google-genai/index.mdx b/docs/platforms/python/agent-tracing/google-genai/index.mdx index 2d7053d5475eb..2f1d28c454fbc 100644 --- a/docs/platforms/python/agent-tracing/google-genai/index.mdx +++ b/docs/platforms/python/agent-tracing/google-genai/index.mdx @@ -81,9 +81,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - The supported function is currently `models.generate_content` (both sync and async). -- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. - - Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( @@ -95,6 +93,8 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + ## Options You can set options for `GoogleGenAIIntegration` to change its behavior: @@ -120,9 +120,9 @@ You can pass the following keyword arguments to `GoogleGenAIIntegration()`: - `include_prompts`: - Whether LLM inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + Whether LLM inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx b/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx index 4d10b8f42e0ca..f675453b07f86 100644 --- a/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx +++ b/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx @@ -100,9 +100,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - All exceptions are reported. -- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. - - Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( @@ -114,6 +112,8 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + ## Options By adding `HuggingfaceHubIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `HuggingfaceHubIntegration` to change its behavior: @@ -139,9 +139,9 @@ You can pass the following keyword arguments to `HuggingfaceHubIntegration()`: - `include_prompts` - Whether LLM and tokenizer inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + Whether LLM and tokenizer inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/index.mdx b/docs/platforms/python/agent-tracing/index.mdx index 500ba6168ad9a..9b13803ab889f 100644 --- a/docs/platforms/python/agent-tracing/index.mdx +++ b/docs/platforms/python/agent-tracing/index.mdx @@ -13,7 +13,7 @@ With Sentry Agent Tracing, you can ## Getting Started -Enable tracing. Supported AI libraries are instrumented automatically when their packages are installed. Prompt and response content is off by default — set `send_default_pii=True` to capture it (or configure `include_prompts` per integration), or use the `gen_ai` key of the `data_collection` option. +Enable tracing. Supported AI libraries are instrumented automatically when their packages are installed. Prompt and response content is off by default — use the `gen_ai` key of the `data_collection` option to capture it. Alternatively, set `send_default_pii=True` (and configure `include_prompts` per integration). `send_default_pii` will be removed in the next major version of the SDK. ```python import sentry_sdk @@ -73,32 +73,32 @@ Any of `id`, `email`, or `username` is sufficient — the Conversations tab disp ### Privacy Controls -LLM inputs and outputs are treated as PII and are **off** by default. Set `send_default_pii=True` to capture them. To keep other PII on but turn AI content off, set `include_prompts=False` on the integration: +LLM inputs and outputs are treated as PII and are **off** by default. To capture them, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python import sentry_sdk -from sentry_sdk.integrations.openai import OpenAIIntegration sentry_sdk.init( dsn="___PUBLIC_DSN___", - send_default_pii=True, - integrations=[ - OpenAIIntegration(include_prompts=False), - ], + data_collection={ + # Record LLM inputs, but not outputs + "gen_ai": {"inputs": True, "outputs": False}, + }, ) ``` -Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +Alternatively, set `send_default_pii=True` to capture them. To keep other PII on but turn AI content off, set `include_prompts=False` on the integration. `send_default_pii` will be removed in the next major version of the SDK. ```python import sentry_sdk +from sentry_sdk.integrations.openai import OpenAIIntegration sentry_sdk.init( dsn="___PUBLIC_DSN___", - data_collection={ - # Record LLM inputs, but not outputs - "gen_ai": {"inputs": True, "outputs": False}, - }, + send_default_pii=True, + integrations=[ + OpenAIIntegration(include_prompts=False), + ], ) ``` diff --git a/docs/platforms/python/agent-tracing/langchain/index.mdx b/docs/platforms/python/agent-tracing/langchain/index.mdx index 071fab02272a2..453ac09fc3d05 100644 --- a/docs/platforms/python/agent-tracing/langchain/index.mdx +++ b/docs/platforms/python/agent-tracing/langchain/index.mdx @@ -162,9 +162,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - All exceptions are reported. -- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. - - Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( @@ -176,6 +174,8 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + ## Options By adding `LangchainIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `LangchainIntegration` to change its behavior: @@ -201,9 +201,9 @@ You can pass the following keyword arguments to `LangchainIntegration()`: - `include_prompts` - Whether LLM and tokenizer inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + Whether LLM and tokenizer inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/langgraph/index.mdx b/docs/platforms/python/agent-tracing/langgraph/index.mdx index 0a31cd4092991..7724aa6debcc0 100644 --- a/docs/platforms/python/agent-tracing/langgraph/index.mdx +++ b/docs/platforms/python/agent-tracing/langgraph/index.mdx @@ -122,9 +122,9 @@ You can pass the following keyword arguments to `LanggraphIntegration()`: - `include_prompts` - Controls whether LLM inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + Controls whether LLM inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/litellm/index.mdx b/docs/platforms/python/agent-tracing/litellm/index.mdx index b4245991dd9d3..619e76e03fe83 100644 --- a/docs/platforms/python/agent-tracing/litellm/index.mdx +++ b/docs/platforms/python/agent-tracing/litellm/index.mdx @@ -82,9 +82,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - The supported functions are currently `completion` and `embedding` (both sync and async). -- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. - - Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( @@ -96,6 +94,8 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + ## Options By adding `LiteLLMIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `LiteLLMIntegration` to change its behavior: @@ -121,9 +121,9 @@ You can pass the following keyword arguments to `LiteLLMIntegration()`: - `include_prompts`: - Whether LLM inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + Whether LLM inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/mistral/index.mdx b/docs/platforms/python/agent-tracing/mistral/index.mdx index 2c03dad582c79..367bf5fdc196a 100644 --- a/docs/platforms/python/agent-tracing/mistral/index.mdx +++ b/docs/platforms/python/agent-tracing/mistral/index.mdx @@ -87,9 +87,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - The supported functions are currently `Chat.complete` and `Chat.complete_async` (sync and async). Streaming completions (`stream=True`) are not instrumented. -- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. - - Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default: +- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default: ```python sentry_sdk.init( @@ -101,6 +99,8 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. `send_default_pii` will be removed in the next major version of the SDK. + ## Supported Versions - Mistral AI (`mistralai`): 2.0.5+ diff --git a/docs/platforms/python/agent-tracing/openai-agents/index.mdx b/docs/platforms/python/agent-tracing/openai-agents/index.mdx index 7d6a3b5b81e34..f7c6791e6598a 100644 --- a/docs/platforms/python/agent-tracing/openai-agents/index.mdx +++ b/docs/platforms/python/agent-tracing/openai-agents/index.mdx @@ -93,9 +93,7 @@ Data on the following will be collected: - number of input and output tokens used - LLM models usage -Sentry considers LLM and tool inputs/outputs as PII and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. - -Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +Sentry considers LLM and tool inputs/outputs as PII and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( @@ -107,6 +105,8 @@ sentry_sdk.init( ) ``` +Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + ## Options By adding `OpenAIAgentsIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `OpenAIAgentsIntegration` to change its behavior: @@ -132,9 +132,9 @@ You can pass the following keyword arguments to `OpenAIAgentsIntegration()`: - `include_prompts`: - Whether LLM and tool inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + Whether LLM and tool inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/openai/index.mdx b/docs/platforms/python/agent-tracing/openai/index.mdx index 65ab17b779f2d..0f02e8b6093a0 100644 --- a/docs/platforms/python/agent-tracing/openai/index.mdx +++ b/docs/platforms/python/agent-tracing/openai/index.mdx @@ -79,9 +79,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - The supported modules are currently `responses.create`, `chat.completions.create`, and `embeddings.create`. -- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. - - Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( @@ -93,6 +91,8 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + ## Options By adding `OpenAIIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `OpenAIIntegration` to change its behavior: @@ -119,9 +119,9 @@ You can pass the following keyword arguments to `OpenAIIntegration()`: - `include_prompts`: - Whether LLM and tokenizer inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + Whether LLM and tokenizer inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx b/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx index aec16fd42fa39..b67c1dd346e38 100644 --- a/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx +++ b/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx @@ -211,9 +211,7 @@ Data on the following will be collected: - LLM models usage - model settings (temperature, max_tokens, etc.) -Sentry considers LLM and tool inputs/outputs as PII and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the Options section below. - -Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +Sentry considers LLM and tool inputs/outputs as PII and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( @@ -225,6 +223,8 @@ sentry_sdk.init( ) ``` +Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the Options section below. `send_default_pii` will be removed in the next major version of the SDK. + ## Options By adding `PydanticAIIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `PydanticAIIntegration` to change its behavior: @@ -250,9 +250,9 @@ You can pass the following keyword arguments to `PydanticAIIntegration()`: - `include_prompts`: - Whether LLM and tool inputs and outputs should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + Whether LLM and tool inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. The default is `True`. diff --git a/docs/platforms/python/configuration/options.mdx b/docs/platforms/python/configuration/options.mdx index bc0c4c535fcf9..5f12eb885a77a 100644 --- a/docs/platforms/python/configuration/options.mdx +++ b/docs/platforms/python/configuration/options.mdx @@ -102,7 +102,7 @@ If this flag is enabled, [certain personally identifiable information (PII)](/pl If you enable this option, be sure to manually remove what you don't want to send using our features for managing [_Sensitive Data_](../../data-management/sensitive-data/). - We plan to eventually deprecate `send_default_pii` in favor of the [`data_collection`](#data_collection) option, but that won't happen until a future major version. Until then, `send_default_pii` remains fully supported. + `send_default_pii` will be removed in the next major version of the SDK. Use the [`data_collection`](#data_collection) option instead. If you set both, `send_default_pii` is ignored entirely and the SDK emits a `DeprecationWarning`. diff --git a/docs/platforms/python/data-management/data-collected.mdx b/docs/platforms/python/data-management/data-collected.mdx index bed718ac5a216..7c3e27c70f68f 100644 --- a/docs/platforms/python/data-management/data-collected.mdx +++ b/docs/platforms/python/data-management/data-collected.mdx @@ -12,7 +12,7 @@ The category types and amount of data collected vary, depending on the integrati You can control many of the categories listed here with the `data_collection` option, which lets you opt in or out of each data category individually. -The `send_default_pii` option is still fully supported. We plan to eventually deprecate it in favor of `data_collection`, but that won't happen until a future major version. +The `send_default_pii` option is still supported, but `send_default_pii` will be removed in the next major version of the SDK. How much data the SDK collects by default depends on which option you use. Without `data_collection` (and with `send_default_pii` unset or `False`), the SDK collects conservatively, and the defaults described on this page apply. @@ -28,8 +28,6 @@ Regardless of these options, you can always scrub any data before it's sent to S By default, the Sentry SDK sends HTTP request headers to Sentry but filters out any headers that contain sensitive data. (See the [list of headers](https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/_wsgi_common.py#L28-L35) that are filtered). The Python SDK doesn't capture response headers. -To send all HTTP headers, set `send_default_pii=True` in the `sentry_sdk.init()` call. - When using `data_collection`, request headers are collected with sensitive values scrubbed. Use `http_headers` to control this: ```python @@ -50,14 +48,14 @@ sentry_sdk.init( Values whose keys match Sentry's built-in sensitive denylist (such as `auth`, `token`, or `password`) are always scrubbed, while the keys are kept. See [Key-Value Collection Behavior](#key-value-collection-behavior) below for details on `mode` and `terms`. +If you use `send_default_pii` instead, set it to `True` in the `sentry_sdk.init()` call to send all HTTP headers. + Additionally a [data scrubber](/platforms/python/data-management/sensitive-data/) removes sensitive data from headers (and a lot of other fields) right before sending data to Sentry. ## Cookies By default, the Sentry SDK doesn't send cookies. Sentry tries to remove any cookies that contain sensitive information, such as the Session ID and CSRF Token cookies in Django. -If you want to send cookies, set `send_default_pii=True` in the `sentry_sdk.init()` call. - When using `data_collection`, cookies are collected by default with sensitive values scrubbed. Opt out with `{"mode": "off"}`, or restrict which values are sent using `"allowlist"` or `"denylist"` mode: ```python @@ -71,14 +69,14 @@ sentry_sdk.init( ) ``` +If you use `send_default_pii` instead, set it to `True` in the `sentry_sdk.init()` call to send cookies. + Additionally a [data scrubber](/platforms/python/data-management/sensitive-data/) removes sensitive data from cookies (and a lot of other fields) right before sending data to Sentry. ## Information About Logged-in User By default, the Sentry SDK doesn't send any information about the logged-in user, such as email address, user ID, or username. Even if enabled, the type of logged-in user information you'll be able to send depends on the integrations you enable in Sentry's SDK. Most integrations won't send any user information. Some will only set the user ID, but there are a few that will set the user ID, username, and email address. -To start sending logged-in user information, set `send_default_pii=True` in the `sentry_sdk.init()` call. - When using `data_collection`, the SDK populates user identity fields (`user.id`, `user.email`, `user.username`) from instrumentation by default. To disable this, set `user_info` to `False`: ```python @@ -92,12 +90,12 @@ sentry_sdk.init( ) ``` +If you use `send_default_pii` instead, set it to `True` in the `sentry_sdk.init()` call to start sending logged-in user information. + ## Users' IP Address By default, the Sentry SDK doesn't send the user's IP address. Even if enabled, whether you're able to send the user's IP address or not, will depend on the integrations you enable in Sentry's SDK. Most integrations won't set the user's IP address at all. -To enable sending the user's IP address, set `send_default_pii=True` in the `sentry_sdk.init()` call. - When using `data_collection`, the user's IP address is sent by default. Disable it by setting `user_info` to `False`. Even when this is disabled, IP addresses can still reach Sentry through collected HTTP headers, cookies, or query parameters (for example, the `X-Forwarded-For` header). If you use `data_collection`, add these terms to the deny lists for those categories so their values are filtered: @@ -126,6 +124,8 @@ sentry_sdk.init( ) ``` +If you use `send_default_pii` instead, set it to `True` in the `sentry_sdk.init()` call to send the user's IP address. + ## Request URL The full request URL of outgoing and incoming HTTP requests is **always sent to Sentry**. Depending on your application, this could contain PII data. @@ -272,9 +272,7 @@ Without `data_collection` (and with `send_default_pii` unset or `False`), this d ## LLM Inputs And Responses -When using Sentry in your AI apps, the SDK by default won't add data like LLM inputs and responses to spans. To start recording these, add `send_default_pii=True` to your `sentry_sdk.init()` call. - -Most AI integrations have an additional parameter to control whether prompts should be included called `include_prompts`. See the documentation for the specific AI framework for more information. +When using Sentry in your AI apps, the SDK by default won't add data like LLM inputs and responses to spans. When using `data_collection`, the `gen_ai` category records both inputs and outputs unless you opt out. Metadata like the model ID and token counts is always collected. @@ -291,6 +289,8 @@ sentry_sdk.init( `gen_ai` supersedes the per-integration `include_prompts` parameter. When `data_collection` is set, `gen_ai` determines whether prompt content is recorded, regardless of what an individual integration's `include_prompts` is set to. +If you use `send_default_pii` instead, add `send_default_pii=True` to your `sentry_sdk.init()` call to start recording LLM inputs and responses. Most AI integrations have an additional parameter to control whether prompts should be included called `include_prompts`. See the documentation for the specific AI framework for more information. + ## `data_collection` Reference ### Keys diff --git a/docs/platforms/python/data-management/sensitive-data/index.mdx b/docs/platforms/python/data-management/sensitive-data/index.mdx index e12b491821416..7eb97d6c9c4bd 100644 --- a/docs/platforms/python/data-management/sensitive-data/index.mdx +++ b/docs/platforms/python/data-management/sensitive-data/index.mdx @@ -33,7 +33,7 @@ Ensure that your team is aware of your company's policy around what can and cann The SDK can be configured to collect or ignore specific data using the [`data_collection`](../../configuration/options/#data_collection) option. -Alternately, you can use the simpler [`send_default_pii`](../../configuration/options/#send_default_pii) option by setting it to `True` or `False`. Note that this option will be phased out in favor of the more fine-grained [`data_collection`](../../configuration/options/#data_collection). +Alternately, you can use the simpler [`send_default_pii`](../../configuration/options/#send_default_pii) option by setting it to `True` or `False`. Note that `send_default_pii` will be removed in the next major version of the SDK in favor of the more fine-grained [`data_collection`](../../configuration/options/#data_collection). If you _do not_ wish to use the default PII behavior, you can also choose to identify users in a more controlled manner, using our [user identity context](../../enriching-events/identify-user/). diff --git a/docs/platforms/python/integrations/ariadne/index.mdx b/docs/platforms/python/integrations/ariadne/index.mdx index 7b72283143dea..a8c496c4d3fe6 100644 --- a/docs/platforms/python/integrations/ariadne/index.mdx +++ b/docs/platforms/python/integrations/ariadne/index.mdx @@ -98,7 +98,7 @@ sentry_sdk.init( These are also the defaults when you pass a `data_collection` dictionary, so you only need to set the keys you want to change. See Data Collected for all available keys. -Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`: +Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`, though `send_default_pii` will be removed in the next major version of the SDK: ```python sentry_sdk.init( diff --git a/docs/platforms/python/integrations/asgi/index.mdx b/docs/platforms/python/integrations/asgi/index.mdx index 0066d66511d06..958519e5131ba 100644 --- a/docs/platforms/python/integrations/asgi/index.mdx +++ b/docs/platforms/python/integrations/asgi/index.mdx @@ -102,7 +102,7 @@ Additionally, a transaction will show up in the "Performance" section on [sentry ## Behavior -- Request data is attached to all events: **HTTP method, URL, headers**. 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` or configure which categories to collect with the `data_collection` option. +- Request data is attached to all events: **HTTP method, URL, headers**. 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx b/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx index 7ab3d3db498e4..90f7aba9fc1c3 100644 --- a/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx +++ b/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx @@ -95,7 +95,7 @@ With the AWS Lambda integration enabled, the Python SDK will: You can add more data as described here. -- Request data including **HTTP method, URL, headers, form data, and JSON payloads** will be attached to all events. Sentry excludes raw bodies and multipart file uploads. Sentry also excludes personally identifiable information such as user ids, usernames, cookies, authorization headers, and IP addresses, unless you set `send_default_pii` to `True` or configure which categories to collect with the `data_collection` option. +- Request data including **HTTP method, URL, headers, form data, and JSON payloads** will be attached to all events. Sentry excludes raw bodies and multipart file uploads. Sentry also excludes personally identifiable information such as user ids, usernames, cookies, authorization headers, and IP addresses, unless you configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/bottle/index.mdx b/docs/platforms/python/integrations/bottle/index.mdx index 8690a07fc5b8a..8cc876389da9e 100644 --- a/docs/platforms/python/integrations/bottle/index.mdx +++ b/docs/platforms/python/integrations/bottle/index.mdx @@ -54,7 +54,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to an Internal Server Error are reported. -- 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` or configure which categories to collect with the `data_collection` option. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/chalice/index.mdx b/docs/platforms/python/integrations/chalice/index.mdx index 90c55411d5f13..b700d95e273a3 100644 --- a/docs/platforms/python/integrations/chalice/index.mdx +++ b/docs/platforms/python/integrations/chalice/index.mdx @@ -43,7 +43,7 @@ When you enter the `"/"` route or the scheduled task is run, an error event will ## Behavior -- 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` or configure which categories to collect with the `data_collection` option. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/clickhouse-driver/index.mdx b/docs/platforms/python/integrations/clickhouse-driver/index.mdx index 462bb8edc42c4..144405bf163a3 100644 --- a/docs/platforms/python/integrations/clickhouse-driver/index.mdx +++ b/docs/platforms/python/integrations/clickhouse-driver/index.mdx @@ -27,7 +27,7 @@ If you have the `clickhouse-driver` package in your dependencies, the clickhouse -By default, the parameters of the query are not retrieved. To see the query parameters in Sentry, enable `send_default_pii`, or enable `database_query_data` in the `data_collection` option. +By default, the parameters of the query are not retrieved. To see the query parameters in Sentry, enable `database_query_data` in the `data_collection` option, or enable `send_default_pii`. `send_default_pii` will be removed in the next major version of the SDK. ## Verify diff --git a/docs/platforms/python/integrations/django/index.mdx b/docs/platforms/python/integrations/django/index.mdx index 6c1e54c0623ed..9fa2435051b89 100644 --- a/docs/platforms/python/integrations/django/index.mdx +++ b/docs/platforms/python/integrations/django/index.mdx @@ -76,7 +76,7 @@ To further customize your setup, review the [Options section](#options) below. Sentry automatically captures errors and reports issues for you. You can also expect the following for your Django project: -- If you use `django.contrib.auth`, and you've either set `send_default_pii=True` in your call to `init` or enabled `user_info` in the `data_collection` option, user data (such as current user ID, email address, username) will be attached to error events. +- If you use `django.contrib.auth`, and you've either enabled `user_info` in the `data_collection` option or set `send_default_pii=True` in your call to `init`, user data (such as current user ID, email address, username) will be attached to error events. `send_default_pii` will be removed in the next major version of the SDK. - Request data will be attached to all events: **HTTP method, URL, headers, form data, JSON payloads**. Sentry excludes raw bodies and multipart file uploads. - Logs emitted by any logger will be recorded as breadcrumbs by the [Logging](/platforms/python/integrations/logging/) integration (this integration is enabled by default). diff --git a/docs/platforms/python/integrations/falcon/index.mdx b/docs/platforms/python/integrations/falcon/index.mdx index 82cd5363a408c..c5b925c74d365 100644 --- a/docs/platforms/python/integrations/falcon/index.mdx +++ b/docs/platforms/python/integrations/falcon/index.mdx @@ -57,7 +57,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to an Internal Server Error are reported. -- 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` or configure which categories to collect with the `data_collection` option. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/fastapi/index.mdx b/docs/platforms/python/integrations/fastapi/index.mdx index 69bc085f0a5df..b0a022429f56b 100644 --- a/docs/platforms/python/integrations/fastapi/index.mdx +++ b/docs/platforms/python/integrations/fastapi/index.mdx @@ -59,7 +59,7 @@ You can also expect the following for your FastAPI project: - By default, all exceptions leading to an Internal Server Error are captured and reported. The HTTP status codes to report on are configurable via the `failed_request_status_codes` [option](#options). - Request data will be 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` or configure which categories to collect with the `data_collection` option. +- Sentry also excludes personally identifiable information (such as user ids, usernames, cookies, authorization headers, IP addresses) unless you configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. To learn how to manually report issues, see Capturing Errors. diff --git a/docs/platforms/python/integrations/flask/index.mdx b/docs/platforms/python/integrations/flask/index.mdx index e33092a012f94..60332553295b6 100644 --- a/docs/platforms/python/integrations/flask/index.mdx +++ b/docs/platforms/python/integrations/flask/index.mdx @@ -59,7 +59,7 @@ To further customize your setup, review the [Options section](#options) below. Sentry automatically captures errors and reports issues for you. You can also expect the following for your Flask app: -- If you use `flask-login`, and you've either set `send_default_pii=True` in your call to `init` or enabled `user_info` in the `data_collection` option, user data (such as current user ID, email address, username) will be attached to error events. +- If you use `flask-login`, and you've either enabled `user_info` in the `data_collection` option or set `send_default_pii=True` in your call to `init`, user data (such as current user ID, email address, username) will be attached to error events. `send_default_pii` will be removed in the next major version of the SDK. - Request data will be attached to all events: HTTP method, URL, headers, form data, JSON payloads. Sentry excludes raw bodies and multipart file uploads. - Logs emitted by any `app.logger` or _any_ logger will be recorded by the [Logging](/platforms/python/integrations/logging/) integration (this integration is enabled by default). diff --git a/docs/platforms/python/integrations/gcp-functions/index.mdx b/docs/platforms/python/integrations/gcp-functions/index.mdx index ef4b9fdc3db0c..5508c342c027c 100644 --- a/docs/platforms/python/integrations/gcp-functions/index.mdx +++ b/docs/platforms/python/integrations/gcp-functions/index.mdx @@ -105,6 +105,6 @@ With the Google Cloud Functions integration enabled, the Python SDK will: - Function configured time (in seconds) - You can add more data as described here -- 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` or configure which categories to collect with the `data_collection` option. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/gql/index.mdx b/docs/platforms/python/integrations/gql/index.mdx index da079a5356c8e..51d48c0db2d7c 100644 --- a/docs/platforms/python/integrations/gql/index.mdx +++ b/docs/platforms/python/integrations/gql/index.mdx @@ -45,7 +45,7 @@ sentry_sdk.init( These are also the defaults when you pass a `data_collection` dictionary. See Data Collected for all available keys. -Alternatively, you can set `send_default_pii` to `True`: +Alternatively, you can set `send_default_pii` to `True`, though `send_default_pii` will be removed in the next major version of the SDK: ```python sentry_sdk.init( diff --git a/docs/platforms/python/integrations/graphene/index.mdx b/docs/platforms/python/integrations/graphene/index.mdx index e3d99c4363771..a3558b69125cd 100644 --- a/docs/platforms/python/integrations/graphene/index.mdx +++ b/docs/platforms/python/integrations/graphene/index.mdx @@ -79,7 +79,7 @@ sentry_sdk.init( Both are enabled by default when you pass a `data_collection` dictionary. See Data Collected for all available keys. -Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`: +Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`, though `send_default_pii` will be removed in the next major version of the SDK: ```python sentry_sdk.init( diff --git a/docs/platforms/python/integrations/mcp/index.mdx b/docs/platforms/python/integrations/mcp/index.mdx index 64ba1d7c1b45f..2ee6d588935ee 100644 --- a/docs/platforms/python/integrations/mcp/index.mdx +++ b/docs/platforms/python/integrations/mcp/index.mdx @@ -193,9 +193,7 @@ Data on the following will be collected: - **Request context**: Request IDs, session IDs, and transport types (stdio/HTTP) - **Execution spans**: Timing information for all handler invocations -Sentry considers tool inputs/outputs and prompt content as PII and doesn't include PII data by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude this data despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. - -Alternatively, use the `gen_ai` key of the `data_collection` option to control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default, and `include_prompts` is ignored: +Sentry considers tool inputs/outputs and prompt content as PII and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default, and `include_prompts` is ignored: ```python sentry_sdk.init( @@ -209,6 +207,8 @@ sentry_sdk.init( Setting `inputs` to `False` removes the `mcp.request.argument.*` attributes from spans, and setting `outputs` to `False` removes tool results and prompt message content. +Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude this data despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + ### Captured Span Data For each operation, the following span data attributes are captured: @@ -222,7 +222,7 @@ For each operation, the following span data attributes are captured: **Tools:** - `mcp.tool.name`: The name of the tool being executed - `mcp.request.argument.*`: Tool input arguments -- `mcp.tool.result.content`: Tool output (when `send_default_pii=True`, or when `gen_ai.outputs` is enabled in `data_collection`) +- `mcp.tool.result.content`: Tool output (when `gen_ai.outputs` is enabled in `data_collection`, or when `send_default_pii=True`) - `mcp.tool.result.is_error`: Whether the tool execution resulted in an error **Prompts:** @@ -230,7 +230,7 @@ For each operation, the following span data attributes are captured: - `mcp.request.argument.*`: Prompt input arguments - `mcp.prompt.result.message.count`: Number of messages in the prompt result - `mcp.prompt.result.message.role`: Role of the message (for single-message prompts) -- `mcp.prompt.result.message.content`: Message content (for single-message prompts, when `send_default_pii=True`, or when `gen_ai.outputs` is enabled in `data_collection`) +- `mcp.prompt.result.message.content`: Message content (for single-message prompts, when `gen_ai.outputs` is enabled in `data_collection`, or when `send_default_pii=True`) **Resources:** - `mcp.resource.uri`: The URI of the resource being accessed @@ -261,9 +261,9 @@ You can pass the following keyword arguments to `MCPIntegration()`: - `include_prompts`: - Whether tool inputs/outputs and prompt content should be sent to Sentry. Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. + Whether tool inputs/outputs and prompt content should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. The default is `True`. diff --git a/docs/platforms/python/integrations/pymongo/index.mdx b/docs/platforms/python/integrations/pymongo/index.mdx index 9707c997e8d22..823732d55f1d0 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 unless you set `send_default_pii` to `True` or enable `database_query_data` in the `data_collection` option. (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 unless you enable `database_query_data` in the `data_collection` option or set `send_default_pii` to `True`. (This was tested for PyMongo 4.2 and below, but "should" also be future proof) `send_default_pii` will be removed in the next major version of the SDK. ### Other MongoDB libraries diff --git a/docs/platforms/python/integrations/pyramid/index.mdx b/docs/platforms/python/integrations/pyramid/index.mdx index 2c25b6e2feb36..5ccfce4f15182 100644 --- a/docs/platforms/python/integrations/pyramid/index.mdx +++ b/docs/platforms/python/integrations/pyramid/index.mdx @@ -60,7 +60,7 @@ When you point your browser to [http://localhost:6543/](http://localhost:6543/) - exceptions that are not handled by any exception view - 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` or configure which categories to collect with the `data_collection` option. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/quart/index.mdx b/docs/platforms/python/integrations/quart/index.mdx index 71c95f4fd661b..cb259ca5dac49 100644 --- a/docs/platforms/python/integrations/quart/index.mdx +++ b/docs/platforms/python/integrations/quart/index.mdx @@ -52,7 +52,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to an Internal Server Error, from before/after serving functions, and background tasks are reported. -- Request data is attached to all events: **HTTP method, URL, headers**. Sentry also excludes personally identifiable information (such as user IDs, usernames, cookies, authorization headers, IP addresses) unless you set `send_default_pii` to `True` or configure which categories to collect with the `data_collection` option. +- Request data is attached to all events: **HTTP method, URL, headers**. Sentry also excludes personally identifiable information (such as user IDs, usernames, cookies, authorization headers, IP addresses) unless you configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/redis/index.mdx b/docs/platforms/python/integrations/redis/index.mdx index a8375f6dab499..44abc89e4cb2c 100644 --- a/docs/platforms/python/integrations/redis/index.mdx +++ b/docs/platforms/python/integrations/redis/index.mdx @@ -27,7 +27,7 @@ The following information will be available to you on Sentry: - Performance information about requests to Redis will be available in the waterfall diagram in the [Traces](https://sentry.io/orgredirect/organizations/:orgslug/explore/traces/) section on Sentry. - Redis commands will be added as [breadcrumbs](/product/issues/issue-details/breadcrumbs/). -- If `send_default_pii` is set to `True` in your app's `sentry_sdk.init()` call, or if you enable `database_query_data` in the `data_collection` option, you will also see the data used in your Redis commands. +- If you enable `database_query_data` in the `data_collection` option, or set `send_default_pii` to `True` in your app's `sentry_sdk.init()` call, you will also see the data used in your Redis commands. `send_default_pii` will be removed in the next major version of the SDK. - Sentry will never collect data of the `AUTH` command. ## Verify Your Setup diff --git a/docs/platforms/python/integrations/rust_tracing/index.mdx b/docs/platforms/python/integrations/rust_tracing/index.mdx index 8e611fe332728..392063350bb4d 100644 --- a/docs/platforms/python/integrations/rust_tracing/index.mdx +++ b/docs/platforms/python/integrations/rust_tracing/index.mdx @@ -187,10 +187,10 @@ The `pyo3-python-tracing-subscriber` crate has [a working example of a Sentry in A boolean controlling whether the values of a `tracing` span's key-value fields will be attached to the corresponding Sentry span. - If it is `None`, this behavior will be controlled by the `send_default_pii` option set during SDK initialization. If it is `False`, field values will be redacted on Sentry spans. If it is `True`, field values will be included on Sentry spans. - The `data_collection` option doesn't affect this behavior. If you use `data_collection` and want field values on your spans, set `include_tracing_fields` to `True` explicitly. + If it is `None`, this behavior will be controlled by the `send_default_pii` option set during SDK initialization. If it is `False`, field values will be redacted on Sentry spans. If it is `True`, field values will be included on Sentry spans. `send_default_pii` will be removed in the next major version of the SDK. + The default value of this option is `None`. diff --git a/docs/platforms/python/integrations/sanic/index.mdx b/docs/platforms/python/integrations/sanic/index.mdx index b0be1ec8ea8cd..d59a9c436d2b8 100644 --- a/docs/platforms/python/integrations/sanic/index.mdx +++ b/docs/platforms/python/integrations/sanic/index.mdx @@ -123,7 +123,7 @@ When you point your browser to [http://localhost:8000/](http://localhost:8000/) - All exceptions leading to an Internal Server Error are reported. -- 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` or configure which categories to collect with the `data_collection` option. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/serverless/index.mdx b/docs/platforms/python/integrations/serverless/index.mdx index a2bfa60047cc2..498b5ad6e0cb2 100644 --- a/docs/platforms/python/integrations/serverless/index.mdx +++ b/docs/platforms/python/integrations/serverless/index.mdx @@ -89,7 +89,7 @@ Now deploy your function. When you now run your function an error event will be - You can add more context as described here. -- 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` or configure which categories to collect with the `data_collection` option. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/starlette/index.mdx b/docs/platforms/python/integrations/starlette/index.mdx index 3cb847e47c9f2..488fd2649486f 100644 --- a/docs/platforms/python/integrations/starlette/index.mdx +++ b/docs/platforms/python/integrations/starlette/index.mdx @@ -58,7 +58,7 @@ You can also expect the following for your Starlette project: - By default, all exceptions leading to an Internal Server Error are reported. The HTTP status codes to report on are configurable via the `failed_request_status_codes` [option](#options). - Request data will be 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` or configure which categories to collect with the `data_collection` option. +- Sentry also excludes personally identifiable information (such as user ids, usernames, cookies, authorization headers, IP addresses) unless you configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. To learn how to manually report issues, see Capturing Errors. diff --git a/docs/platforms/python/integrations/strawberry/index.mdx b/docs/platforms/python/integrations/strawberry/index.mdx index e6c5b7f5728e6..aa6b60efb6a10 100644 --- a/docs/platforms/python/integrations/strawberry/index.mdx +++ b/docs/platforms/python/integrations/strawberry/index.mdx @@ -157,7 +157,7 @@ sentry_sdk.init( These are also the defaults when you pass a `data_collection` dictionary, so you only need to set the keys you want to change. See Data Collected for all available keys. -Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`: +Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`, though `send_default_pii` will be removed in the next major version of the SDK: ```python sentry_sdk.init( diff --git a/docs/platforms/python/integrations/tornado/index.mdx b/docs/platforms/python/integrations/tornado/index.mdx index f97e496d6fa52..f22878f845592 100644 --- a/docs/platforms/python/integrations/tornado/index.mdx +++ b/docs/platforms/python/integrations/tornado/index.mdx @@ -61,7 +61,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to a Internal Server Error are reported. -- 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` or configure which categories to collect with the `data_collection` option. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/tryton/index.mdx b/docs/platforms/python/integrations/tryton/index.mdx index 2bbe9bc3c258b..36b774d8636d5 100644 --- a/docs/platforms/python/integrations/tryton/index.mdx +++ b/docs/platforms/python/integrations/tryton/index.mdx @@ -80,7 +80,7 @@ def _(app, request, e): - All uncaught exceptions not inherited from Tryton exceptions are reported. -- 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` or configure which categories to collect with the `data_collection` option. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/wsgi/index.mdx b/docs/platforms/python/integrations/wsgi/index.mdx index 296023e266b53..e4f3110571753 100644 --- a/docs/platforms/python/integrations/wsgi/index.mdx +++ b/docs/platforms/python/integrations/wsgi/index.mdx @@ -89,7 +89,7 @@ make_server('', 8000, app).serve_forever() -- Request data is attached to all events: **HTTP method, URL, headers**. 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` or configure which categories to collect with the `data_collection` option. +- Request data is attached to all events: **HTTP method, URL, headers**. 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. From 61bc2613ff24d090548bdc1a8dbfef626bf0f7b9 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Wed, 21 Oct 2026 13:54:11 +0200 Subject: [PATCH 3/4] docs(python): Name 3.0 as the version that removes send_default_pii --- docs/platforms/python/agent-tracing/anthropic/index.mdx | 4 ++-- docs/platforms/python/agent-tracing/google-genai/index.mdx | 4 ++-- docs/platforms/python/agent-tracing/huggingface_hub/index.mdx | 4 ++-- docs/platforms/python/agent-tracing/index.mdx | 4 ++-- docs/platforms/python/agent-tracing/langchain/index.mdx | 4 ++-- docs/platforms/python/agent-tracing/langgraph/index.mdx | 2 +- docs/platforms/python/agent-tracing/litellm/index.mdx | 4 ++-- docs/platforms/python/agent-tracing/mistral/index.mdx | 2 +- docs/platforms/python/agent-tracing/openai-agents/index.mdx | 4 ++-- docs/platforms/python/agent-tracing/openai/index.mdx | 4 ++-- docs/platforms/python/agent-tracing/pydantic-ai/index.mdx | 4 ++-- docs/platforms/python/configuration/options.mdx | 2 +- docs/platforms/python/data-management/data-collected.mdx | 2 +- .../platforms/python/data-management/sensitive-data/index.mdx | 2 +- docs/platforms/python/integrations/ariadne/index.mdx | 2 +- docs/platforms/python/integrations/asgi/index.mdx | 2 +- .../integrations/aws-lambda/manual-instrumentation/index.mdx | 2 +- docs/platforms/python/integrations/bottle/index.mdx | 2 +- docs/platforms/python/integrations/chalice/index.mdx | 2 +- .../platforms/python/integrations/clickhouse-driver/index.mdx | 2 +- docs/platforms/python/integrations/django/index.mdx | 2 +- docs/platforms/python/integrations/falcon/index.mdx | 2 +- docs/platforms/python/integrations/fastapi/index.mdx | 2 +- docs/platforms/python/integrations/flask/index.mdx | 2 +- docs/platforms/python/integrations/gcp-functions/index.mdx | 2 +- docs/platforms/python/integrations/gql/index.mdx | 2 +- docs/platforms/python/integrations/graphene/index.mdx | 2 +- docs/platforms/python/integrations/mcp/index.mdx | 4 ++-- docs/platforms/python/integrations/pymongo/index.mdx | 2 +- docs/platforms/python/integrations/pyramid/index.mdx | 2 +- docs/platforms/python/integrations/quart/index.mdx | 2 +- docs/platforms/python/integrations/redis/index.mdx | 2 +- docs/platforms/python/integrations/rust_tracing/index.mdx | 2 +- docs/platforms/python/integrations/sanic/index.mdx | 2 +- docs/platforms/python/integrations/serverless/index.mdx | 2 +- docs/platforms/python/integrations/starlette/index.mdx | 2 +- docs/platforms/python/integrations/strawberry/index.mdx | 2 +- docs/platforms/python/integrations/tornado/index.mdx | 2 +- docs/platforms/python/integrations/tryton/index.mdx | 2 +- docs/platforms/python/integrations/wsgi/index.mdx | 2 +- 40 files changed, 50 insertions(+), 50 deletions(-) diff --git a/docs/platforms/python/agent-tracing/anthropic/index.mdx b/docs/platforms/python/agent-tracing/anthropic/index.mdx index 0a047612d57ec..27b4e8961841f 100644 --- a/docs/platforms/python/agent-tracing/anthropic/index.mdx +++ b/docs/platforms/python/agent-tracing/anthropic/index.mdx @@ -80,7 +80,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` - Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in version 3.0 of the SDK. ## Options @@ -109,7 +109,7 @@ You can pass the following keyword arguments to `AnthropicIntegration()`: Whether LLM inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in version 3.0 of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/google-genai/index.mdx b/docs/platforms/python/agent-tracing/google-genai/index.mdx index 2f1d28c454fbc..934abfecb4aa7 100644 --- a/docs/platforms/python/agent-tracing/google-genai/index.mdx +++ b/docs/platforms/python/agent-tracing/google-genai/index.mdx @@ -93,7 +93,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` - Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in version 3.0 of the SDK. ## Options @@ -122,7 +122,7 @@ You can pass the following keyword arguments to `GoogleGenAIIntegration()`: Whether LLM inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in version 3.0 of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx b/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx index f675453b07f86..aa9d240f7449d 100644 --- a/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx +++ b/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx @@ -112,7 +112,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` - Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in version 3.0 of the SDK. ## Options @@ -141,7 +141,7 @@ You can pass the following keyword arguments to `HuggingfaceHubIntegration()`: Whether LLM and tokenizer inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in version 3.0 of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/index.mdx b/docs/platforms/python/agent-tracing/index.mdx index 9b13803ab889f..04287c02afc8d 100644 --- a/docs/platforms/python/agent-tracing/index.mdx +++ b/docs/platforms/python/agent-tracing/index.mdx @@ -13,7 +13,7 @@ With Sentry Agent Tracing, you can ## Getting Started -Enable tracing. Supported AI libraries are instrumented automatically when their packages are installed. Prompt and response content is off by default — use the `gen_ai` key of the `data_collection` option to capture it. Alternatively, set `send_default_pii=True` (and configure `include_prompts` per integration). `send_default_pii` will be removed in the next major version of the SDK. +Enable tracing. Supported AI libraries are instrumented automatically when their packages are installed. Prompt and response content is off by default — use the `gen_ai` key of the `data_collection` option to capture it. Alternatively, set `send_default_pii=True` (and configure `include_prompts` per integration). `send_default_pii` will be removed in version 3.0 of the SDK. ```python import sentry_sdk @@ -87,7 +87,7 @@ sentry_sdk.init( ) ``` -Alternatively, set `send_default_pii=True` to capture them. To keep other PII on but turn AI content off, set `include_prompts=False` on the integration. `send_default_pii` will be removed in the next major version of the SDK. +Alternatively, set `send_default_pii=True` to capture them. To keep other PII on but turn AI content off, set `include_prompts=False` on the integration. `send_default_pii` will be removed in version 3.0 of the SDK. ```python import sentry_sdk diff --git a/docs/platforms/python/agent-tracing/langchain/index.mdx b/docs/platforms/python/agent-tracing/langchain/index.mdx index 453ac09fc3d05..2c221ec1d8a22 100644 --- a/docs/platforms/python/agent-tracing/langchain/index.mdx +++ b/docs/platforms/python/agent-tracing/langchain/index.mdx @@ -174,7 +174,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` - Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in version 3.0 of the SDK. ## Options @@ -203,7 +203,7 @@ You can pass the following keyword arguments to `LangchainIntegration()`: Whether LLM and tokenizer inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in version 3.0 of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/langgraph/index.mdx b/docs/platforms/python/agent-tracing/langgraph/index.mdx index 7724aa6debcc0..b81a792565613 100644 --- a/docs/platforms/python/agent-tracing/langgraph/index.mdx +++ b/docs/platforms/python/agent-tracing/langgraph/index.mdx @@ -124,7 +124,7 @@ You can pass the following keyword arguments to `LanggraphIntegration()`: Controls whether LLM inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in version 3.0 of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/litellm/index.mdx b/docs/platforms/python/agent-tracing/litellm/index.mdx index 619e76e03fe83..53bc8ae838ea2 100644 --- a/docs/platforms/python/agent-tracing/litellm/index.mdx +++ b/docs/platforms/python/agent-tracing/litellm/index.mdx @@ -94,7 +94,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` - Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in version 3.0 of the SDK. ## Options @@ -123,7 +123,7 @@ You can pass the following keyword arguments to `LiteLLMIntegration()`: Whether LLM inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in version 3.0 of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/mistral/index.mdx b/docs/platforms/python/agent-tracing/mistral/index.mdx index 367bf5fdc196a..a59c31243180c 100644 --- a/docs/platforms/python/agent-tracing/mistral/index.mdx +++ b/docs/platforms/python/agent-tracing/mistral/index.mdx @@ -99,7 +99,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` - Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. `send_default_pii` will be removed in the next major version of the SDK. + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. `send_default_pii` will be removed in version 3.0 of the SDK. ## Supported Versions diff --git a/docs/platforms/python/agent-tracing/openai-agents/index.mdx b/docs/platforms/python/agent-tracing/openai-agents/index.mdx index f7c6791e6598a..413d8fda0f16f 100644 --- a/docs/platforms/python/agent-tracing/openai-agents/index.mdx +++ b/docs/platforms/python/agent-tracing/openai-agents/index.mdx @@ -105,7 +105,7 @@ sentry_sdk.init( ) ``` -Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. +Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in version 3.0 of the SDK. ## Options @@ -134,7 +134,7 @@ You can pass the following keyword arguments to `OpenAIAgentsIntegration()`: Whether LLM and tool inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in version 3.0 of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/openai/index.mdx b/docs/platforms/python/agent-tracing/openai/index.mdx index 0f02e8b6093a0..dd446083c20ab 100644 --- a/docs/platforms/python/agent-tracing/openai/index.mdx +++ b/docs/platforms/python/agent-tracing/openai/index.mdx @@ -91,7 +91,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se ) ``` - Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. + Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in version 3.0 of the SDK. ## Options @@ -121,7 +121,7 @@ You can pass the following keyword arguments to `OpenAIIntegration()`: Whether LLM and tokenizer inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in version 3.0 of the SDK. The default is `True`. diff --git a/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx b/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx index b67c1dd346e38..72795fd39267b 100644 --- a/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx +++ b/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx @@ -223,7 +223,7 @@ sentry_sdk.init( ) ``` -Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the Options section below. `send_default_pii` will be removed in the next major version of the SDK. +Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the Options section below. `send_default_pii` will be removed in version 3.0 of the SDK. ## Options @@ -252,7 +252,7 @@ You can pass the following keyword arguments to `PydanticAIIntegration()`: Whether LLM and tool inputs and outputs should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in version 3.0 of the SDK. The default is `True`. diff --git a/docs/platforms/python/configuration/options.mdx b/docs/platforms/python/configuration/options.mdx index 5f12eb885a77a..e91b669f7f682 100644 --- a/docs/platforms/python/configuration/options.mdx +++ b/docs/platforms/python/configuration/options.mdx @@ -102,7 +102,7 @@ If this flag is enabled, [certain personally identifiable information (PII)](/pl If you enable this option, be sure to manually remove what you don't want to send using our features for managing [_Sensitive Data_](../../data-management/sensitive-data/). - `send_default_pii` will be removed in the next major version of the SDK. Use the [`data_collection`](#data_collection) option instead. + `send_default_pii` will be removed in version 3.0 of the SDK. Use the [`data_collection`](#data_collection) option instead. If you set both, `send_default_pii` is ignored entirely and the SDK emits a `DeprecationWarning`. diff --git a/docs/platforms/python/data-management/data-collected.mdx b/docs/platforms/python/data-management/data-collected.mdx index 7c3e27c70f68f..a2775e60136c3 100644 --- a/docs/platforms/python/data-management/data-collected.mdx +++ b/docs/platforms/python/data-management/data-collected.mdx @@ -12,7 +12,7 @@ The category types and amount of data collected vary, depending on the integrati You can control many of the categories listed here with the `data_collection` option, which lets you opt in or out of each data category individually. -The `send_default_pii` option is still supported, but `send_default_pii` will be removed in the next major version of the SDK. +The `send_default_pii` option is still supported, but `send_default_pii` will be removed in version 3.0 of the SDK. How much data the SDK collects by default depends on which option you use. Without `data_collection` (and with `send_default_pii` unset or `False`), the SDK collects conservatively, and the defaults described on this page apply. diff --git a/docs/platforms/python/data-management/sensitive-data/index.mdx b/docs/platforms/python/data-management/sensitive-data/index.mdx index 7eb97d6c9c4bd..ed92f8e4d661f 100644 --- a/docs/platforms/python/data-management/sensitive-data/index.mdx +++ b/docs/platforms/python/data-management/sensitive-data/index.mdx @@ -33,7 +33,7 @@ Ensure that your team is aware of your company's policy around what can and cann The SDK can be configured to collect or ignore specific data using the [`data_collection`](../../configuration/options/#data_collection) option. -Alternately, you can use the simpler [`send_default_pii`](../../configuration/options/#send_default_pii) option by setting it to `True` or `False`. Note that `send_default_pii` will be removed in the next major version of the SDK in favor of the more fine-grained [`data_collection`](../../configuration/options/#data_collection). +Alternately, you can use the simpler [`send_default_pii`](../../configuration/options/#send_default_pii) option by setting it to `True` or `False`. Note that `send_default_pii` will be removed in version 3.0 of the SDK in favor of the more fine-grained [`data_collection`](../../configuration/options/#data_collection). If you _do not_ wish to use the default PII behavior, you can also choose to identify users in a more controlled manner, using our [user identity context](../../enriching-events/identify-user/). diff --git a/docs/platforms/python/integrations/ariadne/index.mdx b/docs/platforms/python/integrations/ariadne/index.mdx index a8c496c4d3fe6..7f082a1e4c9be 100644 --- a/docs/platforms/python/integrations/ariadne/index.mdx +++ b/docs/platforms/python/integrations/ariadne/index.mdx @@ -98,7 +98,7 @@ sentry_sdk.init( These are also the defaults when you pass a `data_collection` dictionary, so you only need to set the keys you want to change. See Data Collected for all available keys. -Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`, though `send_default_pii` will be removed in the next major version of the SDK: +Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`, though `send_default_pii` will be removed in version 3.0 of the SDK: ```python sentry_sdk.init( diff --git a/docs/platforms/python/integrations/asgi/index.mdx b/docs/platforms/python/integrations/asgi/index.mdx index 958519e5131ba..fe24fa8309768 100644 --- a/docs/platforms/python/integrations/asgi/index.mdx +++ b/docs/platforms/python/integrations/asgi/index.mdx @@ -102,7 +102,7 @@ Additionally, a transaction will show up in the "Performance" section on [sentry ## Behavior -- Request data is attached to all events: **HTTP method, URL, headers**. 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- Request data is attached to all events: **HTTP method, URL, headers**. 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx b/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx index 90f7aba9fc1c3..29f84778ebcbb 100644 --- a/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx +++ b/docs/platforms/python/integrations/aws-lambda/manual-instrumentation/index.mdx @@ -95,7 +95,7 @@ With the AWS Lambda integration enabled, the Python SDK will: You can add more data as described here. -- Request data including **HTTP method, URL, headers, form data, and JSON payloads** will be attached to all events. Sentry excludes raw bodies and multipart file uploads. Sentry also excludes personally identifiable information such as user ids, usernames, cookies, authorization headers, and IP addresses, unless you configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- Request data including **HTTP method, URL, headers, form data, and JSON payloads** will be attached to all events. Sentry excludes raw bodies and multipart file uploads. Sentry also excludes personally identifiable information such as user ids, usernames, cookies, authorization headers, and IP addresses, unless you configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/bottle/index.mdx b/docs/platforms/python/integrations/bottle/index.mdx index 8cc876389da9e..78e85a4331b9c 100644 --- a/docs/platforms/python/integrations/bottle/index.mdx +++ b/docs/platforms/python/integrations/bottle/index.mdx @@ -54,7 +54,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to an Internal Server Error are reported. -- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/chalice/index.mdx b/docs/platforms/python/integrations/chalice/index.mdx index b700d95e273a3..00367578f4898 100644 --- a/docs/platforms/python/integrations/chalice/index.mdx +++ b/docs/platforms/python/integrations/chalice/index.mdx @@ -43,7 +43,7 @@ When you enter the `"/"` route or the scheduled task is run, an error event will ## Behavior -- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/clickhouse-driver/index.mdx b/docs/platforms/python/integrations/clickhouse-driver/index.mdx index 144405bf163a3..a4b518f2315c7 100644 --- a/docs/platforms/python/integrations/clickhouse-driver/index.mdx +++ b/docs/platforms/python/integrations/clickhouse-driver/index.mdx @@ -27,7 +27,7 @@ If you have the `clickhouse-driver` package in your dependencies, the clickhouse -By default, the parameters of the query are not retrieved. To see the query parameters in Sentry, enable `database_query_data` in the `data_collection` option, or enable `send_default_pii`. `send_default_pii` will be removed in the next major version of the SDK. +By default, the parameters of the query are not retrieved. To see the query parameters in Sentry, enable `database_query_data` in the `data_collection` option, or enable `send_default_pii`. `send_default_pii` will be removed in version 3.0 of the SDK. ## Verify diff --git a/docs/platforms/python/integrations/django/index.mdx b/docs/platforms/python/integrations/django/index.mdx index 9fa2435051b89..3178c7e40cb4b 100644 --- a/docs/platforms/python/integrations/django/index.mdx +++ b/docs/platforms/python/integrations/django/index.mdx @@ -76,7 +76,7 @@ To further customize your setup, review the [Options section](#options) below. Sentry automatically captures errors and reports issues for you. You can also expect the following for your Django project: -- If you use `django.contrib.auth`, and you've either enabled `user_info` in the `data_collection` option or set `send_default_pii=True` in your call to `init`, user data (such as current user ID, email address, username) will be attached to error events. `send_default_pii` will be removed in the next major version of the SDK. +- If you use `django.contrib.auth`, and you've either enabled `user_info` in the `data_collection` option or set `send_default_pii=True` in your call to `init`, user data (such as current user ID, email address, username) will be attached to error events. `send_default_pii` will be removed in version 3.0 of the SDK. - Request data will be attached to all events: **HTTP method, URL, headers, form data, JSON payloads**. Sentry excludes raw bodies and multipart file uploads. - Logs emitted by any logger will be recorded as breadcrumbs by the [Logging](/platforms/python/integrations/logging/) integration (this integration is enabled by default). diff --git a/docs/platforms/python/integrations/falcon/index.mdx b/docs/platforms/python/integrations/falcon/index.mdx index c5b925c74d365..ad966bb3badcc 100644 --- a/docs/platforms/python/integrations/falcon/index.mdx +++ b/docs/platforms/python/integrations/falcon/index.mdx @@ -57,7 +57,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to an Internal Server Error are reported. -- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/fastapi/index.mdx b/docs/platforms/python/integrations/fastapi/index.mdx index b0a022429f56b..1d930ba2d3021 100644 --- a/docs/platforms/python/integrations/fastapi/index.mdx +++ b/docs/platforms/python/integrations/fastapi/index.mdx @@ -59,7 +59,7 @@ You can also expect the following for your FastAPI project: - By default, all exceptions leading to an Internal Server Error are captured and reported. The HTTP status codes to report on are configurable via the `failed_request_status_codes` [option](#options). - Request data will be 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- Sentry also excludes personally identifiable information (such as user ids, usernames, cookies, authorization headers, IP addresses) unless you configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. To learn how to manually report issues, see Capturing Errors. diff --git a/docs/platforms/python/integrations/flask/index.mdx b/docs/platforms/python/integrations/flask/index.mdx index 60332553295b6..475392cd9660a 100644 --- a/docs/platforms/python/integrations/flask/index.mdx +++ b/docs/platforms/python/integrations/flask/index.mdx @@ -59,7 +59,7 @@ To further customize your setup, review the [Options section](#options) below. Sentry automatically captures errors and reports issues for you. You can also expect the following for your Flask app: -- If you use `flask-login`, and you've either enabled `user_info` in the `data_collection` option or set `send_default_pii=True` in your call to `init`, user data (such as current user ID, email address, username) will be attached to error events. `send_default_pii` will be removed in the next major version of the SDK. +- If you use `flask-login`, and you've either enabled `user_info` in the `data_collection` option or set `send_default_pii=True` in your call to `init`, user data (such as current user ID, email address, username) will be attached to error events. `send_default_pii` will be removed in version 3.0 of the SDK. - Request data will be attached to all events: HTTP method, URL, headers, form data, JSON payloads. Sentry excludes raw bodies and multipart file uploads. - Logs emitted by any `app.logger` or _any_ logger will be recorded by the [Logging](/platforms/python/integrations/logging/) integration (this integration is enabled by default). diff --git a/docs/platforms/python/integrations/gcp-functions/index.mdx b/docs/platforms/python/integrations/gcp-functions/index.mdx index 5508c342c027c..7e8bac32768a5 100644 --- a/docs/platforms/python/integrations/gcp-functions/index.mdx +++ b/docs/platforms/python/integrations/gcp-functions/index.mdx @@ -105,6 +105,6 @@ With the Google Cloud Functions integration enabled, the Python SDK will: - Function configured time (in seconds) - You can add more data as described here -- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/gql/index.mdx b/docs/platforms/python/integrations/gql/index.mdx index 51d48c0db2d7c..fa6be7b4b4834 100644 --- a/docs/platforms/python/integrations/gql/index.mdx +++ b/docs/platforms/python/integrations/gql/index.mdx @@ -45,7 +45,7 @@ sentry_sdk.init( These are also the defaults when you pass a `data_collection` dictionary. See Data Collected for all available keys. -Alternatively, you can set `send_default_pii` to `True`, though `send_default_pii` will be removed in the next major version of the SDK: +Alternatively, you can set `send_default_pii` to `True`, though `send_default_pii` will be removed in version 3.0 of the SDK: ```python sentry_sdk.init( diff --git a/docs/platforms/python/integrations/graphene/index.mdx b/docs/platforms/python/integrations/graphene/index.mdx index a3558b69125cd..02ba4011bd6c4 100644 --- a/docs/platforms/python/integrations/graphene/index.mdx +++ b/docs/platforms/python/integrations/graphene/index.mdx @@ -79,7 +79,7 @@ sentry_sdk.init( Both are enabled by default when you pass a `data_collection` dictionary. See Data Collected for all available keys. -Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`, though `send_default_pii` will be removed in the next major version of the SDK: +Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`, though `send_default_pii` will be removed in version 3.0 of the SDK: ```python sentry_sdk.init( diff --git a/docs/platforms/python/integrations/mcp/index.mdx b/docs/platforms/python/integrations/mcp/index.mdx index 2ee6d588935ee..033992c388c83 100644 --- a/docs/platforms/python/integrations/mcp/index.mdx +++ b/docs/platforms/python/integrations/mcp/index.mdx @@ -207,7 +207,7 @@ sentry_sdk.init( Setting `inputs` to `False` removes the `mcp.request.argument.*` attributes from spans, and setting `outputs` to `False` removes tool results and prompt message content. -Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude this data despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in the next major version of the SDK. +Alternatively, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude this data despite `send_default_pii=True`, configure the integration with `include_prompts=False` as shown in the [Options section](#options) below. `send_default_pii` will be removed in version 3.0 of the SDK. ### Captured Span Data @@ -263,7 +263,7 @@ You can pass the following keyword arguments to `MCPIntegration()`: Whether tool inputs/outputs and prompt content should be sent to Sentry. If you use the `data_collection` option, this option is ignored. Use the `gen_ai` key instead. - Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in the next major version of the SDK. + Sentry considers this data personal identifiable data (PII) by default. If you want to include the data, set `send_default_pii=True` in the `sentry_sdk.init()` call. To explicitly exclude prompts and outputs despite `send_default_pii=True`, configure the integration with `include_prompts=False`. `send_default_pii` will be removed in version 3.0 of the SDK. The default is `True`. diff --git a/docs/platforms/python/integrations/pymongo/index.mdx b/docs/platforms/python/integrations/pymongo/index.mdx index 823732d55f1d0..aea9b73f03d7e 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 unless you enable `database_query_data` in the `data_collection` option or set `send_default_pii` to `True`. (This was tested for PyMongo 4.2 and below, but "should" also be future proof) `send_default_pii` will be removed in the next major version of the SDK. +- Personal identifiable information (PII) will be stripped from all MongoDB queries unless you enable `database_query_data` in the `data_collection` option or set `send_default_pii` to `True`. (This was tested for PyMongo 4.2 and below, but "should" also be future proof) `send_default_pii` will be removed in version 3.0 of the SDK. ### Other MongoDB libraries diff --git a/docs/platforms/python/integrations/pyramid/index.mdx b/docs/platforms/python/integrations/pyramid/index.mdx index 5ccfce4f15182..033d0619abf85 100644 --- a/docs/platforms/python/integrations/pyramid/index.mdx +++ b/docs/platforms/python/integrations/pyramid/index.mdx @@ -60,7 +60,7 @@ When you point your browser to [http://localhost:6543/](http://localhost:6543/) - exceptions that are not handled by any exception view - 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/quart/index.mdx b/docs/platforms/python/integrations/quart/index.mdx index cb259ca5dac49..0aaa51f3915c9 100644 --- a/docs/platforms/python/integrations/quart/index.mdx +++ b/docs/platforms/python/integrations/quart/index.mdx @@ -52,7 +52,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to an Internal Server Error, from before/after serving functions, and background tasks are reported. -- Request data is attached to all events: **HTTP method, URL, headers**. Sentry also excludes personally identifiable information (such as user IDs, usernames, cookies, authorization headers, IP addresses) unless you configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- Request data is attached to all events: **HTTP method, URL, headers**. Sentry also excludes personally identifiable information (such as user IDs, usernames, cookies, authorization headers, IP addresses) unless you configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/redis/index.mdx b/docs/platforms/python/integrations/redis/index.mdx index 44abc89e4cb2c..370de83b72bb3 100644 --- a/docs/platforms/python/integrations/redis/index.mdx +++ b/docs/platforms/python/integrations/redis/index.mdx @@ -27,7 +27,7 @@ The following information will be available to you on Sentry: - Performance information about requests to Redis will be available in the waterfall diagram in the [Traces](https://sentry.io/orgredirect/organizations/:orgslug/explore/traces/) section on Sentry. - Redis commands will be added as [breadcrumbs](/product/issues/issue-details/breadcrumbs/). -- If you enable `database_query_data` in the `data_collection` option, or set `send_default_pii` to `True` in your app's `sentry_sdk.init()` call, you will also see the data used in your Redis commands. `send_default_pii` will be removed in the next major version of the SDK. +- If you enable `database_query_data` in the `data_collection` option, or set `send_default_pii` to `True` in your app's `sentry_sdk.init()` call, you will also see the data used in your Redis commands. `send_default_pii` will be removed in version 3.0 of the SDK. - Sentry will never collect data of the `AUTH` command. ## Verify Your Setup diff --git a/docs/platforms/python/integrations/rust_tracing/index.mdx b/docs/platforms/python/integrations/rust_tracing/index.mdx index 392063350bb4d..54a8215671885 100644 --- a/docs/platforms/python/integrations/rust_tracing/index.mdx +++ b/docs/platforms/python/integrations/rust_tracing/index.mdx @@ -189,7 +189,7 @@ The `pyo3-python-tracing-subscriber` crate has [a working example of a Sentry in The `data_collection` option doesn't affect this behavior. If you use `data_collection` and want field values on your spans, set `include_tracing_fields` to `True` explicitly. - If it is `None`, this behavior will be controlled by the `send_default_pii` option set during SDK initialization. If it is `False`, field values will be redacted on Sentry spans. If it is `True`, field values will be included on Sentry spans. `send_default_pii` will be removed in the next major version of the SDK. + If it is `None`, this behavior will be controlled by the `send_default_pii` option set during SDK initialization. If it is `False`, field values will be redacted on Sentry spans. If it is `True`, field values will be included on Sentry spans. `send_default_pii` will be removed in version 3.0 of the SDK. The default value of this option is `None`. diff --git a/docs/platforms/python/integrations/sanic/index.mdx b/docs/platforms/python/integrations/sanic/index.mdx index d59a9c436d2b8..2acd08a72f01a 100644 --- a/docs/platforms/python/integrations/sanic/index.mdx +++ b/docs/platforms/python/integrations/sanic/index.mdx @@ -123,7 +123,7 @@ When you point your browser to [http://localhost:8000/](http://localhost:8000/) - All exceptions leading to an Internal Server Error are reported. -- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/serverless/index.mdx b/docs/platforms/python/integrations/serverless/index.mdx index 498b5ad6e0cb2..cf66d149d5a79 100644 --- a/docs/platforms/python/integrations/serverless/index.mdx +++ b/docs/platforms/python/integrations/serverless/index.mdx @@ -89,7 +89,7 @@ Now deploy your function. When you now run your function an error event will be - You can add more context as described here. -- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/starlette/index.mdx b/docs/platforms/python/integrations/starlette/index.mdx index 488fd2649486f..7c76cf26af4c4 100644 --- a/docs/platforms/python/integrations/starlette/index.mdx +++ b/docs/platforms/python/integrations/starlette/index.mdx @@ -58,7 +58,7 @@ You can also expect the following for your Starlette project: - By default, all exceptions leading to an Internal Server Error are reported. The HTTP status codes to report on are configurable via the `failed_request_status_codes` [option](#options). - Request data will be 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- Sentry also excludes personally identifiable information (such as user ids, usernames, cookies, authorization headers, IP addresses) unless you configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. To learn how to manually report issues, see Capturing Errors. diff --git a/docs/platforms/python/integrations/strawberry/index.mdx b/docs/platforms/python/integrations/strawberry/index.mdx index aa6b60efb6a10..36597eecf0b22 100644 --- a/docs/platforms/python/integrations/strawberry/index.mdx +++ b/docs/platforms/python/integrations/strawberry/index.mdx @@ -157,7 +157,7 @@ sentry_sdk.init( These are also the defaults when you pass a `data_collection` dictionary, so you only need to set the keys you want to change. See Data Collected for all available keys. -Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`, though `send_default_pii` will be removed in the next major version of the SDK: +Alternatively, you can initialize the SDK with the `send_default_pii` option set to `True`, though `send_default_pii` will be removed in version 3.0 of the SDK: ```python sentry_sdk.init( diff --git a/docs/platforms/python/integrations/tornado/index.mdx b/docs/platforms/python/integrations/tornado/index.mdx index f22878f845592..452849a127145 100644 --- a/docs/platforms/python/integrations/tornado/index.mdx +++ b/docs/platforms/python/integrations/tornado/index.mdx @@ -61,7 +61,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr - All exceptions leading to a Internal Server Error are reported. -- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. - Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/tryton/index.mdx b/docs/platforms/python/integrations/tryton/index.mdx index 36b774d8636d5..72b07582fb4f7 100644 --- a/docs/platforms/python/integrations/tryton/index.mdx +++ b/docs/platforms/python/integrations/tryton/index.mdx @@ -80,7 +80,7 @@ def _(app, request, e): - All uncaught exceptions not inherited from Tryton exceptions are reported. -- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. diff --git a/docs/platforms/python/integrations/wsgi/index.mdx b/docs/platforms/python/integrations/wsgi/index.mdx index e4f3110571753..9064712435a2e 100644 --- a/docs/platforms/python/integrations/wsgi/index.mdx +++ b/docs/platforms/python/integrations/wsgi/index.mdx @@ -89,7 +89,7 @@ make_server('', 8000, app).serve_forever() -- Request data is attached to all events: **HTTP method, URL, headers**. 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in the next major version of the SDK. +- Request data is attached to all events: **HTTP method, URL, headers**. 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 configure which categories to collect with the `data_collection` option or set `send_default_pii` to `True`. `send_default_pii` will be removed in version 3.0 of the SDK. Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled. From 2e79bfd2106dcc58fc9d9aaa4c27a21aba097a0e Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Wed, 21 Oct 2026 14:03:16 +0200 Subject: [PATCH 4/4] docs(python): Clarify which AI data is attached by default Without send_default_pii or data_collection, AI integrations don't record prompts, messages, or responses, but some still attach tool data: tool definitions, LangChain and Google GenAI tool calls, and MCP tool and prompt arguments. Document this per integration, along with how to remove it with data_collection's gen_ai key. Google GenAI tool inputs and outputs are attached regardless of either option, so note that as well. --- docs/platforms/python/agent-tracing/anthropic/index.mdx | 2 +- docs/platforms/python/agent-tracing/google-genai/index.mdx | 2 +- docs/platforms/python/agent-tracing/huggingface_hub/index.mdx | 2 +- docs/platforms/python/agent-tracing/index.mdx | 2 +- docs/platforms/python/agent-tracing/langchain/index.mdx | 2 +- docs/platforms/python/agent-tracing/openai-agents/index.mdx | 2 +- docs/platforms/python/agent-tracing/openai/index.mdx | 2 +- docs/platforms/python/agent-tracing/pydantic-ai/index.mdx | 2 +- docs/platforms/python/data-management/data-collected.mdx | 2 +- docs/platforms/python/integrations/mcp/index.mdx | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/platforms/python/agent-tracing/anthropic/index.mdx b/docs/platforms/python/agent-tracing/anthropic/index.mdx index 27b4e8961841f..6055f79c34d59 100644 --- a/docs/platforms/python/agent-tracing/anthropic/index.mdx +++ b/docs/platforms/python/agent-tracing/anthropic/index.mdx @@ -68,7 +68,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - The supported function is currently `messages.create` (both sync and async). -- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include prompts, messages, or responses by default. Tool definitions are still attached by default; setting `inputs` to `False` in the `gen_ai` key described below removes them. To include prompts, messages, and responses, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( diff --git a/docs/platforms/python/agent-tracing/google-genai/index.mdx b/docs/platforms/python/agent-tracing/google-genai/index.mdx index 934abfecb4aa7..2388a3d88b000 100644 --- a/docs/platforms/python/agent-tracing/google-genai/index.mdx +++ b/docs/platforms/python/agent-tracing/google-genai/index.mdx @@ -81,7 +81,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - The supported function is currently `models.generate_content` (both sync and async). -- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +- Sentry considers LLM inputs/outputs as PII (Personally identifiable information) and doesn't include prompts, messages, or responses by default. Tool definitions and the tool calls returned by the model, including their arguments, are still attached by default; setting `inputs` and `outputs` to `False` in the `gen_ai` key described below removes them. The arguments and return values of Python functions you pass as tools are currently always attached to tool execution spans, regardless of these options. To include prompts, messages, and responses, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( diff --git a/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx b/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx index aa9d240f7449d..a3d769e9fd3c6 100644 --- a/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx +++ b/docs/platforms/python/agent-tracing/huggingface_hub/index.mdx @@ -100,7 +100,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - All exceptions are reported. -- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include prompts, messages, or responses by default. Tool definitions are still attached by default; setting `inputs` to `False` in the `gen_ai` key described below removes them. To include prompts, messages, and responses, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( diff --git a/docs/platforms/python/agent-tracing/index.mdx b/docs/platforms/python/agent-tracing/index.mdx index 04287c02afc8d..ceddc4109355a 100644 --- a/docs/platforms/python/agent-tracing/index.mdx +++ b/docs/platforms/python/agent-tracing/index.mdx @@ -73,7 +73,7 @@ Any of `id`, `email`, or `username` is sufficient — the Conversations tab disp ### Privacy Controls -LLM inputs and outputs are treated as PII and are **off** by default. To capture them, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +LLM inputs and outputs are treated as PII and are **off** by default. Some integrations still attach tool data, such as tool definitions, by default. See each integration page for details. To capture them, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python import sentry_sdk diff --git a/docs/platforms/python/agent-tracing/langchain/index.mdx b/docs/platforms/python/agent-tracing/langchain/index.mdx index 2c221ec1d8a22..3c6a3712c25f0 100644 --- a/docs/platforms/python/agent-tracing/langchain/index.mdx +++ b/docs/platforms/python/agent-tracing/langchain/index.mdx @@ -162,7 +162,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - All exceptions are reported. -- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include prompts, messages, or responses by default. Tool definitions, as well as tool calls passed in the model's invocation parameters, are still attached by default; setting `inputs` to `False` in the `gen_ai` key described below removes them. To include prompts, messages, and responses, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( diff --git a/docs/platforms/python/agent-tracing/openai-agents/index.mdx b/docs/platforms/python/agent-tracing/openai-agents/index.mdx index 413d8fda0f16f..a88c64a2c0a29 100644 --- a/docs/platforms/python/agent-tracing/openai-agents/index.mdx +++ b/docs/platforms/python/agent-tracing/openai-agents/index.mdx @@ -93,7 +93,7 @@ Data on the following will be collected: - number of input and output tokens used - LLM models usage -Sentry considers LLM and tool inputs/outputs as PII and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +Sentry considers LLM and tool inputs/outputs as PII and doesn't include prompts, messages, or responses by default. Tool definitions are still attached by default; setting `inputs` to `False` in the `gen_ai` key described below removes them. To include prompts, messages, and responses, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( diff --git a/docs/platforms/python/agent-tracing/openai/index.mdx b/docs/platforms/python/agent-tracing/openai/index.mdx index dd446083c20ab..503ee0d30f9e0 100644 --- a/docs/platforms/python/agent-tracing/openai/index.mdx +++ b/docs/platforms/python/agent-tracing/openai/index.mdx @@ -79,7 +79,7 @@ It may take a couple of moments for the data to appear in [sentry.io](https://se - The supported modules are currently `responses.create`, `chat.completions.create`, and `embeddings.create`. -- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +- Sentry considers LLM and tokenizer inputs/outputs as PII (Personally identifiable information) and doesn't include prompts, messages, or responses by default. Tool definitions are still attached by default; setting `inputs` to `False` in the `gen_ai` key described below removes them. To include prompts, messages, and responses, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( diff --git a/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx b/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx index 72795fd39267b..49e026d4866fb 100644 --- a/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx +++ b/docs/platforms/python/agent-tracing/pydantic-ai/index.mdx @@ -211,7 +211,7 @@ Data on the following will be collected: - LLM models usage - model settings (temperature, max_tokens, etc.) -Sentry considers LLM and tool inputs/outputs as PII and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: +Sentry considers LLM and tool inputs/outputs as PII and doesn't include prompts, messages, or responses by default. Tool definitions are still attached by default; setting `inputs` to `False` in the `gen_ai` key described below removes them. To include prompts, messages, and responses, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default and `include_prompts` is ignored: ```python sentry_sdk.init( diff --git a/docs/platforms/python/data-management/data-collected.mdx b/docs/platforms/python/data-management/data-collected.mdx index a2775e60136c3..08c5b4c716f89 100644 --- a/docs/platforms/python/data-management/data-collected.mdx +++ b/docs/platforms/python/data-management/data-collected.mdx @@ -272,7 +272,7 @@ Without `data_collection` (and with `send_default_pii` unset or `False`), this d ## LLM Inputs And Responses -When using Sentry in your AI apps, the SDK by default won't add data like LLM inputs and responses to spans. +When using Sentry in your AI apps, the SDK by default won't add LLM prompts, messages, or responses to spans. Some integrations still attach tool data by default, such as tool definitions and MCP tool arguments. See the documentation for the specific AI framework for details on what's attached and how to remove it. When using `data_collection`, the `gen_ai` category records both inputs and outputs unless you opt out. Metadata like the model ID and token counts is always collected. diff --git a/docs/platforms/python/integrations/mcp/index.mdx b/docs/platforms/python/integrations/mcp/index.mdx index 033992c388c83..93b0f29967afc 100644 --- a/docs/platforms/python/integrations/mcp/index.mdx +++ b/docs/platforms/python/integrations/mcp/index.mdx @@ -193,7 +193,7 @@ Data on the following will be collected: - **Request context**: Request IDs, session IDs, and transport types (stdio/HTTP) - **Execution spans**: Timing information for all handler invocations -Sentry considers tool inputs/outputs and prompt content as PII and doesn't include PII data by default. To include the data, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default, and `include_prompts` is ignored: +Sentry considers tool inputs/outputs and prompt content as PII. By default, it doesn't include tool results or prompt content, but tool and prompt arguments (`mcp.request.argument.*`) are still attached; setting `inputs` to `False` in the `gen_ai` key described below removes them. To include tool results and prompt content, use the `gen_ai` key of the `data_collection` option, which lets you control inputs and outputs separately. When you pass a `data_collection` dictionary, both are collected by default, and `include_prompts` is ignored: ```python sentry_sdk.init(