-
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
fix: remove unuseful patch message from instrumentations #2161
Conversation
@JamieDanielson @trentm @pichlermarc thanks again for the great feedback and discussion on the previous PR. Since those changes were intentionally left out of the previous one, I opened a follow-up to apply the issues we talked about in a dedicated PR. I also added a section to the GUIDELINES.md file for future reference to capture the decisions. Please let me know if this work correctly reflects the discussion in #2107 🙏 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2161 +/- ##
==========================================
- Coverage 90.97% 90.45% -0.53%
==========================================
Files 146 147 +1
Lines 7492 7571 +79
Branches 1502 1589 +87
==========================================
+ Hits 6816 6848 +32
- Misses 676 723 +47
|
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.
I think this looks great - I especially love the addition to the guidelines explaining where it might be useful to have logging about patches. I left a few nits but nothing blocking from me.
GUIDELINES.md
Outdated
@@ -164,3 +164,36 @@ To support this use case, you can choose one of the following options: | |||
}; | |||
... | |||
``` | |||
|
|||
## Diag Channel |
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.
🤩 Love having this guideline written out here
|
||
Instrumentation should not add additional debug messages for triggering the patching and unpatching callbacks, as the base class will handle this. | ||
|
||
Instrumentation may add additional patch/unpatch messages for specific functions if it is expected to help in troubleshooting issues with the instrumentation. Few examples: |
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.
Oh, another thought I had that I think will probably be updated in the follow-up PR that replaces inconsistent usages of api.diag.debug
and similar that aren't using the instrumentation this
to allow for this._diag.debug
. When we make that change we should update guidelines for that as well, though it will already be easier to follow suit once these are all more consistent 😄
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.
certainly, I aim to first remove or hoist unneeded diag messages, and then will transform all remaining diag message to use this._diag
and update the GUIDELINES.md 👍
open-telemetry/opentelemetry-js#4663 will also help in hosting many diag prints and remove the repeated code from dozens of places in contrib.
Co-authored-by: Jamie Danielson <[email protected]>
Co-authored-by: Jamie Danielson <[email protected]>
Co-authored-by: Jamie Danielson <[email protected]>
Co-authored-by: Jamie Danielson <[email protected]>
Co-authored-by: Jamie Danielson <[email protected]>
Thank you @JamieDanielson Your suggestions are always valuable. addressed all the comments 🙏 |
#2107 removed the diag prints on
InstrumentationNodeModuleDefinition
andInstrumentationNodeModuleFile
,patch
andunpatch
callbacks, as this message is now hoisted to be emitted consistently from the base class. The scope of this PR was narrow to handle specific types of messages that became redundant, but it was noted that there are other diag prints for patching and unpatching specific function from moduleExports.This PR is a followup to #2107