What html-revisor tells Honeycomb about a save, from your keystroke to the file on disk and back, and the queries that show it.
HRV_TELEMETRY=1 OTEL_EXPORTER_OTLP_ENDPOINT=https://api.honeycomb.io OTEL_EXPORTER_OTLP_HEADERS=x-honeycomb-team=<ingest key> ./run
HRV_TELEMETRY is the switch. Without it the server sends nothing, whatever OTEL_* variables it inherits. With it, the standard variables say where spans go. Spans land in team modernity, environment local, dataset html-revisor (the service name). .be in this repo holds the key and the variables.
The server tells the page that telemetry is on, and only then does the browser record spans. A failed export prints telemetry export failed on the server's stderr.
A directive typed on this page and closed with Escape, which sends it at once instead of after 0.4 s of quiet. The browser's spans are purple; the server's are blue. Times from trace d0888bfe….
The save span starts when the change goes out. The typing before it is in two attributes: hrv.wait.ms since the first keystroke, hrv.quiet.ms since the last. The round trip is about 13 ms on this 14 KB page. Most server steps take under 2 ms here. A step that stays under 1 ms on a big page too doesn't earn its span. set directive keeps its span: it passed 1 ms once, at 1.17 ms on a page over 30 KB.
A PUT change with no write file step saved what the file already holds, and hrv.wrote is false on it. Typing makes these: the server trims a directive, so a trailing space changes nothing, and in markdown a trailing space at the end of a paragraph is gone in the canonical file. A refused save (412, 400) stops before that step too.
| Span | Where | From → to | Attributes |
|---|---|---|---|
save directive, save markdown |
browser | from when we decide to save, until the page has been updated |
hrv.change.kind, hrv.scope.id, hrv.element (tag name), hrv.edits (keystrokes in this one save), hrv.wait.ms (first keystroke → sent, queue included), hrv.quiet.ms (last keystroke → sent), hrv.html.before, hrv.html.after (markdown saves), hrv.markdown.before, hrv.markdown.after or hrv.directive.before, hrv.directive.after; each text with a .length. hrv.reverted on markdown saves: true when this save carries a Revert. Revert types the committed markdown into the field, so it counts as one more edit, and hrv.markdown.before is what it threw away. hrv.directive on both kinds: the scope's directive once the save lands. hrv.box.session: one ID per box opened, shared by its saves and its done.
|
PUT |
browser |
PUT sent → answer received; its traceparent makes the server span its child. client.js makes it; no instrumentation library.
|
hrv.queued (changes behind it), http.response.status_code
|
apply |
browser | answer received → page updated | |
close box (event) |
browser | a dot on the save going out when the box closes (Done, Escape, a click away, another box, a ⌘-click on a link); none when no save is going |
hrv.close.by, hrv.scope.id, hrv.pending (saves still waiting behind it)
|
done |
browser |
box closed → the server's answer; it waits behind the box's saves. Its traceparent makes POST done its child. A trace of its own.
|
hrv.box.session, hrv.scope.id, hrv.close.by, hrv.queued (saves ahead of it), hrv.announced, http.response.status_code
|
POST done |
server | request → response; a child span per step | hrv.page, hrv.scope.id, hrv.announced |
PUT change |
server | request → response; a child span per step |
hrv.page, hrv.page.bytes, hrv.change.kind, hrv.scope.id, hrv.change.bytes, hrv.directive.count, hrv.answer.bytes, hrv.conflict, hrv.wrote
|
GET page |
server | request → response; a child span per step |
hrv.page, hrv.page.bytes, hrv.normalized, hrv.element.count, hrv.scope.count, hrv.answer.bytes
|
Browser spans carry hrv.side = browser. A conflict or a failed save marks the browser's spans as errors. A text attribute stops at 50,000 characters, under Honeycomb's 64 KB limit; its .length is the full count. Server spans take their times from performance.now() on an anchor to the wall clock, so steps in one request start in order, to the microsecond.
| Action | Now | Planned |
|---|---|---|
| Opening a box |
No span. A scope's size shows up only when you save it. Closing the box makes a done span, and everything from one box shares hrv.box.session.
|
Undecided. For a scope's size without changing it, edit it and Revert. |
All of them are on one board: html-revisor: saves, over the last 24 hours, with filters for page and change kind. Each link below opens one in Honeycomb over the last two hours of dataset html-revisor.
save directive and save markdown.
PUT and apply, by kind of save.
hrv.wait.ms and hrv.quiet.ms, by kind of save.
close box events, by what closed the box and how many saves waited behind.
status_code 2): conflicts and failed saves.
hrv.reverted true picks out the Reverts, whose length is the committed scope.
The browser has no OpenTelemetry SDK. client.js records each span as a plain object (trace ID, span ID, parent, start and end, attributes, events) and posts a batch to /.hrv/spans every 2 s and when the tab hides. The server makes each one an OTel span with the browser's IDs and times, and sends it with its own spans. That route makes no span of its own.
Two reasons for no SDK. client.js is a plain script inlined into every page, with no build, and the web SDK would need a bundle. And a browser exporting to Honeycomb would need the ingest key in the page; through the server, the key stays on the server.
test/telemetry.test.mjs checks the spans against a stand-in collector. Given .be's variables, it also sends to Honeycomb (dataset html-revisor-test) and prints a run ID and trace ID. The ingest key can't read; an agent finds the trace with the honeycomb-modernity MCP.