feat(observability): stream scoped service health transitions - #2911
Open
tang-vu wants to merge 2 commits into
Open
feat(observability): stream scoped service health transitions#2911tang-vu wants to merge 2 commits into
tang-vu wants to merge 2 commits into
Conversation
Contributor
Author
|
Batch compatibility receipt (2026-08-24) Built the inspectable synthetic branch
No manual merge resolution was required, including the shared Combined validation:
The stale Browserslist notice and authentication-dependent Phase C skips are unchanged environmental disclosures. #2903 remains draft because synthetic compatibility does not replace its declared live host-agent lifecycle gate and independent human review. |
This was referenced Aug 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this matters
Automation currently has to poll full status payloads and infer whether service health actually changed. This adds an authenticated, cache-backed Server-Sent Events contract that emits only meaningful state transitions. It avoids probing containers per client, ignores noisy latency-only changes, supports resumable consumers, and can terminate after a bounded event count for scripts and health collectors.
Fleet consumers rarely own every service. Repeating
service=now scopes the snapshot and transition fingerprint to the requested services, so an automation watchingllama-serveris not awakened by unrelated dashboard or extension churn.Overlap check
Searched open and closed upstream PRs for
SSE service health,service event stream, and filtered health streams, plus the changed production files. No active PR implements this endpoint or filter. PR #2906 is an independent pull-based Prometheus surface; PRs #2731, #2736, and #2819 change CSRF, key lifecycle, and Docker preflight behavior in other regions. This existing canonical branch was strengthened rather than creating a second observability PR.What changed
GET /api/events/serviceswith standard SSE framingLast-Event-IDso reconnecting clients wait for the next real changeservice=<id>to scope both snapshots and subsequent transitionsmax_eventsfor finite automationRegression coverage
The HTTP boundary tests exercise authentication, SSE headers/framing, bounded snapshots, repeated service filters, and query bounds. Tracker/stream tests prove latency-only deduplication, add/change/remove transitions, cache readiness, and resumption after
Last-Event-ID.Concrete pre-change evidence: requesting
service=open-webui&service=llama-serverreturned the unrelateddashboard-apistate as well. The new regression now returns exactly the two requested services in deterministic order.Validation
python -m pytest -q tests/test_service_events.py tests/test_main.py— 82 passed.python -m py_compile routers/events.py tests/test_service_events.py main.py— passed.WinError 1314.git diff --check— passed.Tradeoffs and rollback
Filters match current service IDs exactly and unknown IDs produce an empty scoped snapshot; the endpoint does not guess aliases. Filtering happens after reading the shared cache, so it creates no additional probes. Rollback removes only the event API/consumer contract and does not mutate service state. The stream is authenticated and intentionally remains read-only.