Skip to content
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

Merged
merged 12 commits into from
Jun 17, 2022

Conversation

blumamir
Copy link
Member

@blumamir blumamir commented Jun 13, 2022

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 some any casts to make it work. I welcome any tips on how to resolve these issues cleanly

@blumamir blumamir requested a review from a team June 13, 2022 15:48
@github-actions github-actions bot requested a review from obecny June 13, 2022 15:48
@blumamir blumamir marked this pull request as draft June 13, 2022 15:50
@blumamir
Copy link
Member Author

I have few typescript issues to fix and then it will be ready for review

@codecov
Copy link

codecov bot commented Jun 14, 2022

Codecov Report

Merging #1056 (8d8211e) into main (6a82269) will increase coverage by 0.11%.
The diff coverage is 100.00%.

@@            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     
Impacted Files Coverage Δ
...tapackages/auto-instrumentations-node/src/utils.ts 98.00% <100.00%> (ø)

Copy link
Contributor

@habmic habmic left a 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/README.md Outdated Show resolved Hide resolved
@blumamir blumamir marked this pull request as ready for review June 14, 2022 14:07
@rauno56
Copy link
Member

rauno56 commented Jun 14, 2022

Few nits and questions, nothing major. 👍

@blumamir
Copy link
Member Author

Few nits and questions, nothing major. 👍

Thank you 🙏
Addressed all comments

@rauno56
Copy link
Member

rauno56 commented Jun 15, 2022

Perfect! 🟢 from my end! Thanks!

@rauno56 rauno56 merged commit 68cf014 into open-telemetry:main Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants