-
Notifications
You must be signed in to change notification settings - Fork 804
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!(instrumentation): add patch and unpatch diag log messages #4641
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blumamir
changed the title
feat(instrumentation): add patch and unpatch diag log messages
feat!(instrumentation): add patch and unpatch diag log messages
Apr 17, 2024
MSNev
approved these changes
Apr 17, 2024
trentm
approved these changes
Apr 17, 2024
JamieDanielson
approved these changes
Apr 17, 2024
pichlermarc
approved these changes
Apr 18, 2024
This was referenced May 28, 2024
Open
Zirak
pushed a commit
to Zirak/opentelemetry-js
that referenced
this pull request
Sep 14, 2024
…-telemetry#4641) * refactor(@opentelemetry/instrumentation): add patch and unpatch diag log messages * chore: CHANGELOG * fix: exclude version in core packages --------- Co-authored-by: Marc Pichler <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces diag.debug message for
@opentelemetry/instrumentation
patch and unpatch function for nodejs.It is a common practice for instrumentations that implement
InstrumentationBase
to definepatch
andunpatch
functions for modules and module files, and emit a diag message on each invocation. Since we have dozens of instrumentations that does the same thing, the current practice introduces unnecessary repetitions, inconsistencies and degraded user and maintainer experience.This PR hoists the diag printing to the
@opentelemetry/instrumentation
package where the diag message is written once and applied to all instrumentations.Instrumentation implementors will need to remove the current diag.debug call in
patch
andunpatch
if they apply any, so the message will only be printed one by the base class.example of the message content with
DiagConsoleLogger
:The message is formatted as constant message and attributes.
I created a contrib PR: open-telemetry/opentelemetry-js-contrib#2107 to apply the changes, so once we release this feature we can immediately rebase the contrib PR and release instrumentations based on this change