Skip to content

[onboarding] make DD_DOTNET_TRACER_HOME optional in managed loader#7568

Merged
lucaspimentel merged 19 commits intomasterfrom
lpimentel/remove-tracer-home-dependency
Oct 23, 2025
Merged

[onboarding] make DD_DOTNET_TRACER_HOME optional in managed loader#7568
lucaspimentel merged 19 commits intomasterfrom
lpimentel/remove-tracer-home-dependency

Conversation

@lucaspimentel
Copy link
Member

@lucaspimentel lucaspimentel commented Sep 25, 2025

This PR is stacked on #7594. Merge that PR first.

Summary of changes

Make DD_DOTNET_TRACER_HOME optional. If not set, try to figure out the path from COR_PROFILER_PATH/CORECLR_PROFILER_PATH and friends.

Reason for change

One less env var for users to set manually. Easier onboarding, less error-prone.

I recently worked on an escalation where DD_DOTNET_TRACER_HOME was set to the wrong path so the tracer was not loading.

Implementation details

The implementation makes DD_DOTNET_TRACER_HOME optional by adding fallback logic to derive the tracer home path from the profiler path environment variables:

  1. New method GetTracerHomePath (Startup.cs:150-178):

    • First checks for explicit DD_DOTNET_TRACER_HOME setting (preserves backward compatibility)
    • Falls back to computing the path from architecture-specific profiler path env vars (e.g., CORECLR_PROFILER_PATH_64, COR_PROFILER_PATH_64)
    • If not found, tries the generic profiler path env var (e.g., CORECLR_PROFILER_PATH, COR_PROFILER_PATH)
  2. New method ComputeTracerHomePathFromProfilerPath (Startup.cs:180-218):

    • Takes a profiler path like C:\tracer\win-x64\Datadog.Trace.ClrProfiler.Native.dll
    • Extracts the parent directory
    • If the parent directory name matches a known architecture folder (e.g., win-x64, linux-arm64, osx), goes up one more level
    • Returns the computed tracer home path
  3. Platform-specific helper methods:

    • GetProfilerPathEnvVarNameForArch(): Returns the architecture-specific env var name (CORECLR_PROFILER_PATH_64 on .NET Core x64, COR_PROFILER_PATH_32 on .NET Framework x86, etc.)
    • GetProfilerPathEnvVarNameFallback(): Returns the generic env var name (CORECLR_PROFILER_PATH or COR_PROFILER_PATH)
  4. Architecture directory detection:

    • Maintains a HashSet<string> of known architecture directories (win-x64, win-x86, linux-x64, linux-arm64, etc)

Test coverage

Unit tests (tracer/test/Datadog.Trace.Tests/ClrProfiler/Managed/Loader/):

  • Environment variable reading and fallback logic (StartupNetCoreTests.cs, StartupNetFrameworkTests.cs)
  • GetTracerHomePath() with explicit DD_DOTNET_TRACER_HOME (with/without whitespace)
  • GetTracerHomePath() with architecture-specific profiler path fallback
  • GetTracerHomePath() with generic profiler path fallback
  • ComputeTracerHomePathFromProfilerPath() with all architecture directories
  • Edge cases: empty values, whitespace, missing variables, null handling

Integration tests:

  • Added WhenOmittingTracerHome_InstrumentsApp() test in InstrumentationTests.cs that explicitly omits DD_DOTNET_TRACER_HOME and verifies instrumentation works via fallback logic
  • Modified all smoke tests (SmokeTests/SmokeTestBase.cs) to omit DD_DOTNET_TRACER_HOME by default, providing comprehensive real-world validation of the fallback behavior across multiple regression scenarios

Other details

⚠️ Based on #7567, which was originally generated by OpenAI Codex, but I made substantial changes to clean up and refactor.

@lucaspimentel lucaspimentel changed the title Lpimentel/remove tracer home dependency make DD_DOTNET_TRACER_HOME optional Sep 25, 2025
@lucaspimentel lucaspimentel marked this pull request as ready for review September 25, 2025 22:45
@lucaspimentel lucaspimentel requested review from a team as code owners September 25, 2025 22:45
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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

@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Sep 25, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-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 shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

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).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7568) - mean (72ms)  : 71, 73
     .   : milestone, 72,
    master - mean (75ms)  : 74, 76
     .   : milestone, 75,

    section Baseline
    This PR (7568) - mean (68ms)  : 67, 70
     .   : milestone, 68,
    master - mean (71ms)  : 69, 73
     .   : milestone, 71,

    section CallTarget+Inlining+NGEN
    This PR (7568) - mean (1,047ms)  : 1003, 1091
     .   : milestone, 1047,
    master - mean (1,069ms)  : 1007, 1131
     .   : milestone, 1069,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7568) - mean (107ms)  : 105, 108
     .   : milestone, 107,
    master - mean (112ms)  : 109, 114
     .   : milestone, 112,

    section Baseline
    This PR (7568) - mean (106ms)  : 103, 109
     .   : milestone, 106,
    master - mean (111ms)  : 108, 113
     .   : milestone, 111,

    section CallTarget+Inlining+NGEN
    This PR (7568) - mean (745ms)  : 721, 769
     .   : milestone, 745,
    master - mean (761ms)  : 735, 788
     .   : milestone, 761,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7568) - mean (95ms)  : 93, 96
     .   : milestone, 95,
    master - mean (103ms)  : 101, 105
     .   : milestone, 103,

    section Baseline
    This PR (7568) - mean (94ms)  : 92, 96
     .   : milestone, 94,
    master - mean (100ms)  : 96, 104
     .   : milestone, 100,

    section CallTarget+Inlining+NGEN
    This PR (7568) - mean (703ms)  : 667, 739
     .   : milestone, 703,
    master - mean (721ms)  : 681, 761
     .   : milestone, 721,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7568) - mean (94ms)  : 92, 95
     .   : milestone, 94,
    master - mean (98ms)  : 96, 101
     .   : milestone, 98,

    section Baseline
    This PR (7568) - mean (92ms)  : 90, 95
     .   : milestone, 92,
    master - mean (97ms)  : 94, 100
     .   : milestone, 97,

    section CallTarget+Inlining+NGEN
    This PR (7568) - mean (660ms)  : 644, 676
     .   : milestone, 660,
    master - mean (679ms)  : 664, 693
     .   : milestone, 679,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7568) - mean (197ms)  : 194, 200
     .   : milestone, 197,
    master - mean (197ms)  : 194, 200
     .   : milestone, 197,

    section Baseline
    This PR (7568) - mean (194ms)  : 190, 198
     .   : milestone, 194,
    master - mean (194ms)  : 190, 197
     .   : milestone, 194,

    section CallTarget+Inlining+NGEN
    This PR (7568) - mean (1,180ms)  : 1106, 1253
     .   : milestone, 1180,
    master - mean (1,166ms)  : 1111, 1220
     .   : milestone, 1166,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7568) - mean (277ms)  : 274, 281
     .   : milestone, 277,
    master - mean (278ms)  : 274, 281
     .   : milestone, 278,

    section Baseline
    This PR (7568) - mean (276ms)  : 272, 281
     .   : milestone, 276,
    master - mean (278ms)  : 273, 283
     .   : milestone, 278,

    section CallTarget+Inlining+NGEN
    This PR (7568) - mean (943ms)  : 907, 978
     .   : milestone, 943,
    master - mean (947ms)  : 898, 996
     .   : milestone, 947,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7568) - mean (271ms)  : 267, 274
     .   : milestone, 271,
    master - mean (271ms)  : 268, 274
     .   : milestone, 271,

    section Baseline
    This PR (7568) - mean (269ms)  : 266, 273
     .   : milestone, 269,
    master - mean (272ms)  : 266, 278
     .   : milestone, 272,

    section CallTarget+Inlining+NGEN
    This PR (7568) - mean (925ms)  : 869, 981
     .   : milestone, 925,
    master - mean (935ms)  : 873, 996
     .   : milestone, 935,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7568) - mean (271ms)  : 265, 276
     .   : milestone, 271,
    master - mean (271ms)  : 266, 276
     .   : milestone, 271,

    section Baseline
    This PR (7568) - mean (270ms)  : 266, 274
     .   : milestone, 270,
    master - mean (269ms)  : 265, 274
     .   : milestone, 269,

    section CallTarget+Inlining+NGEN
    This PR (7568) - mean (851ms)  : 832, 870
     .   : milestone, 851,
    master - mean (861ms)  : 836, 886
     .   : milestone, 861,

Loading

Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! I just think we need

  1. Potential some perf tweaks
  2. Tests (unit and smoke/integration)

@lucaspimentel lucaspimentel force-pushed the lpimentel/remove-tracer-home-dependency branch from 7a38278 to 8c6e15a Compare September 30, 2025 15:17
@lucaspimentel lucaspimentel marked this pull request as draft September 30, 2025 22:37
@lucaspimentel lucaspimentel force-pushed the lpimentel/remove-tracer-home-dependency branch from 01ee21f to 401e2b7 Compare October 2, 2025 02:39
@lucaspimentel lucaspimentel changed the base branch from master to lpimentel/managed-loader-cleanup October 2, 2025 02:41
@lucaspimentel lucaspimentel marked this pull request as ready for review October 2, 2025 03:05
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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

@lucaspimentel lucaspimentel force-pushed the lpimentel/managed-loader-cleanup branch from caaa220 to 7d426a8 Compare October 2, 2025 14:01
@lucaspimentel lucaspimentel requested a review from a team October 2, 2025 14:05
@lucaspimentel lucaspimentel force-pushed the lpimentel/managed-loader-cleanup branch from 3a9626d to 2df2a24 Compare October 2, 2025 17:52
@lucaspimentel lucaspimentel force-pushed the lpimentel/remove-tracer-home-dependency branch 2 times, most recently from 958c6b9 to 786176e Compare October 2, 2025 18:04
@lucaspimentel lucaspimentel requested a review from a team as a code owner October 2, 2025 18:49
@bouwkast bouwkast added the status:do-not-merge Work is done. Can review, but do not merge yet. label Oct 2, 2025
@lucaspimentel lucaspimentel force-pushed the lpimentel/managed-loader-cleanup branch 2 times, most recently from 86abef5 to 58ec179 Compare October 7, 2025 20:29
@lucaspimentel lucaspimentel changed the title make DD_DOTNET_TRACER_HOME optional [onboarding] make DD_DOTNET_TRACER_HOME optional Oct 8, 2025
@lucaspimentel lucaspimentel force-pushed the lpimentel/managed-loader-cleanup branch from 58ec179 to ad16d72 Compare October 10, 2025 18:29
@lucaspimentel lucaspimentel force-pushed the lpimentel/remove-tracer-home-dependency branch from 427a860 to c7e6574 Compare October 10, 2025 19:18
@pr-commenter
Copy link

pr-commenter bot commented Oct 10, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7568 compared to master:

  • 1 benchmarks are faster, with geometric mean 2.484
  • 1 benchmarks are slower, with geometric mean 2.053
  • 4 benchmarks have fewer allocations
  • 5 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 5.99 KB 6.11 KB 117 B 1.95%
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑netcoreapp3.1 5.68 KB 5.72 KB 36 B 0.63%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.8μs 58ns 343ns 0 0 0 5.51 KB
master StartStopWithChild netcoreapp3.1 14.1μs 26.9ns 104ns 0 0 0 5.68 KB
master StartStopWithChild net472 22.5μs 118ns 625ns 1.04 0.415 0.104 5.99 KB
#7568 StartStopWithChild net6.0 11μs 58.3ns 319ns 0 0 0 5.52 KB
#7568 StartStopWithChild netcoreapp3.1 14.3μs 71.9ns 330ns 0 0 0 5.72 KB
#7568 StartStopWithChild net472 22.4μs 105ns 435ns 1.06 0.317 0.106 6.11 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 940μs 73.2ns 253ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 180ns 673ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.19ms 133ns 459ns 0 0 0 3.31 KB
#7568 WriteAndFlushEnrichedTraces net6.0 943μs 342ns 1.32μs 0 0 0 2.71 KB
#7568 WriteAndFlushEnrichedTraces netcoreapp3.1 1.01ms 268ns 1.04μs 0 0 0 2.7 KB
#7568 WriteAndFlushEnrichedTraces net472 1.19ms 1.36μs 5.27μs 0 0 0 3.31 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Unknown 🤷 Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleSimpleBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleSimpleBody net472 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleMoreComplexBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleMoreComplexBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
master AllCycleMoreComplexBody net472 N/A N/A N/A NaN NaN NaN 0 b
master ObjectExtractorSimpleBody net6.0 323ns 1.67ns 8.36ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 403ns 0.182ns 0.703ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 295ns 0.0707ns 0.245ns 0.0446 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.38μs 29.5ns 118ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.72μs 20.7ns 80ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.71μs 1.47ns 5.68ns 0.602 0 0 3.8 KB
#7568 AllCycleSimpleBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7568 AllCycleSimpleBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7568 AllCycleSimpleBody net472 N/A N/A N/A NaN NaN NaN 0 b
#7568 AllCycleMoreComplexBody net6.0 N/A N/A N/A NaN NaN NaN 0 b
#7568 AllCycleMoreComplexBody netcoreapp3.1 N/A N/A N/A NaN NaN NaN 0 b
#7568 AllCycleMoreComplexBody net472 N/A N/A N/A NaN NaN NaN 0 b
#7568 ObjectExtractorSimpleBody net6.0 323ns 1.75ns 9.9ns 0 0 0 280 B
#7568 ObjectExtractorSimpleBody netcoreapp3.1 398ns 2.13ns 11.3ns 0 0 0 272 B
#7568 ObjectExtractorSimpleBody net472 295ns 0.0558ns 0.209ns 0.0445 0 0 281 B
#7568 ObjectExtractorMoreComplexBody net6.0 6.24μs 32.7ns 167ns 0 0 0 3.78 KB
#7568 ObjectExtractorMoreComplexBody netcoreapp3.1 7.96μs 33.3ns 129ns 0 0 0 3.69 KB
#7568 ObjectExtractorMoreComplexBody net472 6.72μs 2.29ns 8.56ns 0.571 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 78.8μs 370ns 1.48μs 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 98.2μs 50.8ns 190ns 0 0 0 32.4 KB
master EncodeArgs net472 112μs 4.51ns 17.5ns 5.04 0 0 32.51 KB
master EncodeLegacyArgs net6.0 141μs 23.7ns 85.4ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 199μs 549ns 2.13μs 0 0 0 2.15 KB
master EncodeLegacyArgs net472 264μs 35.9ns 129ns 0 0 0 2.16 KB
#7568 EncodeArgs net6.0 76.3μs 162ns 628ns 0 0 0 32.4 KB
#7568 EncodeArgs netcoreapp3.1 97.2μs 162ns 626ns 0 0 0 32.4 KB
#7568 EncodeArgs net472 109μs 9.08ns 31.4ns 4.9 0 0 32.51 KB
#7568 EncodeLegacyArgs net6.0 143μs 52.4ns 189ns 0 0 0 2.15 KB
#7568 EncodeLegacyArgs netcoreapp3.1 198μs 172ns 664ns 0 0 0 2.14 KB
#7568 EncodeLegacyArgs net472 262μs 23.7ns 88.5ns 0 0 0 2.17 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #7568

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark‑netcoreapp3.1 2.053 415,632.71 853,120.69

Faster 🎉 in #7568

Benchmark base/diff Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑netcoreapp3.1 2.484 739,179.38 297,519.57

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 391μs 38.2ns 148ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 416μs 57.8ns 208ns 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 429μs 39.6ns 153ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 289μs 32.8ns 127ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 699μs 9.43μs 94.3μs 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 310μs 31.6ns 114ns 0 0 0 2.29 KB
#7568 RunWafRealisticBenchmark net6.0 395μs 80.2ns 300ns 0 0 0 4.55 KB
#7568 RunWafRealisticBenchmark netcoreapp3.1 796μs 15.7μs 147μs 0 0 0 4.48 KB
#7568 RunWafRealisticBenchmark net472 429μs 43ns 161ns 0 0 0 4.66 KB
#7568 RunWafRealisticBenchmarkWithAttack net6.0 285μs 38.2ns 143ns 0 0 0 2.24 KB
#7568 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 298μs 26.1ns 94.2ns 0 0 0 2.22 KB
#7568 RunWafRealisticBenchmarkWithAttack net472 309μs 26.1ns 94.1ns 0 0 0 2.29 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑net6.0 14.67 KB 14.52 KB -149 B -1.02%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 61.6μs 82.4ns 308ns 0 0 0 14.67 KB
master SendRequest netcoreapp3.1 72μs 105ns 555ns 0 0 0 17.42 KB
master SendRequest net472 0.00434ns 0.00176ns 0.00684ns 0 0 0 0 b
#7568 SendRequest net6.0 61.1μs 50.7ns 176ns 0 0 0 14.52 KB
#7568 SendRequest netcoreapp3.1 71.9μs 76.1ns 285ns 0 0 0 17.42 KB
#7568 SendRequest net472 0.00189ns 0.00106ns 0.00409ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1 1 B 14 B 13 B 1,300.00%

Fewer allocations 🎉 in #7568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 4 B 2 B -2 B -50.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.9ms 429ns 1.66μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.13ms 7.72μs 29.9μs 0 0 0 640 KB
master OriginalCharSlice net472 2.67ms 137ns 531ns 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.46ms 282ns 1.09μs 0 0 0 7 B
master OptimizedCharSlice netcoreapp3.1 1.67ms 407ns 1.58μs 0 0 0 1 B
master OptimizedCharSlice net472 1.97ms 302ns 1.13μs 0 0 0 73 B
master OptimizedCharSliceWithPool net6.0 854μs 31.1ns 120ns 0 0 0 4 B
master OptimizedCharSliceWithPool netcoreapp3.1 817μs 191ns 741ns 0 0 0 0 b
master OptimizedCharSliceWithPool net472 1.14ms 138ns 515ns 0 0 0 47 B
#7568 OriginalCharSlice net6.0 1.89ms 6.97μs 27μs 0 0 0 640.01 KB
#7568 OriginalCharSlice netcoreapp3.1 2.14ms 4.7μs 17.6μs 0 0 0 640 KB
#7568 OriginalCharSlice net472 2.61ms 406ns 1.52μs 100 0 0 641.95 KB
#7568 OptimizedCharSlice net6.0 1.41ms 248ns 926ns 0 0 0 7 B
#7568 OptimizedCharSlice netcoreapp3.1 1.69ms 364ns 1.26μs 0 0 0 14 B
#7568 OptimizedCharSlice net472 1.99ms 735ns 2.85μs 0 0 0 73 B
#7568 OptimizedCharSliceWithPool net6.0 835μs 26.7ns 103ns 0 0 0 2 B
#7568 OptimizedCharSliceWithPool netcoreapp3.1 887μs 125ns 482ns 0 0 0 0 b
#7568 OptimizedCharSliceWithPool net472 1.13ms 69.5ns 269ns 0 0 0 47 B
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.62 KB 42.14 KB 520 B 1.25%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 705μs 3.45μs 15.4μs 0 0 0 41.62 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 685μs 1.24μs 4.48μs 0 0 0 41.82 KB
master WriteAndFlushEnrichedTraces net472 917μs 3.85μs 14.4μs 4.46 0 0 55.74 KB
#7568 WriteAndFlushEnrichedTraces net6.0 718μs 1.06μs 4.12μs 0 0 0 42.14 KB
#7568 WriteAndFlushEnrichedTraces netcoreapp3.1 675μs 4.76μs 46.8μs 0 0 0 41.73 KB
#7568 WriteAndFlushEnrichedTraces net472 863μs 4.25μs 18.5μs 4.46 0 0 55.53 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.87μs 9.22ns 40.2ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.67μs 7.53ns 29.2ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.8μs 2.81ns 10.5ns 0.154 0.014 0 987 B
#7568 ExecuteNonQuery net6.0 1.9μs 9.19ns 37.9ns 0 0 0 1.02 KB
#7568 ExecuteNonQuery netcoreapp3.1 2.62μs 5.11ns 19.8ns 0 0 0 1.02 KB
#7568 ExecuteNonQuery net472 2.85μs 5.95ns 21.5ns 0.155 0.0141 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.74μs 7.82ns 30.3ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.29μs 10.6ns 42.3ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.52μs 1.56ns 5.4ns 0.161 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.77μs 1.35ns 5.24ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.37μs 9.76ns 37.8ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.64μs 1.32ns 4.77ns 0.165 0 0 1.1 KB
#7568 CallElasticsearch net6.0 1.75μs 8.93ns 40ns 0 0 0 1.03 KB
#7568 CallElasticsearch netcoreapp3.1 2.21μs 9.15ns 35.4ns 0 0 0 1.03 KB
#7568 CallElasticsearch net472 3.45μs 1.88ns 7.28ns 0.156 0 0 1.04 KB
#7568 CallElasticsearchAsync net6.0 1.84μs 8.89ns 37.7ns 0 0 0 1.01 KB
#7568 CallElasticsearchAsync netcoreapp3.1 2.37μs 11.4ns 48.2ns 0 0 0 1.08 KB
#7568 CallElasticsearchAsync net472 3.66μs 2.53ns 9.8ns 0.164 0 0 1.1 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.89μs 5.38ns 20.8ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.5μs 11ns 42.7ns 0 0 0 952 B
master ExecuteAsync net472 2.7μs 2.11ns 8.18ns 0.134 0 0 915 B
#7568 ExecuteAsync net6.0 1.91μs 2.8ns 10.8ns 0 0 0 952 B
#7568 ExecuteAsync netcoreapp3.1 2.49μs 8.1ns 31.4ns 0 0 0 952 B
#7568 ExecuteAsync net472 2.79μs 2.87ns 11.1ns 0.139 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 6.8μs 13ns 48.6ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.83μs 16.2ns 60.6ns 0 0 0 2.9 KB
master SendAsync net472 12.3μs 7.04ns 27.3ns 0.49 0 0 3.18 KB
#7568 SendAsync net6.0 6.9μs 15.5ns 59.9ns 0 0 0 2.36 KB
#7568 SendAsync netcoreapp3.1 8.53μs 7.4ns 26.7ns 0 0 0 2.9 KB
#7568 SendAsync net472 12.3μs 9.65ns 37.4ns 0.489 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 43.1 KB 43.44 KB 336 B 0.78%

Fewer allocations 🎉 in #7568

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 279.54 KB 275.46 KB -4.07 KB -1.46%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 87.84 KB 42.64 KB -45.2 KB -51.46%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 41.1μs 185ns 963ns 0 0 0 43.1 KB
master StringConcatBenchmark netcoreapp3.1 49.8μs 288ns 2.69μs 0 0 0 87.84 KB
master StringConcatBenchmark net472 57.2μs 156ns 564ns 0 0 0 65.54 KB
master StringConcatAspectBenchmark net6.0 528μs 2.16μs 7.8μs 0 0 0 279.54 KB
master StringConcatAspectBenchmark netcoreapp3.1 485μs 1.63μs 5.88μs 0 0 0 257.21 KB
master StringConcatAspectBenchmark net472 406μs 2.15μs 11.6μs 0 0 0 278.53 KB
#7568 StringConcatBenchmark net6.0 44μs 201ns 723ns 0 0 0 43.44 KB
#7568 StringConcatBenchmark netcoreapp3.1 49.6μs 291ns 2.51μs 0 0 0 42.64 KB
#7568 StringConcatBenchmark net472 57μs 298ns 1.4μs 0 0 0 65.54 KB
#7568 StringConcatAspectBenchmark net6.0 474μs 1.35μs 4.88μs 0 0 0 275.46 KB
#7568 StringConcatAspectBenchmark netcoreapp3.1 492μs 2.56μs 12.6μs 0 0 0 257.41 KB
#7568 StringConcatAspectBenchmark net472 408μs 2.18μs 11.9μs 0 0 0 278.53 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.6μs 13.5ns 66.4ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.61μs 12.4ns 48.2ns 0 0 0 1.7 KB
master EnrichedLog net472 3.86μs 4.71ns 18.3ns 0.25 0 0 1.64 KB
#7568 EnrichedLog net6.0 2.65μs 1.07ns 4.14ns 0 0 0 1.7 KB
#7568 EnrichedLog netcoreapp3.1 3.68μs 14.6ns 56.5ns 0 0 0 1.7 KB
#7568 EnrichedLog net472 3.87μs 3.1ns 12ns 0.252 0 0 1.64 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 123μs 65ns 243ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 129μs 525ns 1.89μs 0 0 0 4.31 KB
master EnrichedLog net472 167μs 60.3ns 233ns 0 0 0 4.52 KB
#7568 EnrichedLog net6.0 123μs 41.9ns 151ns 0 0 0 4.31 KB
#7568 EnrichedLog netcoreapp3.1 127μs 30.5ns 110ns 0 0 0 4.31 KB
#7568 EnrichedLog net472 168μs 26.4ns 102ns 0 0 0 4.52 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.99μs 8.55ns 33.1ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.71μs 26.1ns 101ns 0 0 0 2.26 KB
master EnrichedLog net472 7.61μs 9.36ns 36.3ns 0.305 0 0 2.08 KB
#7568 EnrichedLog net6.0 4.93μs 3.44ns 11.9ns 0 0 0 2.26 KB
#7568 EnrichedLog netcoreapp3.1 6.75μs 16.6ns 64.3ns 0 0 0 2.26 KB
#7568 EnrichedLog net472 7.72μs 6.18ns 23.9ns 0.308 0 0 2.08 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.94μs 1.54ns 5.35ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.75μs 3.57ns 13.8ns 0 0 0 1.2 KB
master SendReceive net472 3.14μs 1.07ns 3.72ns 0.189 0 0 1.2 KB
#7568 SendReceive net6.0 1.98μs 10.1ns 48.4ns 0 0 0 1.2 KB
#7568 SendReceive netcoreapp3.1 2.68μs 13.6ns 65.3ns 0 0 0 1.2 KB
#7568 SendReceive net472 3.17μs 6.05ns 23.4ns 0.188 0 0 1.2 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.33μs 5ns 18ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.66μs 12ns 46.6ns 0 0 0 1.63 KB
master EnrichedLog net472 6.57μs 7.75ns 30ns 0.295 0 0 2.03 KB
#7568 EnrichedLog net6.0 4.34μs 5.71ns 20.6ns 0 0 0 1.58 KB
#7568 EnrichedLog netcoreapp3.1 5.55μs 12.1ns 46.9ns 0 0 0 1.63 KB
#7568 EnrichedLog net472 6.6μs 6.35ns 24.6ns 0.298 0 0 2.03 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 795ns 1.27ns 4.91ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 958ns 5.25ns 25.7ns 0 0 0 576 B
master StartFinishSpan net472 965ns 0.136ns 0.509ns 0.0912 0 0 578 B
master StartFinishScope net6.0 933ns 0.221ns 0.829ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.22μs 5.8ns 24.6ns 0 0 0 696 B
master StartFinishScope net472 1.15μs 0.24ns 0.93ns 0.104 0 0 658 B
#7568 StartFinishSpan net6.0 787ns 0.591ns 2.29ns 0 0 0 576 B
#7568 StartFinishSpan netcoreapp3.1 948ns 4.73ns 20.6ns 0 0 0 576 B
#7568 StartFinishSpan net472 931ns 0.638ns 2.47ns 0.0887 0 0 578 B
#7568 StartFinishScope net6.0 907ns 5.13ns 31.6ns 0 0 0 696 B
#7568 StartFinishScope netcoreapp3.1 1.16μs 6.27ns 34.9ns 0 0 0 696 B
#7568 StartFinishScope net472 1.14μs 0.364ns 1.41ns 0.102 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 1.05μs 4.94ns 19.1ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.42μs 6.32ns 23.6ns 0 0 0 696 B
master RunOnMethodBegin net472 1.45μs 0.565ns 2.19ns 0.102 0 0 658 B
#7568 RunOnMethodBegin net6.0 1.06μs 0.567ns 2.12ns 0 0 0 696 B
#7568 RunOnMethodBegin netcoreapp3.1 1.4μs 7.26ns 33.3ns 0 0 0 696 B
#7568 RunOnMethodBegin net472 1.46μs 0.667ns 2.49ns 0.103 0 0 658 B

Copy link
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Thanks!

prependSamplesToAppName: false);
prependSamplesToAppName: false)
{
// Don't set DD_DOTNET_TRACER_HOME in smoke tests to verify the fallback logic works
Copy link
Member

Choose a reason for hiding this comment

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

These are different smoke tests than the ones I meant 😅 But that's probably fine 🤷‍♂️

@lucaspimentel lucaspimentel force-pushed the lpimentel/managed-loader-cleanup branch from 0857ac1 to 6579b07 Compare October 20, 2025 20:51
@lucaspimentel lucaspimentel removed the status:do-not-merge Work is done. Can review, but do not merge yet. label Oct 22, 2025
lucaspimentel and others added 2 commits October 22, 2025 17:32
Distinguish between two failure scenarios:
- DD_DOTNET_TRACER_HOME not set and auto-detection failed
- DD_DOTNET_TRACER_HOME set but invalid

This helps users quickly understand whether the issue is with
explicit configuration or auto-detection from profiler paths.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add debug logs to show which method was used to determine the tracer
home directory:
- Explicit DD_DOTNET_TRACER_HOME environment variable
- Architecture-specific profiler path (e.g., CORECLR_PROFILER_PATH_64)
- Generic profiler path fallback (e.g., CORECLR_PROFILER_PATH)

This helps with troubleshooting customer issues and provides visibility
into the auto-detection feature.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@lucaspimentel
Copy link
Member Author

lucaspimentel commented Oct 23, 2025

TODO: Check for usage of DD_DOTNET_TRACER_HOME outside the managed loader. Not a blocker for this PR. For now this is a hidden/internal fallback and all docs and tooling still tell users to set DD_DOTNET_TRACER_HOME.


Edit: 🤖✨ found these usages:

  1. Datadog.Trace\AppSec\Waf\Initialization\LibraryLocationHelper.cs:95 - Reads the env var to locate the WAF library
  2. Datadog.Trace.Tools.dd_dotnet\Utils.cs:124 - Sets the env var when launching processes
  3. Datadog.Trace.Tools.dd_dotnet\Checks\ProcessBasicCheck.cs:125,127,141 - Checks if the env var is set and valid
  4. Datadog.Trace.Tools.Runner\Utils.cs:592 - Sets the env var when launching processes
  5. Datadog.Trace.Coverage.collector\CoverageSettings.cs:46 - Reads the env var for coverage settings
  6. Datadog.Trace.Coverage.collector\CoverageCollector.cs:139 - Error message referencing the env var
  7. Datadog.Trace.BenchmarkDotNet\DatadogDiagnoser.cs:135,232 - Reads and sets the env var for benchmarks
  8. Datadog.FleetInstaller\TracerValues.cs:28,48 - Sets the env var in environment variable dictionaries
  9. Datadog.Tracer.Native\environment_variables.h - Native code constant definition

Edit: 🤖✨ made further analysis:

Summary of Impact When DD_DOTNET_TRACER_HOME is Not Set

  1. AppSec WAF Library Location (LibraryLocationHelper.cs:95)
  • Impact: Graceful fallback ✅
  • Behavior: If not set, it skips this source and tries other methods to locate the WAF library:
    • First checks DD_INTERNAL_TRACE_NATIVE_ENGINE_PATH (set by native loader)
    • Then checks profiler path environment variables (CORECLR_PROFILER_PATH, etc.)
    • Finally checks AppDomain.CurrentDomain.BaseDirectory
  • Result: AppSec can still work without it
  1. dd_dotnet Tool (Utils.cs:124)
  • Impact: Sets it regardless ✅
  • Behavior: The tool computes tracerHome from either:
    • User-specified --tracer-home parameter
    • Or defaults to Path.Combine(AppContext.BaseDirectory, "..") (line 81)
  • Result: Always sets the env var when launching processes; doesn't read the existing value
  1. dd_dotnet Process Check (ProcessBasicCheck.cs:141)
  • Impact: Validation fails ⚠️
  • Behavior: Explicitly checks if the env var is set and displays warning: Environment variable not set: DD_DOTNET_TRACER_HOME
  • Result: Diagnostic check reports failure (ok = false)
  1. Trace Runner Tool (Utils.cs:592)
  • Impact: Sets it regardless ✅
  • Behavior: Similar to dd_dotnet, computes tracerHome from either:
    • User-specified tracerHome parameter
    • Or defaults to AppContext.BaseDirectory parent (line 505 shows error if not found)
  • Result: Always sets the env var when launching processes
  1. Coverage Collector (CoverageCollector.cs:139)
  • Impact: Coverage disabled ❌
  • Behavior: Logs error: Tracer home (DD_DOTNET_TRACER_HOME environment variable) is not defined or folder doesn't exist, coverage has been disabled.
  • Result: Returns false and coverage collection is completely disabled
  1. BenchmarkDotNet Integration (DatadogDiagnoser.cs:135,232)
  • Impact: Graceful fallback ✅
  • Behavior: Tries multiple locations in order:
    a. DD_DOTNET_TRACER_HOME env var
    b. {WorkingDirectory}/datadog
    c. {BenchmarkAssemblyLocation}/datadog
    d. (Optional) relative path from benchmark assembly
  • Result: Can still find monitoring home from other locations; sets the env var when launching benchmark processes
  1. Fleet Installer (TracerValues.cs:28,48)
  • Impact: Sets it as part of configuration ✅
  • Behavior: The TracerValues constructor requires tracerHomeDirectory parameter, which it then includes in the environment variable dictionaries
  • Result: Always includes it in the env vars it configures for IIS and global installations

Conclusion

Components that REQUIRE it:

  • ❌ Coverage Collector - completely disables coverage if not set

Components that VALIDATE it (but may not strictly require it):

  • ⚠️ dd_dotnet Process Check - reports diagnostic failure

Components that DON'T need it (have fallbacks or set it themselves):

  • ✅ AppSec WAF - has multiple fallback mechanisms
  • dd_dotnet Tool - computes and sets it when launching processes
  • ✅ Trace Runner Tool - computes and sets it when launching processes
  • BenchmarkDotNet - has multiple fallback locations
  • ✅ Fleet Installer - receives it as constructor parameter and sets it

The most critical dependency is the Coverage Collector (Datadog.Trace.Coverage.collector), which will completely disable coverage functionality without it.

@lucaspimentel lucaspimentel changed the title [onboarding] make DD_DOTNET_TRACER_HOME optional [onboarding] make DD_DOTNET_TRACER_HOME optional in managed loader Oct 23, 2025
Copy link
Collaborator

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

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

👍

…n test

Adds explicit checks at the start of WhenOmittingTracerHome_InstrumentsApp
to verify that DD_DOTNET_TRACER_HOME is not set in both:
- The test's custom environment variables
- The system environment

This makes the test's preconditions clear and ensures we're actually
testing the fallback behavior when the variable is absent, protecting
against both test setup errors and system environment pollution.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@lucaspimentel lucaspimentel enabled auto-merge (squash) October 23, 2025 22:43
@lucaspimentel lucaspimentel merged commit d0fe312 into master Oct 23, 2025
148 of 150 checks passed
@lucaspimentel lucaspimentel deleted the lpimentel/remove-tracer-home-dependency branch October 23, 2025 23:49
@github-actions github-actions bot added this to the vNext-v3 milestone Oct 23, 2025
andrewlock added a commit that referenced this pull request Oct 24, 2025
andrewlock added a commit that referenced this pull request Oct 24, 2025
…" (#7704)

## Summary of changes

This reverts commit d0fe312 (#7568).

## Reason for change

This broke the profiler integration tests on master (and we're not
entirely sure why)
lucaspimentel added a commit that referenced this pull request Oct 24, 2025
Add new sections to help developers investigate test failures:

1. **Determining If Failures Are Related to Your Changes**
   - How to compare builds before/after your commit
   - Commands to list recent master builds and compare failed tasks
   - Explanation of master-only tests that don't run on PRs

2. **Understanding Test Infrastructure**
   - Finding test configuration and environment variable setup
   - Common gotchas (e.g., profiler tests disabling tracer)
   - Cross-cutting test failures between components
   - Tracing error messages to source code

These additions document investigation techniques used to diagnose
profiler test failures after PR #7568, including:
- Comparing master builds to determine if failures are new vs pre-existing
- Reading test infrastructure code to understand environment setup
- Understanding how changes in one component (tracer) can affect tests
  for another component (profiler)
- Using grep to trace error messages back to source code

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
lucaspimentel added a commit that referenced this pull request Oct 29, 2025
## Summary of changes

Adds two new sections to
`docs/development/CI/TroubleshootingCIFailures.md`:
1. **Determining If Failures Are Related to Your Changes** - Compare
builds to identify new vs pre-existing failures
2. **Understanding Test Infrastructure** - Investigate test
configuration and cross-cutting failures

## Reason for change

While investigating profiler test failures after PR #7568, I developed
investigation techniques that aren't documented. These will help
developers diagnose similar issues faster.

## Implementation details

- Commands to compare master builds and identify new failures
- How to find test configuration (environment variables, helper classes)
- Understanding cross-cutting failures (e.g., tracer changes affecting
profiler tests)
- Tracing error messages to source code using grep

## Test coverage

N/A - Documentation only

## Other details

Based on investigation of profiler test failures caused by PR #7568's
managed loader auto-detection feature.

Co-authored-by: Claude <noreply@anthropic.com>
@andrewlock andrewlock added type:enhancement Improvement to an existing feature area:configuration labels Nov 3, 2025
lucaspimentel added a commit that referenced this pull request Nov 3, 2025
lucaspimentel added a commit that referenced this pull request Nov 7, 2025
lucaspimentel added a commit that referenced this pull request Nov 10, 2025
lucaspimentel added a commit that referenced this pull request Nov 18, 2025
lucaspimentel added a commit that referenced this pull request Nov 25, 2025
lucaspimentel added a commit that referenced this pull request Dec 3, 2025
lucaspimentel added a commit that referenced this pull request Dec 17, 2025
lucaspimentel added a commit that referenced this pull request Jan 13, 2026
lucaspimentel added a commit that referenced this pull request Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:configuration type:enhancement Improvement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants