Commit 64c169f
authored
feat(sdk): add config driven sink selection (#176)
## Summary
Added config-driven observability sink selection across the SDK and
server.
Introduced shared telemetry sink-selection primitives so observability
can use the default backend, registered SDK sinks, or named custom sink
factories.
Expanded tests and README examples to cover the new sink-selection
behavior and lifecycle handling.
Fixed the SDK mypy issue in shutdown handling by wrapping sink lifecycle
awaitables in a concrete coroutine before passing them to
`asyncio.run()`.
## Scope
**User-facing/API changes:**
- SDK `agent_control.init()` now accepts `observability_sink_name` and
`observability_sink_config`
- SDK exports new sink registration helpers for external/custom
observability sinks
- Server observability config now supports sink selection and sink
config via environment/settings
- README includes a new example for registering and selecting an
external sink
**Internal changes:**
- Added shared sink-selection models/registry in `telemetry/`
- Refactored SDK observability to resolve active sinks from config
rather than always using the built-in batcher
- Refactored server startup to resolve an observability backend from
sink selection
- Added server/SDK/telemetry tests for sink selection, lifecycle, and
event delivery paths
- Adjusted SDK shutdown typing to satisfy mypy
**Out of scope:**
- No changes to core control evaluation logic
- No new built-in third-party sink implementation is included in this
branch
- No UI work or rollout automation is included
## Risk and Rollout
**Risk level:** medium
**Rollback plan:** Revert this branch to restore the previous
default-only observability path. As a partial mitigation, deployments
can keep `observability_sink_name=default` to stay on the legacy
behavior even with this code merged.
## Testing
- [x] Added or updated automated tests
- [ ] Ran `make check` — could not run in this environment because `uv`
was not available in the shell
- [x] Manually verified behavior
## Checklist
- [ ] Linked issue/spec (if applicable)
- [x] Updated docs/examples for user-facing changes
- [ ] Included any required follow-up tasks
**Follow-up tasks:**
- Run `make check` in a full local/CI environment with `uv` available
- Confirm any downstream custom sink integrations against the new
SDK/server registration APIs1 parent 30356a2 commit 64c169f
17 files changed
Lines changed: 1276 additions & 89 deletions
File tree
- sdks/python
- src/agent_control
- tests
- server
- src/agent_control_server
- observability
- tests
- telemetry
- src/agent_control_telemetry
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
172 | 179 | | |
173 | 180 | | |
174 | 181 | | |
175 | 182 | | |
176 | 183 | | |
177 | | - | |
178 | | - | |
179 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
180 | 187 | | |
181 | 188 | | |
182 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| 108 | + | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
415 | 419 | | |
416 | 420 | | |
417 | 421 | | |
| 422 | + | |
| 423 | + | |
418 | 424 | | |
419 | 425 | | |
420 | 426 | | |
| |||
443 | 449 | | |
444 | 450 | | |
445 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
446 | 455 | | |
447 | 456 | | |
448 | 457 | | |
| |||
636 | 645 | | |
637 | 646 | | |
638 | 647 | | |
| 648 | + | |
| 649 | + | |
639 | 650 | | |
640 | 651 | | |
641 | 652 | | |
| |||
1371 | 1382 | | |
1372 | 1383 | | |
1373 | 1384 | | |
| 1385 | + | |
1374 | 1386 | | |
1375 | 1387 | | |
| 1388 | + | |
1376 | 1389 | | |
| 1390 | + | |
1377 | 1391 | | |
1378 | 1392 | | |
1379 | 1393 | | |
| |||
0 commit comments