Skip to content

feat(o11y): trace how trip and vehicle lookups are served - #60

Merged
i11v merged 3 commits into
mainfrom
feat/cache-trace-links
Oct 17, 2026
Merged

i11v merged 3 commits into
mainfrom
feat/cache-trace-links

Conversation

@i11v

@i11v i11v commented Oct 17, 2026

Copy link
Copy Markdown
Owner

Requested by Ilnur · project thread

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

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
The shared outcome cache records on the caller's span whether the answer
was a cache hit, another caller's in-flight fetch, or a fetch of its own
(tablo.cache), the outcome, and when a stale answer stood in for a failed
fetch. Hits and shared fetches link to the span that did the fetch.

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-60.tablo.run
fallback: https://tablo-pr-60.i11v.workers.dev

@i11v
i11v marked this pull request as ready for review October 17, 2026 23:20
@i11v
i11v changed the base branch from feat/board-trace-propagation to main October 17, 2026 23:28
# Conflicts:
#	apps/worker/test/gateway.test.ts
@i11v
i11v merged commit e123be2 into main Oct 17, 2026
2 checks passed
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