Skip to content

feat: resource renaming#3851

Merged
dd-mergequeue[bot] merged 14 commits into
mainfrom
flavien/resource-renaming
Oct 22, 2025
Merged

feat: resource renaming#3851
dd-mergequeue[bot] merged 14 commits into
mainfrom
flavien/resource-renaming

Conversation

@e-n-0

@e-n-0 e-n-0 commented Aug 5, 2025

Copy link
Copy Markdown
Member

What does this PR do?

This PR implements:

This PR:

  • Upgrades the module github.com/DataDog/datadog-agent/pkg/trace to v0.71.0
  • Implements the new http.endpoint tag
  • Implements two new environment variables:
    • DD_TRACE_RESOURCE_RENAMING_ENABLED
    • DD_TRACE_RESOURCE_RENAMING_ALWAYS_SIMPLIFIED_ENDPOINT
  • Always use the new simplification algorithm using the url for the API Security sampler key if no route nor http.endpoint are set.

Tests

Unit tests

Unit tests have been implemented for:

  • stats aggregation
  • route simplification algorithm
  • http.endpoint data based on the http.route presence
  • computed API Security sampler key based on the http.route and http.endpoint presence
System tests

This PR have been tested against the system tests for resource renaming:

Additional information

A PR has been drafted in the dd-source repository that upgrade of the datadog-agent dependency to facilitate the next release that includes these changes.
https://github.com/DataDog/dd-source/pull/291666

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.
  • New code is free of linting errors. You can check this by running ./scripts/lint.sh locally.
  • 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.

Unsure? Have a question? Request a review!

@pr-commenter

pr-commenter Bot commented Aug 7, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-10-21 12:52:20

Comparing candidate commit f2c1502 in PR branch flavien/resource-renaming with baseline commit e1b2c3b in branch main.

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

scenario:BenchmarkInjectW3C-24

  • 🟥 execution_time [+110.844ns; +141.756ns] or [+2.823%; +3.610%]

@e-n-0
e-n-0 force-pushed the flavien/resource-renaming branch from 455fe3e to a5c1dd2 Compare August 7, 2025 16:05
@e-n-0
e-n-0 force-pushed the flavien/resource-renaming branch from 6357975 to 1865294 Compare August 25, 2025 12:28
@e-n-0
e-n-0 force-pushed the flavien/resource-renaming branch from 1865294 to 3e577f7 Compare October 3, 2025 16:19
@datadog-official

datadog-official Bot commented Oct 3, 2025

Copy link
Copy Markdown
Contributor

⚠️ Tests

⚠️ Warnings

❄️ 2 New flaky tests detected

TestReportAbandonedSpans from github.com/DataDog/dd-trace-go/v2/ddtrace/tracer (Datadog)
Failed

=== RUN   TestReportAbandonedSpans
--- FAIL: TestReportAbandonedSpans (1.19s)
TestReportAbandonedSpans/wait from github.com/DataDog/dd-trace-go/v2/ddtrace/tracer (Datadog)
Failed

=== RUN   TestReportAbandonedSpans/wait
    abandonedspans_test.go:307: 
        	Error Trace:	D:/a/dd-trace-go/dd-trace-go/ddtrace/tracer/abandonedspans_test.go:307
        	Test:       	TestReportAbandonedSpans/wait
    --- FAIL: TestReportAbandonedSpans/wait (0.11s)

ℹ️ Info

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f2c1502 | Docs | Was this helpful? Give us feedback!

@e-n-0
e-n-0 force-pushed the flavien/resource-renaming branch 3 times, most recently from 1a693b2 to 3b02665 Compare October 13, 2025 15:47
@github-actions github-actions Bot added the apm:ecosystem contrib/* related feature requests or bugs label Oct 15, 2025
@e-n-0
e-n-0 force-pushed the flavien/resource-renaming branch 11 times, most recently from b8cd349 to 9203a91 Compare October 20, 2025 08:32
@e-n-0
e-n-0 marked this pull request as ready for review October 20, 2025 11:10
@e-n-0
e-n-0 requested review from a team as code owners October 20, 2025 11:10
@e-n-0
e-n-0 marked this pull request as draft October 20, 2025 11:34
@e-n-0
e-n-0 marked this pull request as ready for review October 20, 2025 12:52

@genesor genesor left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, I have some questions

Comment thread instrumentation/httptrace/before_handle.go Outdated
}

sc.Tags[ext.HTTPEndpoint] = endpoint
serveCfg.Endpoint = endpoint

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It feel a bit weird to update the ServeConfig in a StartSpanOption.

It seems that the only place where Endpoint is used is is in renamedRoute, couldn't we read the tag from the span there instead of the config?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I did that because we don't have access to the span tag (outside of the tracer.StartSpanConfig), or i'm missing something?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I changed the behavior in f2c1502, it doesn't use ServeConfig anymore to get/set the Endpoint. Let me know if you prefer this solution

Comment thread instrumentation/httptrace/route_simplification.go
@e-n-0
e-n-0 force-pushed the flavien/resource-renaming branch from c034620 to cc5f3ce Compare October 20, 2025 16:18
@e-n-0
e-n-0 force-pushed the flavien/resource-renaming branch from 1fba641 to f2c1502 Compare October 21, 2025 12:45
@e-n-0

e-n-0 commented Oct 22, 2025

Copy link
Copy Markdown
Member Author

/merge

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Oct 22, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-10-22 13:39:48 UTC ℹ️ Start processing command /merge


2025-10-22 13:39:53 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 18m (p90).


2025-10-22 13:57:04 UTCMergeQueue: The checks failed on this merge request

Tests failed on this commit 281945b:

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.

@e-n-0

e-n-0 commented Oct 22, 2025

Copy link
Copy Markdown
Member Author

/merge

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Oct 22, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-10-22 13:59:14 UTC ℹ️ Start processing command /merge


2025-10-22 13:59:22 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 18m (p90).


2025-10-22 14:18:55 UTCMergeQueue: The checks failed on this merge request

Tests failed on this commit 4b84e91:

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.

@e-n-0

e-n-0 commented Oct 22, 2025

Copy link
Copy Markdown
Member Author

/merge

@dd-devflow-routing-codex

dd-devflow-routing-codex Bot commented Oct 22, 2025

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2025-10-22 14:25:37 UTC ℹ️ Start processing command /merge


2025-10-22 14:25:43 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 18m (p90).


2025-10-22 14:38:59 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue
dd-mergequeue Bot merged commit 9668c9a into main Oct 22, 2025
301 of 307 checks passed
@dd-mergequeue
dd-mergequeue Bot deleted the flavien/resource-renaming branch October 22, 2025 14:38
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 mergequeue-status: done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants