Skip to content

Observability: /metrics + live log follow (FEAT-2, FEAT-4) - #37

Merged
joy-software merged 1 commit into
mainfrom
feature/observability-metrics-logfollow
Jun 7, 2026
Merged

Observability: /metrics + live log follow (FEAT-2, FEAT-4)#37
joy-software merged 1 commit into
mainfrom
feature/observability-metrics-logfollow

Conversation

@joy-software

Copy link
Copy Markdown
Contributor
  • FEAT-4 — Prometheus /metrics on serve: spero_up, spero_frozen, spero_target_healthy{target}, spero_target_failures{target} from the supervisor's latest state (label values escaped). Token-guarded.
  • FEAT-2 — live log follow: core.inspect.stream_logs runs kubectl logs -f as an async subprocess (killed/reaped on cancel); Supervisor.stream_logs validates eagerly (404/422 before streaming). New GET /logs/{name}/stream returns an SSE StreamingResponse. Textual gains a FollowScreen on L — local via stream_logs, remote via the SSE endpoint — appending into a RichLog and tearing down on close.

Tests: /metrics (503 + rendered text), /logs/{name}/stream (SSE lines + 503), _stream_argv (k8s argv + LookupError), TUI follow screen opens. 236 passed; ruff/mypy clean. Tasks #20, #22.

…-2, FEAT-4)

FEAT-4: a Prometheus `/metrics` endpoint on serve (spero_up, spero_frozen,
spero_target_healthy, spero_target_failures) built from the supervisor's latest
per-target state. Token-guarded like the other data endpoints.

FEAT-2: live log follow. core.inspect.stream_logs runs `kubectl logs -f` as an
async subprocess and yields lines (killed/reaped on cancel); Supervisor.stream_logs
validates eagerly (404/422 before the stream opens). A new
`GET /logs/{name}/stream` returns an SSE StreamingResponse. The Textual UI gains a
FollowScreen on `L` -- local via stream_logs, remote via the SSE endpoint -- that
appends lines into a RichLog and tears the stream down on close.
@joy-software
joy-software merged commit 2a563bb into main Jun 7, 2026
8 checks passed
@joy-software
joy-software deleted the feature/observability-metrics-logfollow branch June 7, 2026 21:33
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.

1 participant