This repository was archived by the owner on Jul 5, 2020. It is now read-only.
Use W3C trace Id format for Activities that do not have parents#952
Merged
Use W3C trace Id format for Activities that do not have parents#952
Conversation
cijothomas
approved these changes
Jul 18, 2018
Contributor
cijothomas
left a comment
There was a problem hiding this comment.
couple comments left.
| internal static class ClientServerDependencyTracker | ||
| { | ||
| private const string DependencyActivityName = "Microsoft.AppInsights.Web.Dependency"; | ||
| private const string AuxiliaryActivityName = nameof(ClientServerDependencyTracker); |
Contributor
There was a problem hiding this comment.
AuxiliaryActivityName - Where is this used?
| if (currentActivity == null) | ||
| { | ||
| activity.SetParentId(telemetry.Id); | ||
| activity.SetParentId(StringUtilities.GenerateTraceId()); |
Contributor
There was a problem hiding this comment.
do you need to stop this in EndTracking?
|
|
||
| internal static class ActivityExtensions | ||
| { | ||
| public static Activity UpdateParent(this Activity original, string newParentId) |
Author
|
@MS-TimothyMothra could you please have a look? |
TimothyMothra
approved these changes
Jul 18, 2018
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
We are going to gradually enable W3C support in ApplicaitonInsights.
While the details and backward compatibility conditions are still not clear, we want to make sure that customers have enough time to transition to W3C format and this change is the first step in this transition.
This change generates Activity RootId in the format of W3C traceId when there are no parents.
I.e. if the service has received Request-Id (or legacy) header from upstream, it will use it, no matter which format it follows.
However, if there were no such header in the incoming request, the new operation id will comply with W3C spec for traceId.
This is a temporary workaround that could be removed once W3C supported in .NET (Activity).
Sampling tests shows that distribution of sampling score for the new traceId generation algorithm is uniform.