[Debugger] Improve line probe source path resolution#8422
[Debugger] Improve line probe source path resolution#8422dudikeleti wants to merge 1 commit intomasterfrom
Conversation
…iagnostics implied the assembly was missing. Clarify source-path mismatch reporting, add conservative suffix fallback matching, and avoid building full resolver diagnostics outside debug so these cases are easier to diagnose without adding unnecessary allocation cost.
There was a problem hiding this comment.
Pull request overview
This PR significantly improves line probe source path resolution by implementing a conservative fallback matching strategy, splitting ambiguous diagnostics reasons into clearer cases, and introducing diagnostic level controls to reduce allocation overhead. The changes allow probes to be resolved even when source paths differ by leading path segments, while maintaining correctness through strict matching criteria and comprehensive diagnostics.
Changes:
- Split
AssemblyNotLoadedOrSourceFileMismatchreason intoLoadedAssemblySourceFileMismatchandAssemblyNotLoadedOrSymbolsUnavailablefor clearer diagnostics - Added conservative trailing-segment fallback matching that binds probes only when the file match is unique and meets minimum segment threshold (4 segments)
- Introduced
LineProbeDiagnosticLevelenum to control diagnostic detail (Minimal vs Full), reducing allocation when debug logging is disabled - Enhanced diagnostics with
PathMatchType,MatchingTrailingSegments,FallbackFailureReason, andQualifiedFallbackMatchCountfields - Implemented span-based path handling and caching of reversed paths in
ProbePathQuerystruct for performance - Added comprehensive test coverage for fallback matching scenarios, ambiguity handling, case sensitivity, UNC paths, and trailing separator handling
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tracer/src/Datadog.Trace/Debugger/Models/LiveProbeResolveStatus.cs | Added new enums for reasons, path match types, fallback failure reasons, and diagnostic levels |
| tracer/src/Datadog.Trace/Debugger/Models/LineProbeResolutionDiagnostics.cs | Added new diagnostic fields for path matching details and updated summary formatting |
| tracer/src/Datadog.Trace/Debugger/ILineProbeResolver.cs | Updated interface to include diagnostic level parameter with full default |
| tracer/src/Datadog.Trace/Debugger/LineProbeResolver.cs | Major refactor implementing fallback matching, span-based path handling, and diagnostic level support |
| tracer/src/Datadog.Trace/Debugger/DynamicInstrumentation.cs | Updated to determine diagnostic level from log level and pass to resolver; enhanced logging with new diagnostic fields |
| tracer/test/Datadog.Trace.Tests/Debugger/DynamicInstrumentationTests.cs | Updated mock interface implementation to match new signature with diagnostic level parameter |
| tracer/test/Datadog.Trace.Debugger.IntegrationTests/LineProbeResolverTest.cs | Added comprehensive tests for fallback matching, trailing separators, case sensitivity, ambiguity, and diagnostic levels |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
BenchmarksBenchmark execution time: 2026-04-07 21:55:44 Comparing candidate commit b21dde9 in PR branch Found 6 performance improvements and 7 performance regressions! Performance is the same for 256 metrics, 19 unstable metrics.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8422) 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 (8422) - mean (76ms) : 73, 78
master - mean (76ms) : 74, 78
section Bailout
This PR (8422) - mean (80ms) : 78, 82
master - mean (81ms) : 79, 84
section CallTarget+Inlining+NGEN
This PR (8422) - mean (1,099ms) : 1061, 1137
master - mean (1,112ms) : 1071, 1153
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 (8422) - mean (118ms) : 114, 122
master - mean (121ms) : 116, 125
section Bailout
This PR (8422) - mean (119ms) : 116, 122
master - mean (121ms) : 118, 124
section CallTarget+Inlining+NGEN
This PR (8422) - mean (805ms) : 784, 826
master - mean (815ms) : 791, 839
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8422) - mean (104ms) : 101, 107
master - mean (107ms) : 103, 110
section Bailout
This PR (8422) - mean (105ms) : 102, 108
master - mean (108ms) : 104, 112
section CallTarget+Inlining+NGEN
This PR (8422) - mean (945ms) : 906, 985
master - mean (960ms) : 914, 1007
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8422) - mean (102ms) : 99, 106
master - mean (105ms) : 101, 109
section Bailout
This PR (8422) - mean (104ms) : 100, 108
master - mean (107ms) : 104, 110
section CallTarget+Inlining+NGEN
This PR (8422) - mean (834ms) : 795, 873
master - mean (844ms) : 809, 880
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 (8422) - mean (209ms) : 204, 215
master - mean (215ms) : 210, 221
section Bailout
This PR (8422) - mean (215ms) : 208, 222
master - mean (220ms) : 216, 225
section CallTarget+Inlining+NGEN
This PR (8422) - mean (1,217ms) : 1158, 1276
master - mean (1,245ms) : 1196, 1294
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 (8422) - mean (301ms) : 292, 309
master - mean (311ms) : 304, 317
section Bailout
This PR (8422) - mean (302ms) : 295, 309
master - mean (311ms) : 305, 318
section CallTarget+Inlining+NGEN
This PR (8422) - mean (993ms) : 966, 1020
master - mean (1,019ms) : 987, 1052
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8422) - mean (297ms) : 290, 304
master - mean (303ms) : 296, 311
section Bailout
This PR (8422) - mean (295ms) : 290, 301
master - mean (306ms) : 299, 313
section CallTarget+Inlining+NGEN
This PR (8422) - mean (1,183ms) : 1153, 1214
master - mean (1,194ms) : 1158, 1231
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8422) - mean (292ms) : 285, 299
master - mean (303ms) : 295, 310
section Bailout
This PR (8422) - mean (293ms) : 287, 299
master - mean (302ms) : 295, 310
section CallTarget+Inlining+NGEN
This PR (8422) - mean (1,074ms) : 984, 1164
master - mean (1,141ms) : 1025, 1257
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Summary of changes
Reason for change
Implementation details
DynamicInstrumentationrequest only minimal diagnostics when debug logging is off, while preserving full diagnostics for debug and direct resolver callers.Test coverage
dotnet test "tracer/test/Datadog.Trace.Debugger.IntegrationTests/Datadog.Trace.Debugger.IntegrationTests.csproj" --filter "FullyQualifiedName~LineProbeResolverTest"dotnet test "tracer/test/Datadog.Trace.Tests/Datadog.Trace.Tests.csproj" --filter "FullyQualifiedName~DynamicInstrumentationTests"Other details