Repository navigation
Conversation
Collaborator
|
Review requested:
|
sqlite.query tracing channel
logaretm
force-pushed
the
awad/sqlite-tracing-channel
branch
from
October 7, 2026 22:33
8bb848d to
62d59d8
Compare
logaretm
marked this pull request as ready for review
October 7, 2026 22:34
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66581 +/- ##
==========================================
+ Coverage 90.59% 90.65% +0.06%
==========================================
Files 797 797
Lines 278230 278439 +209
Branches 53482 53549 +67
==========================================
+ Hits 252066 252424 +358
+ Misses 16558 16395 -163
- Partials 9606 9620 +14
🚀 New features to boost your workflow:
|
logaretm
force-pushed
the
awad/sqlite-tracing-channel
branch
2 times, most recently
from
October 8, 2026 01:48
d316b62 to
4d08cae
Compare
bengl
reviewed
Oct 8, 2026
logaretm
added a commit
to getsentry/js-tracing-channels-proposals
that referenced
this pull request
Oct 9, 2026
Qard
approved these changes
Oct 26, 2026
Qard
left a comment
Member
There was a problem hiding this comment.
LGTM. The hasSubscribers checks could be simplified, but also fine to leave as-is. Using the shared one would check the other async channels too unnecessarily.
logaretm
force-pushed
the
awad/sqlite-tracing-channel
branch
from
October 26, 2026 15:46
4d08cae to
a24fe85
Compare
Publish run(), get(), all(), exec() and the matching SQLTagStore methods to a 'sqlite.query' TracingChannel, so APMs can produce query spans with correct parent linkage, errors, and the source SQL with its parameters. The query methods are now defined in lib/sqlite.js around the native implementations, which the binding exports. Without subscribers they only check the channel's hasSubscribers. iterate() is not traced. Signed-off-by: Abdelrahman Awad <abdelrahman.awad@sentry.io>
logaretm
force-pushed
the
awad/sqlite-tracing-channel
branch
from
October 26, 2026 15:56
a24fe85 to
1d8998c
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.
sqlitein Node only has thesqlite.db.query"profiling" channel, which can't give APMs real query spans, using a tracing channels allows for:startevent.errorchannel, which allows APMs to mark failing query spans.This PR publishes
run(),get(),all(),exec()and the tag store equivalents to asqlite.queryTracingChannel.The tests check the context for statement, tag store and exec queries, error events for SQL that fails to compile in exec() and for runtime failures, that a store bound to start stays active during the query, that iterate() isn't traced, and that every query method publishes exactly once.
The end result is APM's and users can build spans/metrics/logs telemetry out of these channels easily with a simple subscriber. This is an example of a subscriber that creates spans out of it (using disk driver):
Regarding tag stores
For tracing tag store queries, we needed to cache the
SQLTagStoretemplate, sincecreateTagStore()built a new one per store, so every store had its own prototype. Stores now share one prototype, which is visible from JS.Happy to split this and tag store tracing into a follow-up PR if that's easier to review.
Benchmarks
get()run()get(), coldrun()that throwsrun()that throws, coldMedian of 30 interleaved runs on an M3 Pro, in-memory db, 10k calls, with a 300k-call warm-up except for the cold rows. "native" is the binding's native method, the one
mainputs on the prototype. Like #66575, calls that throw pay for the extra JS frame, about 90 ns once optimized.Refs: #62241
Refs: #66575