Skip to content

feat(o11y): join the board feed to the app's traces - #59

Merged
i11v merged 1 commit into
mainfrom
feat/board-trace-propagation
Oct 17, 2026
Merged

i11v merged 1 commit into
mainfrom
feat/board-trace-propagation

Conversation

@i11v

@i11v i11v commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Requested by Ilnur · project thread

Before: the app's feed.board span (waiting for a stop's board) and the worker's poll that answers it are separate traces, since the socket carries no trace context. When one Golemio fetch serves several sessions, or a board comes from cache, nothing ties the reusing call to the fetch.

After: the app's first board for a stop shows up as one trace from feed.board through ClientSession.poll and DepartureGateway.getBoards to the Golemio request. Calls that reuse another call's fetch link to it, and spans say how each board was served.

How:

  • Contract: Subscribe gets an optional traceparent. Backward compatible (contract:check passes); new fixture ws-subscribe-traced.
  • iOS: DeparturesFeed asks the stop model for the open feed.board span's traceparent when it sends a subscription. On a stop switch the board wait now starts before the subscribe, so it carries the trace.
  • Worker ClientSession: the poll on Subscribe runs under the client's span; alarm polls link back to it (tablo.link=subscription, in memory only). Polls record tablo.poll.trigger, tablo.poll.outcome (sent / superseded / idle / failed), tablo.selectors, tablo.sockets, plus tablo.error on failure.
  • Worker DepartureGateway.getBoards: in-flight claims and cache entries remember the span that fetched them. A call that awaits another's fetch links to it (tablo.link=inflight); a cache hit links to the call that filled it (tablo.link=cached). Attributes: tablo.boards.{requested,cached,fetched,awaited,stale,missing}, tablo.degraded, tablo.reason.
  • Tests: two new gateway tests check the links and counts with a recording tracer. The iOS contract test covers the traced frame.

Generated by Claude Code

The app sends the traceparent of its feed.board span with Subscribe (an
optional field, so older builds keep working). The session runs its first
poll under it, and later alarm polls link back to it.

DepartureGateway.getBoards links to the call whose Golemio fetch it
reused, whether it awaited that fetch or hit the cache it filled, and
records how each board was served. Session polls record their trigger and
outcome.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SDM2pVeSUgwNr2EUZAajLo
@i11v i11v self-assigned this Oct 17, 2026
@github-actions

Copy link
Copy Markdown

🚀 Preview deployed: https://preview-59.tablo.run
fallback: https://tablo-pr-59.i11v.workers.dev

@i11v
i11v marked this pull request as ready for review October 17, 2026 23:20
@i11v
i11v merged commit bd5c682 into main Oct 17, 2026
4 checks passed
i11v added a commit that referenced this pull request Oct 17, 2026
<!-- claude-projects-attribution: {"github_login":"i11v"} -->
_Requested by **Ilnur** · [project
thread](https://claude.ai/code/project/chan_015jUPvh4v8p3jXuvn8TmyCX?thread=cmsg_015jUPvh4v8p3jXuvn8TmyCXMd3FYuzHiurWCowHHeniLq)_

Stacked on #59 (it uses that PR's trace helpers); the base switches to
`main` once #59 merges.

Before: a `TransitGateway.getTripVehicle` or `getVehicles` span looks
the same whether it fetched from Golemio, waited on another request's
fetch, hit the cache, or served stale data after upstream failed.

After: those spans say which (`tablo.cache` = `hit` / `inflight` /
`fetched`), with `tablo.outcome`, and `tablo.cache.stale` +
`tablo.reason` when a stale answer stood in for a failed fetch. Hits and
shared fetches link to the span that did the fetch, the same way #59
does for boards.

How: `makeOutcomeCache` keeps the fetching span's ids with each
in-flight claim and cache entry, and annotates and links the caller's
span. Two new tests in `transit.test.ts` check the attributes and links
with a recording tracer (moved into `test/fakes.ts` so both gateway
suites share it).

---
_Generated by [Claude
Code](https://claude.ai/code/session_01SDM2pVeSUgwNr2EUZAajLo)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants