-
Notifications
You must be signed in to change notification settings - Fork 309
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 using log correlation with a custom logger #419
Merged
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
brettlangdon
previously approved these changes
Jan 31, 2019
brettlangdon
approved these changes
Feb 1, 2019
rochdev
added a commit
that referenced
this pull request
Feb 6, 2019
* v0.8.0 * prefix span context properties with an underscore (#397) * add log propagator and trace identifiers for log correlation (#396) * fix baggage items at the span level instead of trace level (#398) * add middleware and stack trace support for express (#399) * add dns integration (#405) * add net integration (#406) * add trace search sampling configuration (#407) * add more metadata to net.connect and update operation name (#409) * add automatic log correlation of tracer identifiers for winston (#408) * add automatic log correlation of trace identifiers for bunyan (#410) * add noop span context with the correct API (#413) * add automatic log correlation of tracer identifiers for pino (#414) * add automatic log correlation of tracer identifiers for pino * add missing plugins to the build * Add protocol as a configuration option for the dd-trace-agent URL (#416) * Add protocol as a configuration option for the dd-trace agent URL. This is useful for scenarios where a SSL-terminating load balancer sits in front of the datadog-agent * Fix lint errors * Switching from protocol override to url override per CR * Fixing missing comma from previous commit * Fix tests * overrideUrl -> url * add support for latest module versions in all plugins (#417) * fix using log correlation with a custom logger (#419) * disable net and dns plugins (#421) * fix http server response handlers not running in the request scope (#422) * fix log injection with a null active span and update injection keys (#423) * Revert "add trace search sampling configuration (#407)" (#425) This reverts commit 4dac394. * add documentation about enabling log correlation (#427) * fix references to the old trace IDs (#426) * fix noop span context trace IDs to match the backend expectation (#429)
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 fixes log correlation when used with a custom logger. The problem was with the way instrumentation works, where the tracer must be imported before the instrumented module. This works well in most cases, but since a custom logger can be registered with the tracer, it has to be imported first, meaning the tracer doesn't have time to patch it. By attempting to load the module from the require cache, we can patch it after the fact. This won't work for all cases, but it will work for this purpose specifically.