Skip to content

Commit

Permalink
align endpoint to java version
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-xiaoshuang authored and luxiaoshuang committed Mar 11, 2024
1 parent 3fa62f4 commit bd90243
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public bool OnlyMatch(HttpContext request)

public void BeginRequest(ITracingContext tracingContext, HttpContext httpContext)
{
var context = tracingContext.CreateEntrySegmentContext(httpContext.Request.Path,
var context = tracingContext.CreateEntrySegmentContext(
httpContext.Request.Method.ToUpper() + ":" + httpContext.Request.Path,
new HttpRequestCarrierHeaderCollection(httpContext.Request));
context.Span.SpanLayer = SpanLayer.HTTP;
context.Span.Component = Common.Components.ASPNETCORE;
Expand Down Expand Up @@ -167,4 +168,4 @@ private string CollectBody(HttpContext httpContext, int lengthThreshold)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public bool OnlyMatch(HttpRequestMessage request)

public void Handle(ITracingContext tracingContext, HttpRequestMessage request)
{
var operationName = request.RequestUri.GetLeftPart(UriPartial.Path);
var operationName = request.RequestUri.GetComponents(UriComponents.Path | UriComponents.KeepDelimiter, UriFormat.UriEscaped);

var ignored = _httpClientDiagnosticConfig.IgnorePaths != null
&& _httpClientDiagnosticConfig.IgnorePaths
Expand Down Expand Up @@ -115,4 +115,4 @@ private string CollectHeaders(HttpRequestMessage request, IEnumerable<string> ke
return sb.ToString();
}
}
}
}

0 comments on commit bd90243

Please sign in to comment.