contrib/envoyproxy: fix resource name#3047
Conversation
2a5755a to
931d9a0
Compare
Datadog ReportBranch report: ✅ 0 Failed, 5112 Passed, 70 Skipped, 2m 39.33s Total Time |
BenchmarksBenchmark execution time: 2024-12-19 17:35:07 Comparing candidate commit d446c41 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 59 metrics, 0 unstable metrics. |
| var blocked bool | ||
| fakeResponseWriter := newFakeResponseWriter() | ||
| wrappedResponseWriter, request, afterHandle, blocked := httptrace.BeforeHandle(&httptrace.ServeConfig{ | ||
| Resource: request.Method + " " + path.Clean(request.URL.Path), |
There was a problem hiding this comment.
why do we path.Clean here? shouldn't we just put the original data that was in the request?
also something we are trying to do in other http server integrations is to use the low cardinality http.route (see details here) for the resource name. Would it be possible to have this here?
There was a problem hiding this comment.
I did a path.Clean here like it's done in the mux.Handler() to get the route. And in the handler, it's calling cleanPath() which is doing a path.Clean
There was a problem hiding this comment.
Unfortunately, we don't have the http.route information at the proxy level. Only the raw path is available.
What does this PR do?
Fix the ressource.name from the span: change from
operation_nametomethod + path.Motivation
More clear resources name in the UI.
Reviewer's Checklist
v2-devbranch and reviewed by @DataDog/apm-go.Unsure? Have a question? Request a review!