otel: tick P8, log progress — roadmap P1-P8 complete (124/124)
This commit is contained in:
@@ -61,11 +61,12 @@ type-block grammar + type-def editor). You are on branch `loops/otel` in
|
||||
attributes). `otel/export-otlp traces` → the JSON; POST to an OTLP HTTP collector via an
|
||||
**injected transport** (so it's testable without a live collector). Tests: OTLP shape matches
|
||||
the spec for a known trace; the transport receives the payload.
|
||||
- [ ] **P8 — context propagation + errors.** Parse/emit the W3C `traceparent` header so a trace
|
||||
- [x] **P8 — context propagation + errors.** Parse/emit the W3C `traceparent` header so a trace
|
||||
spans services (fed with the host's inter-service calls); mark error spans (`:status :error`
|
||||
+ an event). Tests: traceparent round-trips; an error thunk yields an error span.
|
||||
|
||||
## Progress log (newest first)
|
||||
- 2026-07-01 — P8 done — **ROADMAP COMPLETE (P1–P8, 124/124)**. `otel/format-traceparent`/`otel/current-traceparent` emit W3C `00-<32hex trace>-<16hex span>-01`; `otel/parse-traceparent` → `{:version :trace-id :parent-id :flags :sampled}`, nil on malformed/bad-width — round-trips. `otel/-timed` now GUARDS the thunk: success spans get top-level `:status "ok"` (attrs untouched), a raised error records a span with `:status "error"` + an `{:name "exception" :message}` event, pops the stack, and propagates. 20 new tests (traceparent round-trip + current + malformed; error span status/name/event/message + clean stack; success=ok). GOTCHA (saved to memory): an explicit `(raise e)` inside a guard handler RE-ENTERS the same guard and hangs — propagate instead via a clause whose TEST does the side-effect and returns `false`, letting R7RS guard auto-reraise to the outer handler.
|
||||
- 2026-07-01 — P7 done. `otel/export-otlp spans` folds → the OTLP/JSON envelope `{:resourceSpans [{:resource … :scopeSpans [{:scope … :spans […]}]}]}`; each span has hex `traceId`(32)/`spanId`(16)/`parentSpanId` (from `otel/-pad-hex` of the numeric id suffix via `string->number`+`number->string _ 16`), uint64-as-string `startTimeUnixNano`/`endTimeUnixNano`, typed `attributes` (number→`intValue`, else `stringValue`), and `kind` (2 SERVER if http.method, else 1 INTERNAL); root omits `parentSpanId`. `otel/export-otlp-json` → `dream-json-encode`. `otel/post-otlp endpoint spans transport` POSTs `{:method :url :headers :body}` through an INJECTED transport (tests pass a recorder; real deploy passes http POST). Suite 104/104 (26 new: nesting depth, hex widths+values, string timestamps, kinds, typed attrs, parentSpanId link, json+transport, empty envelope). All needed prims (`string->number`,`number->string`radix,`split`,`keys`,`assoc`,`has-key?`,`dream-json-encode`) are real (not server-env), so conformance-safe.
|
||||
- 2026-07-01 — P6 done. `GET /otel` (`otel/dashboard-route`) SSRs `otel/dashboard`: metrics strip (table) + latest-trace waterfall `<svg>` + recent-traces `<ul>`, on a root carrying Datastar-style `data-on-load="@get('/otel/stream')"`. `GET /otel/stream` (`otel/stream-route`) emits an SSE frame `event: otel.span\ndata: <sxtp event>` — `otel/span-event` wraps a span as an SXTP `event` (the host's Datastar-borrowed wire format), `otel/-stream-body` frames the latest. Plus `otel/recent-traces` (newest-first {:trace :name :spans}) + `otel/latest-trace`. `otel/routes` mounts via make-app. Suite 78/78 (17 new: recent-traces order, SSR svg+strip+id+sub, SSE event-stream/framing/name, GET /otel via make-app, empty-ring placeholder). DECISION: SSR + declarative reactive attrs + SSE patches IS the reactive-island model here (sxtp = Datastar); SSRs via `render-to-html` (plain HTML tags, not `render-page` which is a server-env prim unavailable in conformance). Live client hydration = deploy concern, out of build+test scope.
|
||||
- 2026-07-01 — P5 done. `otel/metrics spans` → `{:total-requests N :routes (…)}`; each route = `{:route :count :p50 :p95 :p99}`, route key = `:http.route` attr (falls back to span name). Nearest-rank percentiles (rank=ceil(p/100·N), 1-based) over per-route durations; needed a hand-rolled `otel/-insert`/`otel/-sort-nums` (no `sort` prim) + order-preserving `otel/-distinct`. `otel/metrics-recent` = over the ring. Suite 61/61 (11 new: total, 2 routes, feed count + p50=30/p95=50/p99=50 from [10..50], single-sample p50, sort helper, empty→zeroed). Note: `/` is float division here so `ceil(p/100·N)` is exact.
|
||||
|
||||
Reference in New Issue
Block a user