diff --git a/Src/Common/W3C/W3CActivityExtensions.cs b/Src/Common/W3C/W3CActivityExtensions.cs index 580b211c2..76ba3c46a 100644 --- a/Src/Common/W3C/W3CActivityExtensions.cs +++ b/Src/Common/W3C/W3CActivityExtensions.cs @@ -155,7 +155,7 @@ public static void SetTraceparent(this Activity activity, string value) [Obsolete("Not ready for public consumption.")] [EditorBrowsable(EditorBrowsableState.Never)] public static string GetTracestate(this Activity activity) => - activity.Tags.FirstOrDefault(t => t.Key == W3CConstants.TraceStateTag).Value; + activity.Tags.FirstOrDefault(t => t.Key == W3CConstants.TracestateTag).Value; /// /// Sets tracestate header value on the Activity. @@ -165,7 +165,7 @@ public static string GetTracestate(this Activity activity) => [Obsolete("Not ready for public consumption.")] [EditorBrowsable(EditorBrowsableState.Never)] public static void SetTraceState(this Activity activity, string value) => - activity.AddTag(W3CConstants.TraceStateTag, value); + activity.AddTag(W3CConstants.TracestateTag, value); /// /// Gets TraceId from the Activity. @@ -241,7 +241,7 @@ private static Activity UpdateContextFromParent(this Activity activity) case W3CConstants.SampledTag: activity.SetSampled(tag.Value); break; - case W3CConstants.TraceStateTag: + case W3CConstants.TracestateTag: activity.SetTraceState(tag.Value); break; } diff --git a/Src/Common/W3C/W3CConstants.cs b/Src/Common/W3C/W3CConstants.cs index 0b7ee8059..66583e5c6 100644 --- a/Src/Common/W3C/W3CConstants.cs +++ b/Src/Common/W3C/W3CConstants.cs @@ -56,9 +56,9 @@ static class W3CConstants internal const string SampledTag = "w3c_sampled"; /// - /// TraceState tag name. + /// Tracestate tag name. /// - internal const string TraceStateTag = "w3c_traceState"; + internal const string TracestateTag = "w3c_tracestate"; /// /// Default version value. diff --git a/Src/Common/W3C/W3COperationCorrelationTelemetryInitializer.cs b/Src/Common/W3C/W3COperationCorrelationTelemetryInitializer.cs index 3293eafbb..615fa48db 100644 --- a/Src/Common/W3C/W3COperationCorrelationTelemetryInitializer.cs +++ b/Src/Common/W3C/W3COperationCorrelationTelemetryInitializer.cs @@ -84,10 +84,10 @@ internal static void UpdateTelemetry(ITelemetry telemetry, Activity activity, bo case W3CConstants.ParentSpanIdTag: parentSpanId = tag.Value; break; - case W3CConstants.TraceStateTag: + case W3CConstants.TracestateTag: if (telemetry is OperationTelemetry operation) { - operation.Properties[W3CConstants.TraceStateTag] = tag.Value; + operation.Properties[W3CConstants.TracestateTag] = tag.Value; } break; @@ -121,4 +121,4 @@ internal static void UpdateTelemetry(ITelemetry telemetry, Activity activity, bo } } } -} \ No newline at end of file +} diff --git a/Src/DependencyCollector/Net45.Tests/DependencyTrackingTelemetryModuleHttpTest.cs b/Src/DependencyCollector/Net45.Tests/DependencyTrackingTelemetryModuleHttpTest.cs index 0408e42f2..a79aa8b85 100644 --- a/Src/DependencyCollector/Net45.Tests/DependencyTrackingTelemetryModuleHttpTest.cs +++ b/Src/DependencyCollector/Net45.Tests/DependencyTrackingTelemetryModuleHttpTest.cs @@ -362,7 +362,7 @@ public void TestDependencyCollectionWithW3CHeadersDiagnosticSource() Assert.AreEqual("k=v", request.Headers[RequestResponseHeaders.CorrelationContextHeader]); Assert.AreEqual("v", dependency.Properties["k"]); - Assert.AreEqual("state=some", dependency.Properties[W3CConstants.TraceStateTag]); + Assert.AreEqual("state=some", dependency.Properties[W3CConstants.TracestateTag]); Assert.IsTrue(dependency.Properties.ContainsKey(W3CConstants.LegacyRequestIdProperty)); Assert.IsTrue(dependency.Properties[W3CConstants.LegacyRequestIdProperty].StartsWith("|guid.")); diff --git a/Src/DependencyCollector/NetCore.Tests/DependencyTrackingTelemetryModuleTestNetCore.cs b/Src/DependencyCollector/NetCore.Tests/DependencyTrackingTelemetryModuleTestNetCore.cs index 27a6221bc..e93a5bc8c 100644 --- a/Src/DependencyCollector/NetCore.Tests/DependencyTrackingTelemetryModuleTestNetCore.cs +++ b/Src/DependencyCollector/NetCore.Tests/DependencyTrackingTelemetryModuleTestNetCore.cs @@ -261,7 +261,7 @@ public async Task TestDependencyCollectionWithW3CHeadersAndRequestId() Assert.AreEqual("k=v", request.Headers.GetValues(RequestResponseHeaders.CorrelationContextHeader).Single()); Assert.AreEqual("v", dependency.Properties["k"]); - Assert.AreEqual("state=some", dependency.Properties[W3CConstants.TraceStateTag]); + Assert.AreEqual("state=some", dependency.Properties[W3CConstants.TracestateTag]); Assert.IsTrue(dependency.Properties.ContainsKey(W3CConstants.LegacyRequestIdProperty)); Assert.IsTrue(dependency.Properties[W3CConstants.LegacyRequestIdProperty].StartsWith("|guid.")); diff --git a/Src/DependencyCollector/Shared.Tests/Implementation/ProfilerHttpProcessingTest.cs b/Src/DependencyCollector/Shared.Tests/Implementation/ProfilerHttpProcessingTest.cs index be501a622..0a17f5835 100644 --- a/Src/DependencyCollector/Shared.Tests/Implementation/ProfilerHttpProcessingTest.cs +++ b/Src/DependencyCollector/Shared.Tests/Implementation/ProfilerHttpProcessingTest.cs @@ -308,7 +308,7 @@ public void RddTestHttpProcessingProfilerOnBeginAddsW3CHeadersWhenEnabled() using (var op = client.StartOperation("request")) { Activity.Current.AddBaggage("k", "v"); - Activity.Current.AddTag(W3CConstants.TraceStateTag, "some=state"); + Activity.Current.AddTag(W3CConstants.TracestateTag, "some=state"); httpProcessingW3C.OnBeginForGetResponse(request); Assert.AreEqual("k=v", request.Headers[RequestResponseHeaders.CorrelationContextHeader]); diff --git a/Src/DependencyCollector/Shared.Tests/W3C/W3COperationCorrelationTelemetryInitializerTests.cs b/Src/DependencyCollector/Shared.Tests/W3C/W3COperationCorrelationTelemetryInitializerTests.cs index fdeea6dec..1ee4936a4 100644 --- a/Src/DependencyCollector/Shared.Tests/W3C/W3COperationCorrelationTelemetryInitializerTests.cs +++ b/Src/DependencyCollector/Shared.Tests/W3C/W3COperationCorrelationTelemetryInitializerTests.cs @@ -178,8 +178,8 @@ public void InitializerPopulatesTraceStateOnRequestAndDependencyTelemetry() Assert.AreEqual(expectedTrace, request.Context.Operation.Id); Assert.AreEqual($"|{expectedTrace}.{expectedSpanId}.", request.Id); - Assert.AreEqual("key=value", request.Properties[W3CConstants.TraceStateTag]); - Assert.AreEqual("key=value", dependency.Properties[W3CConstants.TraceStateTag]); + Assert.AreEqual("key=value", request.Properties[W3CConstants.TracestateTag]); + Assert.AreEqual("key=value", dependency.Properties[W3CConstants.TracestateTag]); Assert.IsFalse(trace.Properties.Any()); } diff --git a/Src/Web/Web.Net45.Tests/RequestTrackingTelemetryModuleTest.Net45.cs b/Src/Web/Web.Net45.Tests/RequestTrackingTelemetryModuleTest.Net45.cs index a494074d0..c15613819 100644 --- a/Src/Web/Web.Net45.Tests/RequestTrackingTelemetryModuleTest.Net45.cs +++ b/Src/Web/Web.Net45.Tests/RequestTrackingTelemetryModuleTest.Net45.cs @@ -435,7 +435,7 @@ private void TestRequestTrackingWithW3CSupportEnabled(bool startActivity, bool a Assert.Equal("4bf92f3577b34da6a3ce929d0e0e4736", requestTelemetry.Context.Operation.Id); Assert.Equal("|4bf92f3577b34da6a3ce929d0e0e4736.00f067aa0ba902b7.", requestTelemetry.Context.Operation.ParentId); - Assert.Equal("state=some", requestTelemetry.Properties[W3CConstants.TraceStateTag]); + Assert.Equal("state=some", requestTelemetry.Properties[W3CConstants.TracestateTag]); } private void TestRequestTrackingWithW3CSupportEnabledAndNoW3CHeaders(bool startActivity, bool addRequestId)