forked from DataDog/dd-trace-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with auto-injection of Correlation Identifiers (Serilog) (D…
…ataDog#472) Scenario: Some time after the first span is activated, we have set the logging context properties dd.trace_id=0 and dd.span_id=0. Application code then sets their own logging context properties. Then, a new span is created and previously-set properties no longer exist in the logging context. Problem: Our OnSpanActivated event immediately disposes the previously-set correlation identifier properties before re-adding the new values. Serilog has a strict correctness guarantee that requires properties be modified in stack order. Since we remove properties further down the stack, we end up losing properties. Fix: For Serilog, do not add efault values of TraceId=0 and SpanId=0. Also, add and remove the two properties on SpanOpened and on SpanClosed. This ensures that properties only get added to/removed from the stack once.
- Loading branch information
1 parent
c018777
commit efe193e
Showing
7 changed files
with
365 additions
and
122 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
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
Oops, something went wrong.