Feat v0.6.4 health metrics (#39)
All checks were successful
CI/CD / detect-changes (push) Successful in 3s
CI/CD / test-frontend (push) Successful in 6s
CI/CD / test-go-pg (push) Successful in 2m42s
CI/CD / test-sqlite (push) Successful in 2m48s
CI/CD / build-and-deploy (push) Successful in 1m5s

Co-authored-by: Jeffrey Smith <jasafpro@gmail.com>
Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #39.
This commit is contained in:
2026-03-31 14:05:49 +00:00
committed by xcaliber
parent 3d4228f868
commit 36d6158940
22 changed files with 937 additions and 286 deletions

View File

@@ -2,6 +2,50 @@
All notable changes to Switchboard Core are documented here.
## v0.6.4 — Admin Health/Metrics Tab + Cluster Merge
Structural consolidation: cluster dashboard merges into Admin as a Health tab.
Comprehensive metrics endpoint for runtime, DB, cluster, and extension stats.
### Added
- **Admin Health tab**: New "Health" section under Monitoring in the Admin
surface. Auto-refreshing panels for runtime, database, cluster, and extension
metrics with configurable poll interval (5/10/30/60s).
- **`GET /api/v1/admin/metrics`**: Single JSON endpoint returning all platform
metrics — runtime (goroutines, heap, GC, uptime, FDs), DB pool (latency,
active/idle/max, PG-only dead tuples + active backends), cluster nodes
(when PG multi-node), and extension stats (Starlark exec/errors/duration,
trigger fires, event bus publish/deliver counts).
- **Fattened heartbeat payload**: Cluster heartbeat JSONB now carries stack
usage, GC CPU%, extensions loaded, Starlark execution counters, and trigger
fire count — visible in per-node cluster cards.
- **Sandbox execution tracking**: `ExecPackage` and `CallEntryPoint` now
increment atomic counters (exec, errors, duration) and the previously
declared but unused `SandboxExecutionsTotal` Prometheus counter.
- **Event bus counters**: `Bus.PublishCount()` and `Bus.DeliverCount()` track
cumulative publish/deliver operations.
- **Trigger fire counter**: `Engine.FireCount()` tracks cumulative trigger
fires across webhook, event, and scheduled triggers.
- 4 new handler tests (metrics SQLite shape, cluster shape, extension counters).
- 1 new cluster test (fattened heartbeat payload).
### Changed
- **Health endpoint consolidation**: `/health` and `/api/v1/health` now use a
shared `buildHealthResponse()` function returning identical JSON. Both now
include `registration_enabled` when the database is connected.
- **Block renderer `requires` removed**: `mermaid-renderer`, `katex-renderer`,
`csv-table`, and `diff-viewer` no longer require `["chat"]` — they activate
on any surface (notes, docs, etc.).
### Removed
- **`cluster-dashboard` package**: Standalone surface package retired. Cluster
node visibility is now in Admin > Monitoring > Health.
---
## v0.6.3 — Dead Code Sweep + Registry Fix
Pre-fork hardening: fix broken registry install, add registry settings UI,