Skip to content

Commit

Permalink
More cleanups - basic renaming, public vs internal (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas authored Jul 24, 2020
1 parent 1b15224 commit 9a3c69a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
namespace OpenTelemetry.Instrumentation.Http.Implementation
{
/// <summary>
/// A collection of helper methods to be used when building Http spans.
/// A collection of helper methods to be used when building Http activities.
/// </summary>
public static class HttpTagHelper
internal static class HttpTagHelper
{
private static readonly ConcurrentDictionary<string, string> MethodOperationNameCache = new ConcurrentDictionary<string, string>();
private static readonly ConcurrentDictionary<HttpMethod, string> HttpMethodOperationNameCache = new ConcurrentDictionary<HttpMethod, string>();
Expand All @@ -39,10 +39,10 @@ public static class HttpTagHelper
private static readonly Func<HttpStatusCode, string> ConvertHttpStatusCodeToStringRef = ConvertHttpStatusCodeToString;

/// <summary>
/// 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.
/// </summary>
/// <param name="method">Http method.</param>
/// <returns>Span operation name.</returns>
/// <returns>Activity name.</returns>
public static string GetOperationNameForHttpMethod(string method) => MethodOperationNameCache.GetOrAdd(method, ConvertMethodToOperationNameRef);

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/OpenTelemetry/Trace/ActivityExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ namespace OpenTelemetry.Trace
/// </summary>
public static class ActivityExtensions
{
public const string ResourcePropertyName = "ot.resource";
internal const string ResourcePropertyName = "ot.resource";

/// <summary>
/// Checks whether activity needs to be created and tracked.
/// Gets the Resource associated with the Activity.
/// </summary>
/// <param name="activity">Activity instance.</param>
/// <returns>The resource.</returns>
Expand All @@ -43,7 +43,7 @@ public static Resource GetResource(this Activity activity)
}

/// <summary>
/// Checks whether activity needs to be created and tracked.
/// Sets the Resource associated with the Activity..
/// </summary>
/// <param name="activity">Activity instance.</param>
/// <param name="resource">Resource to set to.</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ public TestActivityProcessor(Action<Activity> onStart, Action<Activity> 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ public TestActivityProcessor(Action<Activity> onStart, Action<Activity> 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)
Expand Down

0 comments on commit 9a3c69a

Please sign in to comment.