feat(sandbox): add MSW mock intake panel to visualize OTLP exports#347
Draft
mquentin wants to merge 5 commits into
Draft
feat(sandbox): add MSW mock intake panel to visualize OTLP exports#347mquentin wants to merge 5 commits into
mquentin wants to merge 5 commits into
Conversation
mquentin
force-pushed
the
mquentin/sandbox_msw_intake_panel
branch
from
July 17, 2026 11:17
56a82dc to
f74f16f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disclaimer
The sandbox UI now has redundancy between the
Event LogandIntake receivedsections, and the expand feature inIntake receivedisn't responsive... I'm happy to invest more time fixing this if the SIG considers the initiative worthwhile.Also the recent e2e testing initiative #332 has been merged which share quite some MSW approach with this PR.
What
Adds an in-browser "Intake received" panel to the sandbox that intercepts the
SDK's OTLP/HTTP exports with MSW and renders exactly what a
collector would receive over the wire — no backend, no CORS, no extra process.
It sits under the "Equivalent SDK init" panel, so you get a side-by-side of
"here's the code / action" → "here's what got exported".
Why
The sandbox could trigger telemetry but there was no way to see the resulting
export payloads without an external collector (and cross-origin exports to
localhost:4318would otherwise need CORS). MSW intercepts the request insidethe browser, so it works with zero setup — and, being fully client-side, it also
works on the deployed GitHub Pages showcase.
How it works
POST */v1/tracesand*/v1/logs, decode the OTLP JSON(AnyValue/KeyValue, span durations,
session.id), and publish to the UI.expand to see records grouped by instrumentation scope, each with duration,
trace=…, and asession=…chip → per-request raw OTLP JSON toggle.Usage
npm run dev— enabled automatically in dev (single command, noextra process).
?intake=mockto the URL.stays out of the way — it's dev/flag-gated so it never swallows real exports.