Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

align endpoint to java version #580

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming there is an URI https://en.wikipedia.org/wiki/github, old code returns https://en.wikipedia.org/wiki/github while new code returns /wiki/github.


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();
}
}
}
}
Loading