Expand http.route tag when DD_TRACE_EXPAND_ROUTE_TEMPLATES_ENABLED is true#8479
Expand http.route tag when DD_TRACE_EXPAND_ROUTE_TEMPLATES_ENABLED is true#8479
Conversation
andrewlock
left a comment
There was a problem hiding this comment.
Just requesting changes here because I think this needs a bigger discussion, and it seems like a breaking change 😄
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9d8d6166b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| [InlineData("{tenantId}/{controller}/{id}", "/home/index/{id}", false, "{tenantId}/{controller}/{id}")] | ||
| [InlineData("{tenantId}/{controller}/{id}", "/home/index/{id}", true, "/{tenantid}/home/{id}")] |
There was a problem hiding this comment.
Fix tenantId route expectations in theory data
These two InlineData rows expect "/home/index/{id}" for the {tenantId}/{controller}/{id} template, but AspNetResourceNameHelper.CalculateResourceName cannot produce that shape: it only substitutes parameters present in the template, so there is no /index segment, and tenantId="abc123" remains {tenantid} (identifier-like) even when expansion is enabled. As written, this theory will fail on NETFRAMEWORK test runs and won’t validate the intended regression path.
Useful? React with 👍 / 👎.
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8479) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8479) - mean (73ms) : 71, 76
master - mean (72ms) : 70, 74
section Bailout
This PR (8479) - mean (79ms) : 75, 84
master - mean (77ms) : 74, 80
section CallTarget+Inlining+NGEN
This PR (8479) - mean (1,078ms) : 1021, 1134
master - mean (1,076ms) : 1025, 1126
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8479) - mean (115ms) : 109, 121
master - mean (112ms) : 108, 116
section Bailout
This PR (8479) - mean (117ms) : 112, 122
master - mean (118ms) : 112, 125
section CallTarget+Inlining+NGEN
This PR (8479) - mean (794ms) : 772, 816
master - mean (793ms) : 770, 816
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8479) - mean (102ms) : 96, 107
master - mean (102ms) : 96, 108
section Bailout
This PR (8479) - mean (104ms) : 99, 109
master - mean (101ms) : 99, 103
section CallTarget+Inlining+NGEN
This PR (8479) - mean (942ms) : 908, 976
master - mean (942ms) : 911, 972
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8479) - mean (100ms) : 96, 103
master - mean (101ms) : 96, 106
section Bailout
This PR (8479) - mean (103ms) : 97, 109
master - mean (104ms) : 99, 109
section CallTarget+Inlining+NGEN
This PR (8479) - mean (830ms) : 793, 866
master - mean (823ms) : 784, 861
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8479) - mean (209ms) : 205, 213
master - mean (209ms) : 204, 214
section Bailout
This PR (8479) - mean (214ms) : 210, 218
master - mean (215ms) : 211, 218
section CallTarget+Inlining+NGEN
This PR (8479) - mean (1,227ms) : 1179, 1276
master - mean (1,222ms) : 1173, 1271
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8479) - mean (302ms) : 295, 309
master - mean (304ms) : 298, 311
section Bailout
This PR (8479) - mean (303ms) : 297, 310
master - mean (303ms) : 296, 310
section CallTarget+Inlining+NGEN
This PR (8479) - mean (1,005ms) : 975, 1036
master - mean (996ms) : 961, 1031
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8479) - mean (295ms) : 288, 301
master - mean (297ms) : 289, 304
section Bailout
This PR (8479) - mean (297ms) : 292, 302
master - mean (296ms) : 290, 302
section CallTarget+Inlining+NGEN
This PR (8479) - mean (1,180ms) : 1142, 1217
master - mean (1,175ms) : 1146, 1203
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8479) - mean (297ms) : 289, 306
master - mean (294ms) : 288, 301
section Bailout
This PR (8479) - mean (296ms) : 291, 301
master - mean (295ms) : 288, 301
section CallTarget+Inlining+NGEN
This PR (8479) - mean (1,074ms) : 1002, 1146
master - mean (1,063ms) : 1003, 1122
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Summary
NOTE: This is coming from Tahir's PR which is from a fork: #8320
Making this not from a fork to help reduce turn around time on this
DD_TRACE_EXPAND_ROUTE_TEMPLATES_ENABLED=true, thehttp.routespan tag now reflects the expanded route template, consistent withresource_nameresource_namewas expanded (e.g.,GET /api/users/{id}) buthttp.routeretained the raw template (e.g.,api/{controller}/{id}), causing the Datadog endpoints page to show duplicate entriesChanges
AspNetMvcIntegration.cs: Extract expanded route from computed resource name and use it forHttpRoutetagAspNetWebApi2Integration.cs: Same pattern as MVC integrationAspNetCoreDiagnosticObserver.cs: UseresourcePathName(already expanded bySimplifyRoutePattern) forAspNetCoreRoute/trackingFeature.Routeinstead of raw template textAspNetResourceNameHelperTests.cs: Added tests verifying expanded route extraction is consistent with resource name, and that different controllers produce distinct http.route valuesTest plan
{controller}template produce distincthttp.routevalues when expand is enabledCalculateResourceNametests still pass (no behavioral change whenexpandRouteTemplates=false){controller}routesFixes #8319
🤖 Generated with Claude Code