otel: real auto-refresh dashboard + HTTP self-warm (kills cold p99)

Dashboard: drop the non-functional data-on-load SSE attr; add <meta refresh 3s>
so it genuinely live-updates (the host serves single-body responses, no
server-push SSE). /otel/stream stays a snapshot for pollers.

serve.sh: replace the ineffective boot-time make-app warmup (wrong JIT context)
with a backgrounded self-warmer that GETs the hot pages over real HTTP (bash
/dev/tcp — no curl in the image) once /health is up, so the first real visitor
after a restart gets ~78ms instead of the one-time ~2.5s serving-JIT compile.
This commit is contained in:
2026-07-01 19:32:36 +00:00
parent 6868d984a0
commit 0fda26f1d5
2 changed files with 29 additions and 9 deletions

View File

@@ -376,8 +376,14 @@
(lt (otel/latest-trace))
(traces (otel/recent-traces)))
(quasiquote
(div :id "otel-dashboard" :data-on-load "@get('/otel/stream')"
(div :id "otel-dashboard"
;; The host serves single-body responses (no server-push SSE), so the
;; dashboard stays live by reloading itself — every 3s it re-renders the
;; latest metrics + trace. /otel/stream remains a snapshot of the newest
;; span for any client that wants to poll it.
(meta :http-equiv "refresh" :content "3")
(h1 "OpenTelemetry")
(p :style "font-size:0.8em;opacity:0.7" "live · auto-refreshes every 3s")
(h2 "metrics")
(unquote (otel/-metrics-strip m))
(h2 "latest trace")