Skip to content

Commit 6ecd5ee

Browse files
chore(docs): Remove explicit openai agents integration registration (#14718)
## DESCRIBE YOUR PR This PR updates the documentation for the `OpenAIAgentsIntegration` to reflect that it is automatically registered when the `agents` package is detected. The documentation examples have been simplified to remove explicit `OpenAIAgentsIntegration()` setup from `sentry_sdk.init()`, aligning with the goal of providing an "out-of-the-box" experience for AI observability. An "Options" section has been added, similar to other AI integrations, to explain when explicit registration is still useful (e.g., to configure options like `include_prompts`). ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --- [Slack Thread](https://sentry.slack.com/archives/C062N2F39V4/p1756205178799769?thread_ts=1756205178.799769&cid=C062N2F39V4) <a href="https://cursor.com/background-agent?bcId=bc-f30ce8b2-6f2d-4a20-aa8b-29b3ff769b12"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"> <img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"> </picture> </a> <a href="https://cursor.com/agents?id=bc-f30ce8b2-6f2d-4a20-aa8b-29b3ff769b12"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"> <source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"> <img alt="Open in Web" src="https://cursor.com/open-in-web.svg"> </picture> </a> Co-authored-by: Cursor Agent <[email protected]>
1 parent 96e9dee commit 6ecd5ee

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed

docs/platforms/python/integrations/openai-agents/index.mdx

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,9 @@ uv add "sentry-sdk"
3030

3131
## Configure
3232

33-
Add `OpenAIAgentsIntegration()` to your `integrations` list:
33+
If you have the `agents` package in your dependencies, the OpenAI Agents integration will be enabled automatically when you initialize the Sentry SDK.
3434

35-
```python
36-
import sentry_sdk
37-
from sentry_sdk.integrations.openai_agents import OpenAIAgentsIntegration
38-
39-
sentry_sdk.init(
40-
dsn="___PUBLIC_DSN___",
41-
traces_sample_rate=1.0,
42-
# Add data like inputs and responses to/from LLMs and tools;
43-
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
44-
send_default_pii=True,
45-
integrations=[
46-
OpenAIAgentsIntegration(),
47-
],
48-
)
49-
```
35+
<PlatformContent includePath="getting-started-config" />
5036

5137
## Verify
5238

@@ -57,8 +43,6 @@ import asyncio
5743
import random
5844

5945
import sentry_sdk
60-
from sentry_sdk.integrations.openai_agents import OpenAIAgentsIntegration
61-
6246
import agents
6347
from pydantic import BaseModel # installed by openai-agents
6448

@@ -79,14 +63,11 @@ random_number_agent = agents.Agent(
7963

8064
async def main() -> None:
8165
sentry_sdk.init(
82-
dsn="...", # same as above
66+
dsn="___PUBLIC_DSN___",
8367
traces_sample_rate=1.0,
8468
# Add data like LLM and tool inputs/outputs;
8569
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
8670
send_default_pii=True,
87-
integrations=[
88-
OpenAIAgentsIntegration(),
89-
],
9071
)
9172

9273
await agents.Runner.run(
@@ -109,7 +90,36 @@ Data on the following will be collected:
10990
- number of input and output tokens used
11091
- LLM models usage
11192

112-
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.
93+
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.
94+
95+
## Options
96+
97+
By adding `OpenAIAgentsIntegration` to your `sentry_sdk.init()` call explicitly, you can set options for `OpenAIAgentsIntegration` to change its behavior:
98+
99+
```python
100+
import sentry_sdk
101+
from sentry_sdk.integrations.openai_agents import OpenAIAgentsIntegration
102+
103+
sentry_sdk.init(
104+
# ...
105+
# Add data like inputs and responses;
106+
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
107+
send_default_pii=True,
108+
integrations=[
109+
OpenAIAgentsIntegration(
110+
include_prompts=False, # LLM and tool inputs/outputs will be not sent to Sentry, despite send_default_pii=True
111+
),
112+
],
113+
)
114+
```
115+
116+
You can pass the following keyword arguments to `OpenAIAgentsIntegration()`:
117+
118+
- `include_prompts`:
119+
120+
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`.
121+
122+
The default is `True`.
113123

114124
## Supported Versions
115125

docs/product/insights/ai/agents/getting-started.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,17 +172,13 @@ The Sentry Python SDK supports OpenAI Agents SDK.
172172

173173
```python
174174
import sentry_sdk
175-
from sentry_sdk.integrations.openai_agents import OpenAIAgentsIntegration
176175
import agents
177176
from pydantic import BaseModel
178177

179178
sentry_sdk.init(
180179
dsn="YOUR_DSN",
181180
traces_sample_rate=1.0,
182181
send_default_pii=True, # Include LLM inputs/outputs
183-
integrations=[
184-
OpenAIAgentsIntegration(),
185-
],
186182
)
187183

188184
# Create your AI agent

0 commit comments

Comments
 (0)