-
Notifications
You must be signed in to change notification settings - Fork 795
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
Plugins refactoring - new instrumentation package for plugins #1540
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1540 +/- ##
==========================================
- Coverage 93.18% 93.05% -0.13%
==========================================
Files 156 158 +2
Lines 4854 4882 +28
Branches 986 988 +2
==========================================
+ Hits 4523 4543 +20
- Misses 331 339 +8
|
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.
This looks really solid. I left some comments mostly to do with the README since I think writing instrumentation will be difficult for people their first time. The actual implementation is more or less exactly what I was thinking.
packages/opentelemetry-api/src/trace/instrumentation/Instrumentation.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts
Outdated
Show resolved
Hide resolved
LGTM right now. Are you planning on getting reviews on this and merging, then doing tests in a follow up PR? |
Ideally I would add more tests in following up PR after getting more reviews too. It will be easier also to add tests then and make some adjustments if required as the PR is already not the smallest one so might be harder to make reviews with more code on board. |
@dyladan just to be sure, the |
I think that's fine, but it is a little weird to me that the logger is only used in the SDK but has a noop in the API. I think I am fine either way on this one. The biggest strike against for me is that it is harder to remove things from the API later if we decide it was a bad idea, but easy to add it later if it causes a problem not having it. |
It will be used now in Instrumentation so all plugins will need that |
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.
This looks good to me. It may need some modifications as we actually start writing plugins, but I think we can merge this and try to port one of the plugins or write a new one.
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.
One comment, but otherwise, LGTM.
…elemetry#1540) * feat: add a new plugin base decoupled from the sdk * chore: web and node version that supports patching more files * chore: updating readme * chore: lint * chore: missing noop logger * chore: linting * chore: updating readme with info about many modules * chore: supporting calling enable and disable multiple times for node plugins * chore: simplifying readme example * chore: reviews * chore: moving interface Instrumentation to package instrumentation * chore: adding function for safe executing in plugins * chore: fixing typo Co-authored-by: Daniel Dyla <[email protected]>
…elemetry#1540) * feat: add a new plugin base decoupled from the sdk * chore: web and node version that supports patching more files * chore: updating readme * chore: lint * chore: missing noop logger * chore: linting * chore: updating readme with info about many modules * chore: supporting calling enable and disable multiple times for node plugins * chore: simplifying readme example * chore: reviews * chore: moving interface Instrumentation to package instrumentation * chore: adding function for safe executing in plugins * chore: fixing typo Co-authored-by: Daniel Dyla <[email protected]>
!Important! -> the only thing that left is test coverage, but I want this to be reviewed before adding many more tests as especially the tests for node will require more effort, so would rather avoid massive refactoring if there is anything here that will need to be changed before that.
This is continuation of plugin refactoring. #1449
This new plugin base is completely decoupled from the SDK and relies only on the API. After #1448 plugins using this base class will be able to be fully standalone, and will support instrumenting modules very early in the load process, even before the tracer provider is set up.
For some time we will allow for 2 plugins types until all plugins will be moved to use new class.
FYI
After this change the plugins http and https can be merged into one plugin too