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

contrib/envoyproxy: fix resource name #3047

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

e-n-0
Copy link
Member

@e-n-0 e-n-0 commented Dec 18, 2024

What does this PR do?

Fix the ressource.name from the span: change from operation_name to method + path.

Motivation

More clear resources name in the UI.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.
  • For internal contributors, a matching PR should be created to the v2-dev branch and reviewed by @DataDog/apm-go.

Unsure? Have a question? Request a review!

@e-n-0 e-n-0 requested review from a team as code owners December 18, 2024 10:35
@github-actions github-actions bot added the apm:ecosystem contrib/* related feature requests or bugs label Dec 18, 2024
@e-n-0 e-n-0 force-pushed the flavien/envoy/resourcename branch from 2a5755a to 931d9a0 Compare December 18, 2024 10:36
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Dec 18, 2024

Datadog Report

Branch report: flavien/envoy/resourcename
Commit report: a774c0c
Test service: dd-trace-go

✅ 0 Failed, 5112 Passed, 70 Skipped, 2m 39.33s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Dec 18, 2024

Benchmarks

Benchmark execution time: 2024-12-19 17:35:07

Comparing candidate commit d446c41 in PR branch flavien/envoy/resourcename with baseline commit 144d592 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 59 metrics, 0 unstable metrics.

@@ -204,6 +205,7 @@ func processRequestHeaders(ctx context.Context, req *envoyextproc.ProcessingRequ
var blocked bool
fakeResponseWriter := newFakeResponseWriter()
wrappedResponseWriter, request, afterHandle, blocked := httptrace.BeforeHandle(&httptrace.ServeConfig{
Resource: request.Method + " " + path.Clean(request.URL.Path),
Copy link
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately, we don't have the http.route information at the proxy level. Only the raw path is available.

@e-n-0 e-n-0 requested a review from rarguelloF December 18, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants