This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
HttpHandlerDiagnosticListener did not send DiagnosticSource Stop event on netfx in W3C mode #40777
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.
HttpHandlerDiagnosticListener monkey-patches WebRequest to enable tracing with DiagnosticSource.
HttpHandlerDiagnosticListener uses presence of tracing headers to determine if a request was initially instrumented (
Activity.Current
which isAsyncLocal
does not survive in WebRequest callbacks). Based on header presence, when response tarts, it notifies a listener with 'Stop' callback.In #35882 it started to support W3C trace-context and now
Stop
event is not sent if a new W3Ctraceparent
is present, but oldRequest-Id
is not.This issue only reproduces when tracing is on and W3C mode for Activity is on. By default tracing is off and no events are sent. When tracing is on, default Activity format is the old one, that works with Request-Id header, so problem does not repro.
Tracing tools that enable W3C, can workaround it with adding Request-Id header themselves.