Repository navigation
Commit 777ca59
feat(obs): install the openai-agents bridge so Runner turns produce spans
The traces signal wired but produced nothing for the fleet's dominant agent shape.
sgp_obs.init() installs most of the traces wiring itself; the openai-agents bridge
is the one piece it does not. Measured on 0.16.0 after a plain init() with traces
on:
GenAI attempt span processor installed
litellm logical adapter installed (_SgpObsLiteLLMLogger)
httpx / aiohttp egress instrumented
openai-agents bridge NOT installed
That last one carries roughly 83% of model-calling agents, so without it a Runner
turn contributes no logical model-operation spans and "traces on" looks like it
does nothing at all.
This is what the obs-test-* agents in agentex-agents#2183 each hand-roll: every one
of the five ships an identical 114-line obs_bootstrap.py. Comparing that file
against what init() already does, four of its five steps are redundant — the httpx
and aiohttp instrumentors (init's _instrument_egress does them, and 0.16.0
deliberately reuses an already-instrumented one rather than warning), the attempt
processor, and the litellm adapter. Only the bridge was load-bearing. With this
change an adopting agent's bootstrap collapses to nothing, except the parts that
are genuinely agent-specific: capture_turn's redaction allowlist, and its business
span call sites.
Installed unconditionally when traces are wired, because openai-agents is a hard
dependency of this SDK, so `agents` is importable in every agent. The call is
idempotent. A False return means `agents` was somehow not importable, which should
be impossible here, so that warns rather than passing silently.
Verified through the SDK's own entry point, not the library's:
SDK init status: wired:metrics,traces
attempt span processor : True
openai-agents bridge : True
litellm adapter : ['_SgpObsLiteLLMLogger']
88 tests, ruff clean, pyright 0 errors, all with sgp-obs absent.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 60daf54 commit 777ca59
2 files changed
Lines changed: 104 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
151 | 192 | | |
152 | 193 | | |
153 | 194 | | |
| |||
Lines changed: 63 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
| |||
339 | 347 | | |
340 | 348 | | |
341 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
0 commit comments