From b478d0a8da62f3efc0932c8213fc0c0f3e31948a Mon Sep 17 00:00:00 2001 From: giles Date: Wed, 1 Jul 2026 15:55:03 +0000 Subject: [PATCH] otel: tick P7, log progress --- plans/otel-loop.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plans/otel-loop.md b/plans/otel-loop.md index 625d740b..b0133a77 100644 --- a/plans/otel-loop.md +++ b/plans/otel-loop.md @@ -56,7 +56,7 @@ type-block grammar + type-def editor). You are on branch `loops/otel` in without reload. Reuse the reactive runtime (`sx/sx/reactive-runtime.sx`, `web/`) + Dream SSE/streaming already in `lib/host`. Tests: the island SSRs; the SSE endpoint emits a span event; the page lists recent traces. -- [ ] **P7 — OTLP-JSON export.** Serialize spans to the OTLP/JSON schema (resourceSpans → +- [x] **P7 — OTLP-JSON export.** Serialize spans to the OTLP/JSON schema (resourceSpans → scopeSpans → spans with traceId/spanId/parentSpanId/name/startTimeUnixNano/endTimeUnixNano/ 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 @@ -66,6 +66,7 @@ type-block grammar + type-def editor). You are on branch `loops/otel` in + an event). Tests: traceparent round-trips; an error thunk yields an error span. ## Progress log (newest first) +- 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 `` + recent-traces `