Commit 4a0e5ed
Support
Add support for AI agents projects using `openai-agents`
(https://pypi.org/project/openai-agents/)
Docs PR is here: getsentry/sentry-docs#14113
This integration:
- records tracing data of agent invocation, tool execution, ai client
requests to LLMs, and handoffs to other agents.
- captures input and output to/from LLMs if `set_default_pii=True`.
- is mostly compatible to the OpenTelememetry `gen_ai` semantic
conventions. (input and output is not compatible because Sentry does not
have Span events. This information is stored in arrays on the Span
attributes.
- Captures errors that happen during agent execution (like problems
during interaction with the LLM.
This integration does not:
- Capture errors during function tool exection because this is very hard
to patch (see comment in the code)
Example span tree in Sentry.io:

---------
Co-authored-by: Ivana Kellyer <[email protected]>openai-agents (#4437)1 parent 7f507fd commit 4a0e5ed
File tree
24 files changed
+1638
-134
lines changed- .github/workflows
- scripts
- populate_tox
- split_tox_gh_actions
- sentry_sdk
- integrations
- openai_agents
- patches
- spans
- tests/integrations/openai_agents
24 files changed
+1638
-134
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
69 | 73 | | |
70 | 74 | | |
71 | 75 | | |
| |||
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
142 | 148 | | |
143 | 149 | | |
144 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
403 | 404 | | |
404 | 405 | | |
405 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
0 commit comments