-
Notifications
You must be signed in to change notification settings - Fork 534
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
feat(lru-memoizer): add instrumentation for lru-memoizer #1056
Conversation
I have few typescript issues to fix and then it will be ready for review |
Codecov Report
@@ Coverage Diff @@
## main #1056 +/- ##
==========================================
+ Coverage 95.91% 96.02% +0.11%
==========================================
Files 13 14 +1
Lines 856 906 +50
Branches 178 182 +4
==========================================
+ Hits 821 870 +49
- Misses 35 36 +1
|
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.
LGTM
plugins/node/instrumentation-lru-memoizer/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
plugins/node/instrumentation-lru-memoizer/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
plugins/node/instrumentation-lru-memoizer/src/instrumentation.ts
Outdated
Show resolved
Hide resolved
Few nits and questions, nothing major. 👍 |
Thank you 🙏 |
Perfect! 🟢 from my end! Thanks! |
Which problem is this PR solving?
This package is internally storing callbacks in a queue and then invokes them with a different context from which they were queued. This behavior causes spans to appear in the wrong trace.
Short description of the changes
I did not generate any spans for this instrumentation (although it can be done as a future enhancement). This PR is just about fixing the context which is currently incorrect because callbacks are used in a manner that is not supported by ContextManager and it creates some really funky traces.
The package itself seems to be unmaintained, and also includes some typescript issues which made the instrumentation testing fail to compile. I had to turn on
skipLibCheck
and to make someany
casts to make it work. I welcome any tips on how to resolve these issues cleanly