-
Notifications
You must be signed in to change notification settings - Fork 123
Support W3C incoming headers in opt-in mode #735
Conversation
89367dc
to
4d043ee
Compare
4d043ee
to
5fdfa9f
Compare
…oft/ApplicationInsights-aspnetcore into lmolkova/supportW3COnCore
ready for review @cijothomas ;) |
@@ -65,6 +65,7 @@ | |||
<PackageReference Include="System.Collections.Immutable.Analyzers" Version="1.2.0-beta2"> | |||
<PrivateAssets>All</PrivateAssets> | |||
</PackageReference> | |||
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.4.1 -> to 2.5.0-beta1 - please update this as well.
// W3C | ||
if (this.enableW3CHeaders) | ||
{ | ||
SetW3CContext(httpContext.Request.Headers, activity, out sourceAppId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we log all the header values in Eventsource with Verbose logging level? It'll help with support tickets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea, I also wonder if it is secure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AS discussed, lets not do it now. We can ask Cx to add TI to dump headers, if a need arises.
} | ||
|
||
[Fact] | ||
public void OnHttpRequestInStartWithW3CHeadersAndRequestIdIsTrackedCorrectly() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename unit test to indicate OnBeginRequest bein tested
Implements w3c distributed tracing standard.
This change enables opt-in W3C support via settings.
To enable it, set
ApplicationInsightsServiceOptions.RequestCollectionOptions.EnableW3CDistributedTracing
to true and provide options to theAddApplicationInsights telemetry
This change ensures W3C ids are set on the telemetry (operationId, parentId and Id). 'legacy' ids are set in custom dimensions whenever they are different from the W3C ones.
This change requires UI queries change to support querying for custom dimensions for the cases when operation id or parent id do not match on the legacy-W3C boundary.
This PR depends on changes in DependencyCollector that will be shipped in 2.8.0-beta1 (microsoft/ApplicationInsights-dotnet-server#945) and cannot be merged until that. Sharing it to get the early feedback.@cijothomas @reyang @SergeyKanzhelev please review