Repository navigation
feat(sdk): Share portable telemetry processing across consumers - #1374
Draft
MathurAditya724 wants to merge 7 commits into
Draft
MathurAditya724 wants to merge 7 commits into
MathurAditya724 wants to merge 7 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Coverage Results 📊✅ Patch coverage is 83.80% (1764 of 2105 changed executable lines covered; target 80%). Changed files with executable lines (53)
Coverage diff@@ Coverage Diff @@
## main #1374 +/-##
==========================================
+ Coverage 55.49% 73.02% +17.53%
==========================================
Files 81 118 +37
Tracked lines 2586 3603 +1017
Branches 1889 2801 +912
==========================================
+ Hits 1439 2656 +1217
+ Misses 1147 947 -200
- Partials 186 295 +109Generated by Coverage Action |
Use telemetry store and pipeline names, explicit envelope and payload batch methods, and decoded history options. Preserve live retention and immutable snapshots for deeply nested span graphs. Co-Authored-By: Codex <noreply@openai.com>
Accept cross-realm byte inputs, preserve log-only traces and resource size metadata, and keep self-parented spans visible. Update the executable examples to the telemetry naming. Co-Authored-By: Codex <noreply@openai.com>
This branch was successfully deployed
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.
Spotlight's UI and SDK now share envelope normalization, trace assembly, logs, profiles, database/resource summaries, AI extraction, and web-vitals calculations. Server consumers get the same processing that powers the UI, including streamed spans from #1372. Moving the package to Toolkit remains separate work.
createTelemetryStore()from@spotlightjs/spotlight/sdk/coreaccepts parsed envelopes on the frontend or server.createTelemetryPipeline()from/sdk/nodeadds serialized payload decoding and bounded asynchronous decompression. The released/sdkbuffer helpers retain their existing behavior. Domain code moves out of the UI behind compatibility reexports, while the Node decoder no longer imports the Spotlight server.Both factories expose a shared
TelemetryReader, immutable snapshots, typed receipts, delivery IDs, ordered batches, cancellation, a drain barrier, and change notifications. Receipts distinguish processing from retention and include counts, a revision, and machine-readable diagnostics. Query/resource summaries are compact by default;includeSpans: trueretrieves detail. Reads support time/order/limit filters, and paged cursors are bound to the query and snapshot revision. Explicit versioned serializers preserve trace graphs, maps, and sets for JSON/tool consumers.The Node input methods are
ingestPayload()andgetDecodedPayload(); both factories also acceptingestEnvelope(). Pending ingestion, envelope bytes, retained history, decoded output, and enrichment time are bounded. The decompressor enforces its output limit before a compressed payload can expand without bounds. Parsed and payload writes share one Node admission queue, and cancellation during retention replay restores the previously committed history.Start review with the public contracts, core lifecycle, shared reader/serializers, and Node adapter. Retention defaults to 500 envelopes with a 64 MiB serialized-envelope budget. Eviction rebuilds derived state for correctness; immutable event/log/envelope copies and derived reads are reused, but large profiles still increase replay cost. The README documents exact limits, missing-record behavior, retry identity, lazy batch-copy semantics, JSON formats, and lifecycle behavior.
Regression coverage includes server/frontend/UI parity, binary/opaque items, malformed boundaries, compressed output limits, mixed-method admission and drain ordering, cancellation/reset during enrichment and eviction, byte retention, stale cursors, JSON graph references, and immutable UI reads. CI now checks the built public declarations and executes the server/frontend/React example contracts and lifecycle walkthrough after building.
The shared package and Sentry Local adoption are proposed in Toolkit #1690. After its first
@sentry/telemetryrelease, Spotlight can replace this extraction with the published dependency. Both PRs usecreateTelemetryStoreandcreateTelemetryPipeline; the Toolkit PR adds independently reusable Local inspection models.