Skip to content

Commit

Permalink
Code review.
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch committed Aug 5, 2024
1 parent fa6d187 commit 417835b
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,17 @@ public static bool HasStarted(HttpContext context, out Activity? aspNetActivity)
{
PropagationContext propagationContext = textMapPropagator.Extract(default, context.Request, HttpRequestHeaderValuesGetter);

KeyValuePair<string, object?>[]? tags = null;
KeyValuePair<string, object?>[]? tags;
if (context.Request?.Unvalidated?.Path is string path)
{
tags = cachedTagsStorage;
if (tags is null)
{
tags = new KeyValuePair<string, object?>[1];
cachedTagsStorage = tags;
}
tags = cachedTagsStorage ??= new KeyValuePair<string, object?>[1];

tags[0] = new KeyValuePair<string, object?>("url.path", path);
}
else
{
tags = null;
}

Activity? activity = AspNetSource.StartActivity(TelemetryHttpModule.AspNetActivityName, ActivityKind.Server, propagationContext.ActivityContext, tags);

Expand Down

0 comments on commit 417835b

Please sign in to comment.