Skip to content

feat(sdk): add config driven sink selection#176

Merged
namrataghadi-galileo merged 25 commits intomainfrom
feature/61576-add-config-driven-sink-selection
Apr 22, 2026
Merged

feat(sdk): add config driven sink selection#176
namrataghadi-galileo merged 25 commits intomainfrom
feature/61576-add-config-driven-sink-selection

Conversation

@namrataghadi-galileo
Copy link
Copy Markdown
Contributor

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

  • Added or updated automated tests
  • Ran make check — could not run in this environment because uv was not available in the shell
  • Manually verified behavior

Checklist

  • Linked issue/spec (if applicable)
  • 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 APIs

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

@namrataghadi-galileo namrataghadi-galileo changed the base branch from main to feature/62793-add-external-sink April 16, 2026 22:19
Copy link
Copy Markdown
Contributor

@lan17 lan17 left a comment

Choose a reason for hiding this comment

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

I like the direction of moving sink selection into a shared model, but I don't think this middle layer is ready to merge yet. The biggest issue is that the config surface is now shared between SDK and server, but the semantics still diverge. I also don't think the SDK should take ownership of caller-registered sinks on shutdown, and returning the best fanout result makes partial delivery failures too easy to miss.

Comment thread server/src/agent_control_server/observability/sinks.py
Comment thread sdks/python/src/agent_control/observability.py Outdated
Comment thread sdks/python/src/agent_control/observability.py Outdated
Copy link
Copy Markdown
Contributor

@lan17 lan17 left a comment

Choose a reason for hiding this comment

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

Overall I think this is in good shape. The split between shared selection shape and runtime-specific semantics is the right direction, and moving the server onto its own sink env names fixes the biggest design problem from the earlier version. I left one follow-up comment on named-sink cleanup when switching back to default, but I don't think it should block this landing. Assuming this gets rebased cleanly on top of 175, I'm good with it.

Comment thread sdks/python/src/agent_control/observability.py
Base automatically changed from feature/62793-add-external-sink to main April 21, 2026 22:29
@namrataghadi-galileo namrataghadi-galileo enabled auto-merge (squash) April 22, 2026 20:27
@namrataghadi-galileo namrataghadi-galileo merged commit 64c169f into main Apr 22, 2026
5 checks passed
@namrataghadi-galileo namrataghadi-galileo deleted the feature/61576-add-config-driven-sink-selection branch April 22, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants