Skip to content

feat(local): Process telemetry without the Spotlight dependency - #1940

Merged
MathurAditya724 merged 9 commits into
mainfrom
codex/local-telemetry-features
Nov 13, 2026
Merged

MathurAditya724 merged 9 commits into
mainfrom
codex/local-telemetry-features

Conversation

@MathurAditya724

@MathurAditya724 MathurAditya724 commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Local now decodes and retains Sentry envelopes directly, removing @spotlightjs/spotlight from the CLI, viewer, and lockfile. The implementation stays inside the existing Local app and CLI; it does not introduce a reusable SDK or another package.

Partial transaction and streamed-span updates merge by captured completion time, preserving names and fields across reordered deliveries. Query/resource summaries handle incomplete metadata, AI summaries combine captured steps, and continuous profile chunks can be inspected together. Trace waterfalls show observed sampled functions with their captured provenance; gaps and ambiguous parallel spans do not invent activity.

The private receiver codec preserves binary attachments and malformed raw deliveries, validates byte lengths, and bounds encoded input, decompressed output, and pending admissions. Live delivery and session clear/resize/close ordering retain stable cursors and raw-download identities. Existing replay examples remain available. Spotlight-compatible health and envelope headers remain for existing Sentry SDK transports; the Spotlight npm dependency is removed.

This replaces the shared-package approach in #1690 and getsentry/spotlight#1374 for Sentry Local. It does not migrate Spotlight itself onto Toolkit or expose the earlier proposals’ public SDK APIs.

Preserve partial span updates, reconcile captured AI interactions, and combine
continuous profiles directly in Local. Project sampled functions only across
observed intervals with unambiguous captured parents, while keeping original
chunks available for inspection.

Bound receiver input and decompression, retain malformed deliveries with stable
raw IDs, and coordinate pending work with clear, resize, and session close.

Co-Authored-By: Codex <[email protected]>
@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-local Ready Ready Preview Nov 13, 2026 6:11am UTC

Request Review

Comment thread apps/local/src/lib/trace-model.ts Resolved
Select title candidates from the completed span model so late parent
updates cannot leave a former root with stale title priority. Preserve
first-root ties and cover reordered segment deliveries.

Co-Authored-By: Codex <[email protected]>
Comment thread apps/local/src/lib/trace-model.ts Resolved
MathurAditya724 and others added 2 commits November 4, 2026 19:22
Flush pending subscription history before eviction and deliver new entries
synchronously. Keep caught-up readers on a constant-time path, and cover
bursts exceeding retention through SSE callbacks without manual flushing.

Co-Authored-By: Codex <[email protected]>
Prefer a meaningful captured title over the URL route so streamed HTTP
segments retain their method. Fall back to the route for blank or missing
names and cover all three cases.

Co-Authored-By: Codex <[email protected]>
Comment thread apps/local/src/lib/profile-spans.ts Resolved
MathurAditya724 and others added 3 commits November 4, 2026 20:10
Fold original captures in completion order instead of assigning retained
fields the accumulated span's maximum end time. Keep captured names above
URL fallbacks, preserve first-root ties, and cover all six delivery orders.

Co-Authored-By: Codex <[email protected]>
Retain pending admission accounting across clear and reset until queued
operations settle. Generation checks still reject invalidated work, and
new admissions recover after the old queue drains.

Co-Authored-By: Codex <[email protected]>
Update the derived payload timestamp and metadata duration when contiguous
sampled spans coalesce, so the detail JSON agrees with the trace overview.
Extend the projection regression without changing original captures.

Co-Authored-By: Codex <[email protected]>
Comment thread apps/local/src/lib/trace-model.ts Resolved
Remove the transaction-origin name bonus so equally meaningful captured
names follow completion order across transaction, embedded-child, and
streamed-span updates. Cover both arrival orders for roots and children.

Co-Authored-By: Codex <[email protected]>
Replace remaining Spotlight codec and buffer uses with private Local
contracts and byte decoding. Preserve raw bytes, delivery IDs, compatible
health headers, bounded compression, and lifecycle barriers; remove both
workspace dependencies and obsolete SDK fixture helpers.

Merge current main while keeping explicit unsupported-encoding errors.

Co-Authored-By: Codex <[email protected]>
@MathurAditya724 MathurAditya724 changed the title feat(local): Improve telemetry inspection and bounded ingestion feat(local): Process telemetry without the Spotlight dependency Nov 13, 2026
@MathurAditya724

Copy link
Copy Markdown
Member Author

Final review at 5ffbc1312d09c4885e914800b2a43ef4012dc49f found no remaining correctness or security blockers. All five existing review threads are resolved. Hosted checks are green, including Local E2E on Linux/macOS/Windows, CodeQL, dependency review, and Warden. The full local gate passed typecheck, lint, and 16,596 tests; independent review also reran 194 focused tests successfully.

Ran isolated Next.js 16.2.6 and Hono 4.13.18 sample apps using Sentry SDK 11.12.0 against this commit's actual receiver. Both HTTP endpoints returned 200. All 12 SDK envelopes parsed and arrived over SSE with unique delivery IDs. Viewer-model assertions verified each app's trace/span hierarchy, one instrumented query, resource size, AI messages/response/token totals/finish reason, correlated structured log, exception event, and exact UTF-8 attachment bytes. Query/AI spans used synthetic attributes; these checks exercised capture and processing rather than real database or model providers. Existing fixture/integration tests cover profiles and the broader viewer surfaces.

The CLI and Local viewer manifests and lockfile no longer contain @spotlightjs/spotlight. The compatible transport headers and health identifier remain so existing Sentry SDK Spotlight transports continue to work. No new SDK or package is introduced. The title and description now reflect that final implementation.

@MathurAditya724
MathurAditya724 marked this pull request as ready for review November 13, 2026 06:56
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 13, 2026
@MathurAditya724
MathurAditya724 merged commit 54827e3 into main Nov 13, 2026
44 checks passed
@MathurAditya724
MathurAditya724 deleted the codex/local-telemetry-features branch November 13, 2026 06:57

This branch was successfully deployed

1 active deployment
Preview — 5ffbc131 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant