-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
spanlogger: fix double logging of caller information (#604)
* Extend existing tests to catch issue * Add further test cases * Fix issue where caller information is logged twice * Add benchmark comparing the performance of `Caller` and `SpanLoggerAwareCaller` * Change name to satisfy linter * Fix tests broken by removal of `caller` key/value pair from `SpanLogger` * Don't bother with checking for go-kit/log stack frames until we've seen SpanLogger This makes the cost of spanlogger.Caller negligible for use outside of SpanLogger: │ SpanLoggerAwareCaller/with_go-kit's_Caller-10 │ SpanLoggerAwareCaller/with_dskit's_spanlogger.Caller-10 │ │ sec/op │ sec/op vs base │ comparison-after-step-2.txt 927.5n ± 5% 932.1n ± 2% ~ (p=0.093 n=6) │ SpanLoggerAwareCaller/with_go-kit's_Caller-10 │ SpanLoggerAwareCaller/with_dskit's_spanlogger.Caller-10 │ │ B/op │ B/op vs base │ comparison-after-step-2.txt 732.5 ± 0% 733.0 ± 0% ~ (p=0.636 n=6) │ SpanLoggerAwareCaller/with_go-kit's_Caller-10 │ SpanLoggerAwareCaller/with_dskit's_spanlogger.Caller-10 │ │ allocs/op │ allocs/op vs base │ comparison-after-step-2.txt 9.000 ± 0% 9.000 ± 0% ~ (p=1.000 n=6) ¹ ¹ all samples are equal * Reuse slice and use string equality check * Address PR feedback: use const in test Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com> --------- Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
- Loading branch information
1 parent
cf9b0bc
commit 619c421
Showing
2 changed files
with
128 additions
and
54 deletions.
There are no files selected for viewing
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
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