From 9a3c69ac67c0710da78dbd89d6141483507d5fe2 Mon Sep 17 00:00:00 2001 From: Cijo Thomas Date: Fri, 24 Jul 2020 02:42:24 -0700 Subject: [PATCH] More cleanups - basic renaming, public vs internal (#908) --- .../Implementation/HttpTagHelper.cs | 8 ++++---- .../Instrumentation/InstrumentationEventSource.cs | 2 +- src/OpenTelemetry/Trace/ActivityExtensions.cs | 6 +++--- .../TestActivityProcessor.cs | 8 ++++---- .../TestActivityProcessor.cs | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpTagHelper.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpTagHelper.cs index fe4ac97c263..6c004c5f883 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpTagHelper.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpTagHelper.cs @@ -21,9 +21,9 @@ namespace OpenTelemetry.Instrumentation.Http.Implementation { /// - /// A collection of helper methods to be used when building Http spans. + /// A collection of helper methods to be used when building Http activities. /// - public static class HttpTagHelper + internal static class HttpTagHelper { private static readonly ConcurrentDictionary MethodOperationNameCache = new ConcurrentDictionary(); private static readonly ConcurrentDictionary HttpMethodOperationNameCache = new ConcurrentDictionary(); @@ -39,10 +39,10 @@ public static class HttpTagHelper private static readonly Func ConvertHttpStatusCodeToStringRef = ConvertHttpStatusCodeToString; /// - /// Gets the OpenTelemetry standard operation name for a span based on its Http method. + /// Gets the OpenTelemetry standard name for an activity based on its Http method. /// /// Http method. - /// Span operation name. + /// Activity name. public static string GetOperationNameForHttpMethod(string method) => MethodOperationNameCache.GetOrAdd(method, ConvertMethodToOperationNameRef); /// diff --git a/src/OpenTelemetry/Instrumentation/InstrumentationEventSource.cs b/src/OpenTelemetry/Instrumentation/InstrumentationEventSource.cs index 5826646fad5..5166d67b8e7 100644 --- a/src/OpenTelemetry/Instrumentation/InstrumentationEventSource.cs +++ b/src/OpenTelemetry/Instrumentation/InstrumentationEventSource.cs @@ -29,7 +29,7 @@ internal class InstrumentationEventSource : EventSource { public static InstrumentationEventSource Log = new InstrumentationEventSource(); - [Event(1, Message = "Current Activity is NULL the '{0}' callback. Span will not be recorded.", Level = EventLevel.Warning)] + [Event(1, Message = "Current Activity is NULL the '{0}' callback. Activity will not be recorded.", Level = EventLevel.Warning)] public void NullActivity(string eventName) { this.WriteEvent(1, eventName); diff --git a/src/OpenTelemetry/Trace/ActivityExtensions.cs b/src/OpenTelemetry/Trace/ActivityExtensions.cs index c5cc020da96..294f809eecf 100644 --- a/src/OpenTelemetry/Trace/ActivityExtensions.cs +++ b/src/OpenTelemetry/Trace/ActivityExtensions.cs @@ -23,10 +23,10 @@ namespace OpenTelemetry.Trace /// public static class ActivityExtensions { - public const string ResourcePropertyName = "ot.resource"; + internal const string ResourcePropertyName = "ot.resource"; /// - /// Checks whether activity needs to be created and tracked. + /// Gets the Resource associated with the Activity. /// /// Activity instance. /// The resource. @@ -43,7 +43,7 @@ public static Resource GetResource(this Activity activity) } /// - /// Checks whether activity needs to be created and tracked. + /// Sets the Resource associated with the Activity.. /// /// Activity instance. /// Resource to set to. diff --git a/test/OpenTelemetry.Exporter.Jaeger.Tests/TestActivityProcessor.cs b/test/OpenTelemetry.Exporter.Jaeger.Tests/TestActivityProcessor.cs index 90faa39bbce..0ce530c0777 100644 --- a/test/OpenTelemetry.Exporter.Jaeger.Tests/TestActivityProcessor.cs +++ b/test/OpenTelemetry.Exporter.Jaeger.Tests/TestActivityProcessor.cs @@ -43,14 +43,14 @@ public TestActivityProcessor(Action onStart, Action onEnd) public bool DisposedCalled { get; private set; } = false; - public override void OnStart(Activity span) + public override void OnStart(Activity activity) { - this.StartAction?.Invoke(span); + this.StartAction?.Invoke(activity); } - public override void OnEnd(Activity span) + public override void OnEnd(Activity activity) { - this.EndAction?.Invoke(span); + this.EndAction?.Invoke(activity); } public override Task ShutdownAsync(CancellationToken cancellationToken) diff --git a/test/OpenTelemetry.Exporter.ZPages.Tests/TestActivityProcessor.cs b/test/OpenTelemetry.Exporter.ZPages.Tests/TestActivityProcessor.cs index caa842d2366..5d7c4ab1843 100644 --- a/test/OpenTelemetry.Exporter.ZPages.Tests/TestActivityProcessor.cs +++ b/test/OpenTelemetry.Exporter.ZPages.Tests/TestActivityProcessor.cs @@ -44,14 +44,14 @@ public TestActivityProcessor(Action onStart, Action onEnd) public bool DisposedCalled { get; private set; } = false; - public override void OnStart(Activity span) + public override void OnStart(Activity activity) { - this.StartAction?.Invoke(span); + this.StartAction?.Invoke(activity); } - public override void OnEnd(Activity span) + public override void OnEnd(Activity activity) { - this.EndAction?.Invoke(span); + this.EndAction?.Invoke(activity); } public override Task ShutdownAsync(CancellationToken cancellationToken)