-
Notifications
You must be signed in to change notification settings - Fork 176
feat: Add tracing channels support #707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f6d665f to
f39e20b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
b3622f3 to
b59a383
Compare
|
@pi0 I refactored the logic here to use |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #707 +/- ##
==========================================
+ Coverage 91.77% 92.60% +0.83%
==========================================
Files 5 6 +1
Lines 401 446 +45
Branches 126 143 +17
==========================================
+ Hits 368 413 +45
Misses 33 33 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds Node.js tracing channels for all storage operations, enabling observability and performance monitoring.
Channel Naming Convention
All channels use the
unstorage.${operation}convention which when coupled with tracing channels produce the following diagnostic channels:tracing:unstorage.${operation}:starttracing:unstorage.${operation}:endtracing:unstorage.${operation}:asyncStarttracing:unstorage.${operation}:asyncEndtracing:unstorage.${operation}:errorWhich matches nicely with
fastifybut there isn't a lot of convention for them other than the Node.js recommendation.Traced operations
hasItem,getItem,setItem,setItems,removeItemgetItemRaw,setItemRawgetMeta(usesgetItemchannel withmeta: true)getItems,setItemsgetKeys,clearTracing context includes
keys[]- keys involved in the operationbase- mount point handling the operationdriver- driver name and options (single-key operations only)meta- flag for metadata operationsWe can probably add more, in the Nuxt unstorage instrumentation we only use those.
Example
All operations emit standard tracing events:
start,end,asyncStart,asyncEnd, anderror.