Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions skills/sentry-python-sdk/references/ai-monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Tracing must be enabled — AI spans require an active transaction:
sentry_sdk.init(
dsn="...",
traces_sample_rate=1.0,
stream_gen_ai_spans=True,
send_default_pii=True,
)
```
Expand Down Expand Up @@ -54,11 +53,11 @@ import sentry_sdk
sentry_sdk.init(
dsn="https://<key>@<org>.ingest.sentry.io/<project>",
traces_sample_rate=1.0,
stream_gen_ai_spans=True,
send_default_pii=True, # required to capture prompts/outputs
)

# OpenAI, Anthropic, LangChain, LangGraph, HuggingFace Hub activate automatically
# Note: stream_gen_ai_spans=True by default (SDK >=2.60.0)
Comment on lines 58 to +60

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The documentation fix is incomplete. SKILL.md still requires stream_gen_ai_spans=True for Python, contradicting the update in ai-monitoring.md which states it's now the default.
Severity: LOW

Suggested Fix

Update skills/sentry-setup-ai-monitoring/SKILL.md (specifically lines 196, 332, and 418) to reflect that stream_gen_ai_spans is enabled by default in Python SDK >= 2.60.0. Remove the instruction that it is an explicitly required setting.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: skills/sentry-python-sdk/references/ai-monitoring.md#L58-L60

Potential issue: This pull request aims to update documentation to reflect that
`stream_gen_ai_spans` defaults to `True` in the Python SDK version 2.60.0 and later.
While `ai-monitoring.md` is correctly updated,
`skills/sentry-setup-ai-monitoring/SKILL.md` was not. This second file continues to
instruct users that setting `stream_gen_ai_spans=True` is explicitly required. This
creates conflicting guidance for users, leading to confusion and the addition of
redundant configuration. The fix is incomplete and introduces a documentation
inconsistency.

Also affects:

  • skills/sentry-setup-ai-monitoring/SKILL.md:196
  • skills/sentry-setup-ai-monitoring/SKILL.md:332
  • skills/sentry-setup-ai-monitoring/SKILL.md:418

Did we get this right? 👍 / 👎 to inform future reviews.

```

### Explicit configuration with `include_prompts` override
Expand All @@ -71,7 +70,6 @@ from sentry_sdk.integrations.anthropic import AnthropicIntegration
sentry_sdk.init(
dsn="...",
traces_sample_rate=1.0,
stream_gen_ai_spans=True,
send_default_pii=True,
integrations=[
OpenAIIntegration(
Expand All @@ -92,7 +90,6 @@ from sentry_sdk.integrations.litellm import LiteLLMIntegration
sentry_sdk.init(
dsn="...",
traces_sample_rate=1.0,
stream_gen_ai_spans=True,
send_default_pii=True,
integrations=[
LiteLLMIntegration(include_prompts=True), # 100+ providers via proxy
Expand Down Expand Up @@ -255,7 +252,7 @@ This populates the **AI Agents Dashboard** in Sentry with per-agent latency, too

Link AI spans across turns in a multi-turn conversation. Sentry groups spans by `gen_ai.conversation.id` into a chat-style timeline at **Explore > Conversations**.

**Prerequisites:** `stream_gen_ai_spans=True` (SDK >=2.60.0) and `send_default_pii=True` must be set — Conversations reconstructs the chat from input/output attributes, so without PII capture the view will be empty.
**Prerequisites:** SDK >=2.60.0 (span streaming enabled by default) and `send_default_pii=True` must be set — Conversations reconstructs the chat from input/output attributes, so without PII capture the view will be empty.

```python
import sentry_sdk.ai
Expand Down