Sitelet https://github.com/Microsoft/ApplicationInsights-aspnetcore/pull/735
Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Support W3C incoming headers in opt-in mode - #735

Merged
Cijo Thomas (cijothomas) merged 8 commits into
developfrom
lmolkova/supportW3COnCore
Aug 21, 2018
Merged

Cijo Thomas (cijothomas) merged 8 commits into
developfrom
lmolkova/supportW3COnCore

Conversation

@lmolkova

@lmolkova Liudmila Molkova (lmolkova) commented Aug 7, 2018 •

Copy link
Copy Markdown

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 the AddApplicationInsights 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.

Cijo Thomas (@cijothomas) Reiley Yang (@reyang) Sergey Kanzhelev (@SergeyKanzhelev) please review

@lmolkova Liudmila Molkova (lmolkova) changed the title [Do not merge] Support W3C incoming headers in opt-in mode Support W3C incoming headers in opt-in mode Aug 16, 2018
@lmolkova

Copy link
Copy Markdown
Author

ready for review Cijo Thomas (@cijothomas) ;)

<PackageReference Include="System.Collections.Immutable.Analyzers" Version="1.2.0-beta2">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />

Copy link
Copy Markdown
Contributor

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);

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Author

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?

Copy link
Copy Markdown
Contributor

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()

Copy link
Copy Markdown
Contributor

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

@cijothomas
Cijo Thomas (cijothomas) merged commit 17cc5de into develop Aug 21, 2018
@lmolkova
Liudmila Molkova (lmolkova) deleted the lmolkova/supportW3COnCore branch January 3, 2019 03:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants