feat(server): refactor server ingestion to sink#165
feat(server): refactor server ingestion to sink#165namrataghadi-galileo wants to merge 11 commits intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
lan17
left a comment
There was a problem hiding this comment.
I don't see a new code issue in the current server-ingest diff, but this PR is still stacked on the pre-update head of #164 and GitHub currently shows it as non-mergeable. Please restack/rebase onto the current PR 164 head and I'll do a final pass on the resolved diff.
| """Write-side abstraction for delivering control execution events.""" | ||
|
|
||
| def write_events(self, events: Sequence[ControlExecutionEvent]) -> SinkResult: | ||
| def write_events(self, events: Sequence[ControlExecutionEvent]) -> SinkWriteResult: |
There was a problem hiding this comment.
I don't think this refactor pays off if ControlEventSink.write_events() can now return either SinkResult or Awaitable[SinkResult]. That makes the core contract harder to reason about: the server has to normalize with resolve_sink_result(), while the SDK has to guard and fail at runtime if someone wires in an async sink. I'd keep the sync and async contracts separate and adapt once at the boundary instead of widening the shared interface itself.
Summary
Refactored the server observability write path to use the shared
ControlEventSinkabstraction while preserving the existing/api/v1/observability/eventsbehavior and Postgres-backed OSS storage.Added a default OSS server sink that adapts the existing
EventStorewrite path into the shared sink contract.Kept the current
DirectEventIngestorusage stable by allowing existing store-based construction to continue working, while routing writes through sink semantics internally.Scope
User-facing / API changes
/api/v1/observability/eventsrequest/response behavior remains unchanged.IngestResultand API response accounting semantics are preserved.Internal changes
EventStore/Postgres path.DirectEventIngestorto write throughControlEventSinkinternally.EventStoreinputs into the default sink internally.Out of scope
Risk and Rollout
Risk level: Medium
Rollback plan:
DirectEventIngestorto writing directly toEventStore.store(...).Testing
make check(or explained why not)Checklist