Skip to content

Conversation

andrewlock
Copy link
Member

Summary of changes

Updates the VM images to be based on Ubuntu 24.04 instead of 20.04

Reason for change

We've been plagued by ##[error]The remote provider was unable to process the request. errors which cause jobs to just never start. After a call with Microsoft, they suggested the issue was related to using Ubuntu 20.04 as our base image for the VMs. Updating the images to test it out.

Implementation details

Rebuild the Linux VMs to use the new base images. The bulk of the implementation happens in dockerfiles so hopefully there won't be any issues

Test coverage

This is the test

Other details

@andrewlock andrewlock requested a review from a team as a code owner August 28, 2025 15:21
@andrewlock andrewlock added area:builds project files, build scripts, pipelines, versioning, releases, packages type:flake-fix labels Aug 28, 2025
@andrewlock andrewlock force-pushed the andrew/update-linux-app-pools branch from 44580f2 to fe88c2d Compare August 28, 2025 15:30
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Aug 28, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

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

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

dd-trace-dotnet-ci-bot bot commented Aug 28, 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 (7446) - mean (73ms)  : 72, 75
     .   : milestone, 73,
    master - mean (73ms)  : 72, 75
     .   : milestone, 73,

    section Baseline
    This PR (7446) - mean (71ms)  : 65, 77
     .   : milestone, 71,
    master - mean (70ms)  : 65, 76
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (7446) - mean (996ms)  : 964, 1028
     .   : milestone, 996,
    master - mean (995ms)  : 968, 1022
     .   : milestone, 995,

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

    section Baseline
    This PR (7446) - mean (108ms)  : 105, 111
     .   : milestone, 108,
    master - mean (108ms)  : 105, 111
     .   : milestone, 108,

    section CallTarget+Inlining+NGEN
    This PR (7446) - mean (704ms)  : 681, 726
     .   : milestone, 704,
    master - mean (705ms)  : 684, 726
     .   : milestone, 705,

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

    section Baseline
    This PR (7446) - mean (96ms)  : 94, 98
     .   : milestone, 96,
    master - mean (96ms)  : 93, 98
     .   : milestone, 96,

    section CallTarget+Inlining+NGEN
    This PR (7446) - mean (660ms)  : 640, 679
     .   : milestone, 660,
    master - mean (661ms)  : 644, 679
     .   : milestone, 661,

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

    section Baseline
    This PR (7446) - mean (95ms)  : 92, 97
     .   : milestone, 95,
    master - mean (95ms)  : 92, 97
     .   : milestone, 95,

    section CallTarget+Inlining+NGEN
    This PR (7446) - mean (595ms)  : 584, 605
     .   : milestone, 595,
    master - mean (599ms)  : 586, 612
     .   : milestone, 599,

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

    section Baseline
    This PR (7446) - mean (193ms)  : 187, 199
     .   : milestone, 193,
    master - mean (191ms)  : 186, 196
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    This PR (7446) - mean (1,113ms)  : 1080, 1145
     .   : milestone, 1113,
    master - mean (1,102ms)  : 1066, 1138
     .   : milestone, 1102,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7446) - mean (280ms)  : 276, 285
     .   : milestone, 280,
    master - mean (278ms)  : 273, 282
     .   : milestone, 278,

    section Baseline
    This PR (7446) - mean (280ms)  : 274, 286
     .   : milestone, 280,
    master - mean (276ms)  : 271, 281
     .   : milestone, 276,

    section CallTarget+Inlining+NGEN
    This PR (7446) - mean (900ms)  : 864, 935
     .   : milestone, 900,
    master - mean (891ms)  : 867, 916
     .   : milestone, 891,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7446) - mean (273ms)  : 267, 280
     .   : milestone, 273,
    master - mean (268ms)  : 265, 272
     .   : milestone, 268,

    section Baseline
    This PR (7446) - mean (274ms)  : 267, 281
     .   : milestone, 274,
    master - mean (268ms)  : 264, 272
     .   : milestone, 268,

    section CallTarget+Inlining+NGEN
    This PR (7446) - mean (889ms)  : 853, 924
     .   : milestone, 889,
    master - mean (873ms)  : 846, 900
     .   : milestone, 873,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Bailout
    This PR (7446) - mean (273ms)  : 266, 279
     .   : milestone, 273,
    master - mean (268ms)  : 263, 272
     .   : milestone, 268,

    section Baseline
    This PR (7446) - mean (271ms)  : 265, 278
     .   : milestone, 271,
    master - mean (269ms)  : 265, 272
     .   : milestone, 269,

    section CallTarget+Inlining+NGEN
    This PR (7446) - mean (802ms)  : 776, 828
     .   : milestone, 802,
    master - mean (790ms)  : 773, 807
     .   : milestone, 790,

Loading

@pr-commenter
Copy link

pr-commenter bot commented Aug 29, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7446 compared to master:

  • 2 benchmarks are slower, with geometric mean 1.151
  • 4 benchmarks have fewer allocations
  • 7 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 ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7446

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.09 KB 5.99 KB -99 B -1.63%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.5μs 57.5ns 350ns 0 0 0 5.5 KB
master StartStopWithChild netcoreapp3.1 13.2μs 64.6ns 266ns 0 0 0 5.7 KB
master StartStopWithChild net472 22.4μs 124ns 732ns 0.945 0.42 0 6.09 KB
#7446 StartStopWithChild net6.0 10.4μs 58.8ns 390ns 0 0 0 5.49 KB
#7446 StartStopWithChild netcoreapp3.1 13.8μs 69.8ns 304ns 0 0 0 5.71 KB
#7446 StartStopWithChild net472 21.9μs 122ns 773ns 0.882 0.22 0 5.99 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7446

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.31 KB 3.35 KB 46 B 1.39%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 936μs 63.9ns 247ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 176ns 634ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.2ms 304ns 1.1μs 0 0 0 3.31 KB
#7446 WriteAndFlushEnrichedTraces net6.0 952μs 139ns 539ns 0 0 0 2.7 KB
#7446 WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 146ns 545ns 0 0 0 2.7 KB
#7446 WriteAndFlushEnrichedTraces net472 1.19ms 106ns 383ns 0 0 0 3.35 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 322μs 1.32μs 5.1μs 0 0 0 172.07 KB
master AllCycleSimpleBody netcoreapp3.1 462μs 972ns 3.77μs 0 0 0 174.18 KB
master AllCycleSimpleBody net472 438μs 315ns 1.22μs 30.2 0 0 194.25 KB
master AllCycleMoreComplexBody net6.0 332μs 1.56μs 6.05μs 0 0 0 175.58 KB
master AllCycleMoreComplexBody netcoreapp3.1 507μs 513ns 1.99μs 0 0 0 177.6 KB
master AllCycleMoreComplexBody net472 437μs 174ns 674ns 30.2 0 0 197.76 KB
master ObjectExtractorSimpleBody net6.0 317ns 0.108ns 0.42ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 402ns 2.18ns 11.3ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 300ns 0.0488ns 0.189ns 0.0439 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.22μs 23.1ns 89.3ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.86μs 30.4ns 118ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.66μs 2.03ns 7.86ns 0.599 0 0 3.8 KB
#7446 AllCycleSimpleBody net6.0 322μs 1.4μs 5.44μs 0 0 0 172.07 KB
#7446 AllCycleSimpleBody netcoreapp3.1 452μs 2.12μs 8.2μs 0 0 0 174.19 KB
#7446 AllCycleSimpleBody net472 427μs 179ns 692ns 29.2 0 0 194.24 KB
#7446 AllCycleMoreComplexBody net6.0 330μs 184ns 711ns 0 0 0 175.58 KB
#7446 AllCycleMoreComplexBody netcoreapp3.1 506μs 1.67μs 6.48μs 0 0 0 177.6 KB
#7446 AllCycleMoreComplexBody net472 433μs 135ns 506ns 30.2 0 0 197.76 KB
#7446 ObjectExtractorSimpleBody net6.0 317ns 1.68ns 8.89ns 0 0 0 280 B
#7446 ObjectExtractorSimpleBody netcoreapp3.1 406ns 0.505ns 1.95ns 0 0 0 272 B
#7446 ObjectExtractorSimpleBody net472 305ns 0.0529ns 0.198ns 0.0445 0 0 281 B
#7446 ObjectExtractorMoreComplexBody net6.0 6.19μs 30ns 112ns 0 0 0 3.78 KB
#7446 ObjectExtractorMoreComplexBody netcoreapp3.1 7.81μs 22.4ns 86.7ns 0 0 0 3.69 KB
#7446 ObjectExtractorMoreComplexBody net472 6.81μs 6.27ns 24.3ns 0.582 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 76.8μs 220ns 823ns 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 98.5μs 245ns 948ns 0 0 0 32.4 KB
master EncodeArgs net472 109μs 48.6ns 188ns 4.92 0 0 32.51 KB
master EncodeLegacyArgs net6.0 141μs 30.7ns 119ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 199μs 221ns 854ns 0 0 0 2.14 KB
master EncodeLegacyArgs net472 262μs 40.4ns 156ns 0 0 0 2.16 KB
#7446 EncodeArgs net6.0 77.2μs 16.6ns 61.9ns 0 0 0 32.4 KB
#7446 EncodeArgs netcoreapp3.1 98.1μs 217ns 840ns 0 0 0 32.4 KB
#7446 EncodeArgs net472 111μs 18.5ns 71.5ns 4.99 0 0 32.51 KB
#7446 EncodeLegacyArgs net6.0 144μs 55ns 213ns 0 0 0 2.14 KB
#7446 EncodeLegacyArgs netcoreapp3.1 198μs 123ns 478ns 0 0 0 2.14 KB
#7446 EncodeLegacyArgs net472 262μs 40.6ns 157ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7446

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack‑net472 2.3 KB 2.29 KB -13 B -0.56%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 396μs 122ns 458ns 0 0 0 4.56 KB
master RunWafRealisticBenchmark netcoreapp3.1 792μs 14.9μs 148μs 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 434μs 48.4ns 188ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 292μs 50.3ns 195ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 724μs 3.14μs 11.3μs 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 313μs 70.9ns 275ns 0 0 0 2.3 KB
#7446 RunWafRealisticBenchmark net6.0 410μs 193ns 748ns 0 0 0 4.55 KB
#7446 RunWafRealisticBenchmark netcoreapp3.1 814μs 12.4μs 124μs 0 0 0 4.48 KB
#7446 RunWafRealisticBenchmark net472 430μs 82.9ns 321ns 0 0 0 4.66 KB
#7446 RunWafRealisticBenchmarkWithAttack net6.0 287μs 76.4ns 276ns 0 0 0 2.24 KB
#7446 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 690μs 12.8μs 128μs 0 0 0 2.22 KB
#7446 RunWafRealisticBenchmarkWithAttack net472 312μs 58.6ns 227ns 0 0 0 2.29 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 61.3μs 41.5ns 161ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 71.3μs 93.8ns 325ns 0 0 0 17.42 KB
master SendRequest net472 0.0117ns 0.00328ns 0.0127ns 0 0 0 0 b
#7446 SendRequest net6.0 60.2μs 37.7ns 141ns 0 0 0 14.52 KB
#7446 SendRequest netcoreapp3.1 71μs 88.6ns 319ns 0 0 0 17.42 KB
#7446 SendRequest net472 0.00844ns 0.00194ns 0.00727ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7446

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑netcoreapp3.1 1.112 1,720,600.00 1,913,438.12

More allocations ⚠️ in #7446

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

Fewer allocations 🎉 in #7446

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 1 B 0 b -1 B -100.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.97ms 644ns 2.41μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.13ms 11.2μs 57μs 0 0 0 640 KB
master OriginalCharSlice net472 2.73ms 174ns 650ns 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.36ms 284ns 1.1μs 0 0 0 7 B
master OptimizedCharSlice netcoreapp3.1 1.72ms 295ns 1.14μs 0 0 0 1 B
master OptimizedCharSlice net472 1.95ms 444ns 1.72μs 0 0 0 0 b
master OptimizedCharSliceWithPool net6.0 916μs 50.4ns 195ns 0 0 0 2 B
master OptimizedCharSliceWithPool netcoreapp3.1 827μs 72.6ns 262ns 0 0 0 1 B
master OptimizedCharSliceWithPool net472 1.16ms 87.6ns 316ns 0 0 0 0 b
#7446 OriginalCharSlice net6.0 1.93ms 418ns 1.62μs 0 0 0 640.01 KB
#7446 OriginalCharSlice netcoreapp3.1 2.15ms 5.95μs 23μs 0 0 0 640 KB
#7446 OriginalCharSlice net472 2.76ms 870ns 3.26μs 100 0 0 641.95 KB
#7446 OptimizedCharSlice net6.0 1.47ms 454ns 1.76μs 0 0 0 7 B
#7446 OptimizedCharSlice netcoreapp3.1 1.91ms 786ns 2.94μs 0 0 0 1 B
#7446 OptimizedCharSlice net472 1.96ms 474ns 1.84μs 0 0 0 0 b
#7446 OptimizedCharSliceWithPool net6.0 826μs 41.2ns 159ns 0 0 0 3 B
#7446 OptimizedCharSliceWithPool netcoreapp3.1 833μs 68.6ns 266ns 0 0 0 0 b
#7446 OptimizedCharSliceWithPool net472 1.14ms 19.9ns 71.9ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7446

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 41.65 KB 42.39 KB 736 B 1.77%
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 41.73 KB 42.06 KB 335 B 0.80%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 694μs 571ns 2.06μs 0 0 0 41.65 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 677μs 2.11μs 7.29μs 0 0 0 41.73 KB
master WriteAndFlushEnrichedTraces net472 905μs 4.57μs 20.4μs 8.33 0 0 55.98 KB
#7446 WriteAndFlushEnrichedTraces net6.0 697μs 4.65μs 46.1μs 0 0 0 42.39 KB
#7446 WriteAndFlushEnrichedTraces netcoreapp3.1 666μs 3.77μs 28μs 0 0 0 42.06 KB
#7446 WriteAndFlushEnrichedTraces net472 844μs 2.87μs 10.4μs 8.33 0 0 56.22 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.94μs 5.81ns 22.5ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.59μs 11.6ns 44.9ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.83μs 3.08ns 11.9ns 0.155 0.0141 0 987 B
#7446 ExecuteNonQuery net6.0 1.83μs 9.09ns 37.5ns 0 0 0 1.02 KB
#7446 ExecuteNonQuery netcoreapp3.1 2.47μs 2.76ns 10.7ns 0 0 0 1.02 KB
#7446 ExecuteNonQuery net472 2.7μs 2.04ns 7.89ns 0.146 0.0133 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.71μs 8.15ns 33.6ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.35μs 6.04ns 23.4ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.61μs 2.6ns 10.1ns 0.162 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.85μs 2.16ns 8.35ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.38μs 11.8ns 51.3ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.74μs 3.68ns 14.2ns 0.168 0 0 1.1 KB
#7446 CallElasticsearch net6.0 1.71μs 6.33ns 24.5ns 0 0 0 1.03 KB
#7446 CallElasticsearch netcoreapp3.1 2.32μs 10.9ns 42.2ns 0 0 0 1.03 KB
#7446 CallElasticsearch net472 3.6μs 1.62ns 5.83ns 0.162 0 0 1.04 KB
#7446 CallElasticsearchAsync net6.0 1.84μs 2.04ns 7.9ns 0 0 0 1.01 KB
#7446 CallElasticsearchAsync netcoreapp3.1 2.45μs 10.6ns 41.2ns 0 0 0 1.08 KB
#7446 CallElasticsearchAsync net472 3.84μs 5.49ns 21.2ns 0.172 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.87μs 2.26ns 8.47ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.33μs 11.5ns 47.2ns 0 0 0 952 B
master ExecuteAsync net472 2.58μs 4.02ns 15.6ns 0.14 0 0 915 B
#7446 ExecuteAsync net6.0 1.73μs 7.26ns 28.1ns 0 0 0 952 B
#7446 ExecuteAsync netcoreapp3.1 2.37μs 8.87ns 34.4ns 0 0 0 952 B
#7446 ExecuteAsync net472 2.43μs 2.83ns 10.9ns 0.145 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 7.08μs 31.8ns 119ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.35μs 26.9ns 104ns 0 0 0 2.9 KB
master SendAsync net472 12.2μs 8.46ns 31.6ns 0.486 0 0 3.18 KB
#7446 SendAsync net6.0 6.86μs 8.8ns 34.1ns 0 0 0 2.36 KB
#7446 SendAsync netcoreapp3.1 8.76μs 25.9ns 100ns 0 0 0 2.9 KB
#7446 SendAsync net472 12.3μs 12.6ns 48.7ns 0.487 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7446

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 1.191 417,850.00 497,700.00

More allocations ⚠️ in #7446

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net472 277.66 KB 286.72 KB 9.06 KB 3.26%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 44.33 KB 45.09 KB 760 B 1.71%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑netcoreapp3.1 42.64 KB 43.11 KB 472 B 1.11%

Fewer allocations 🎉 in #7446

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 276.1 KB 255.66 KB -20.44 KB -7.40%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 49μs 387ns 3.67μs 0 0 0 44.33 KB
master StringConcatBenchmark netcoreapp3.1 49.7μs 236ns 1.9μs 0 0 0 42.64 KB
master StringConcatBenchmark net472 57.9μs 130ns 449ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 457μs 2.16μs 9.4μs 0 0 0 258.64 KB
master StringConcatAspectBenchmark netcoreapp3.1 441μs 4.74μs 46.2μs 0 0 0 276.1 KB
master StringConcatAspectBenchmark net472 407μs 2.25μs 17μs 0 0 0 277.66 KB
#7446 StringConcatBenchmark net6.0 45.5μs 269ns 2.42μs 0 0 0 45.09 KB
#7446 StringConcatBenchmark netcoreapp3.1 58.5μs 797ns 7.85μs 0 0 0 43.11 KB
#7446 StringConcatBenchmark net472 57μs 114ns 410ns 0 0 0 57.34 KB
#7446 StringConcatAspectBenchmark net6.0 469μs 2.45μs 11.5μs 0 0 0 259.38 KB
#7446 StringConcatAspectBenchmark netcoreapp3.1 499μs 2.52μs 11.5μs 0 0 0 255.66 KB
#7446 StringConcatAspectBenchmark net472 406μs 1.92μs 7.93μs 0 0 0 286.72 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.52μs 13.6ns 70.5ns 0 0 0 1.7 KB
master EnrichedLog netcoreapp3.1 3.47μs 12.3ns 47.8ns 0 0 0 1.7 KB
master EnrichedLog net472 3.91μs 4.06ns 15.7ns 0.254 0 0 1.64 KB
#7446 EnrichedLog net6.0 2.57μs 11.9ns 47.8ns 0 0 0 1.7 KB
#7446 EnrichedLog netcoreapp3.1 3.34μs 14.7ns 56.9ns 0 0 0 1.7 KB
#7446 EnrichedLog net472 4.01μs 4.96ns 19.2ns 0.24 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 31.3ns 113ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 128μs 205ns 769ns 0 0 0 4.31 KB
master EnrichedLog net472 168μs 40.6ns 157ns 0 0 0 4.52 KB
#7446 EnrichedLog net6.0 122μs 333ns 1.25μs 0 0 0 4.31 KB
#7446 EnrichedLog netcoreapp3.1 127μs 83.3ns 288ns 0 0 0 4.31 KB
#7446 EnrichedLog net472 168μs 104ns 401ns 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.96μs 16ns 57.8ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.64μs 15.1ns 58.6ns 0 0 0 2.26 KB
master EnrichedLog net472 7.64μs 4.79ns 17.9ns 0.306 0 0 2.08 KB
#7446 EnrichedLog net6.0 4.9μs 24.4ns 112ns 0 0 0 2.26 KB
#7446 EnrichedLog netcoreapp3.1 6.95μs 5.91ns 22.9ns 0 0 0 2.26 KB
#7446 EnrichedLog net472 7.5μs 4.4ns 17ns 0.3 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.96μs 8.88ns 35.5ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.65μs 8.52ns 30.7ns 0 0 0 1.2 KB
master SendReceive net472 3.11μs 2.93ns 11ns 0.185 0 0 1.2 KB
#7446 SendReceive net6.0 2μs 8.24ns 31.9ns 0 0 0 1.2 KB
#7446 SendReceive netcoreapp3.1 2.64μs 12.4ns 49.7ns 0 0 0 1.2 KB
#7446 SendReceive net472 3.09μs 0.556ns 2.08ns 0.185 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.15μs 7.6ns 29.4ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.61μs 12ns 44.9ns 0 0 0 1.63 KB
master EnrichedLog net472 6.63μs 6.9ns 26.7ns 0.298 0 0 2.03 KB
#7446 EnrichedLog net6.0 4.21μs 2.02ns 7.56ns 0 0 0 1.58 KB
#7446 EnrichedLog netcoreapp3.1 5.61μs 13.3ns 49.6ns 0 0 0 1.63 KB
#7446 EnrichedLog net472 6.43μs 6.83ns 26.5ns 0.321 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 733ns 3.49ns 13.5ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 945ns 5ns 22.4ns 0 0 0 576 B
master StartFinishSpan net472 896ns 0.431ns 1.61ns 0.0904 0 0 578 B
master StartFinishScope net6.0 884ns 4.87ns 30.4ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.17μs 5.23ns 20.3ns 0 0 0 696 B
master StartFinishScope net472 1.1μs 0.952ns 3.56ns 0.0991 0 0 658 B
#7446 StartFinishSpan net6.0 747ns 4.18ns 19.6ns 0 0 0 576 B
#7446 StartFinishSpan netcoreapp3.1 924ns 4.7ns 21ns 0 0 0 576 B
#7446 StartFinishSpan net472 920ns 1.51ns 5.85ns 0.0913 0 0 578 B
#7446 StartFinishScope net6.0 916ns 4.69ns 21ns 0 0 0 696 B
#7446 StartFinishScope netcoreapp3.1 1.13μs 5.62ns 25.8ns 0 0 0 696 B
#7446 StartFinishScope net472 1.1μs 0.275ns 1.03ns 0.0995 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.03μs 5.21ns 25ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.44μs 0.341ns 1.18ns 0 0 0 696 B
master RunOnMethodBegin net472 1.36μs 1.39ns 5.39ns 0.102 0 0 658 B
#7446 RunOnMethodBegin net6.0 1.03μs 0.646ns 2.5ns 0 0 0 696 B
#7446 RunOnMethodBegin netcoreapp3.1 1.37μs 4.18ns 16.2ns 0 0 0 696 B
#7446 RunOnMethodBegin net472 1.38μs 0.407ns 1.52ns 0.104 0 0 658 B

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.

Thanks!

andrewlock added a commit that referenced this pull request Sep 3, 2025
…rieve the inode (#7453)

## Summary of changes

Adds a P/Invoke path for retrieving the inode on linux and only later
falls back to using `stat -c %i <path>`

## Reason for change

Calling `stat` will fail if `stat` isn't available (as in chiseled
containers, for example). It also results in additional spans being
created when we're running in a version-mismatch scenario(because the
`Process` invocation is traced)

## Implementation details

Based my initial PoC on P/Invoking into `System.Native`, which is a shim
shipped with recent .NET that handles a bunch of marshalling issues etc
and returns [this
type](https://github.com/dotnet/runtime/blob/main/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Stat.cs).
That's [how recent .NET
versions](https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/IO/FileStatus.Unix.cs#L498)
handle various bits like this.

However, System.Native only gives the correct inode value in .NET 7+
(from my local testing) and isn't available in early .NET Core. I then
tried the "raw" route, trying to P/Invoke directly into `libc`. I also
investigated making the syscall directly, but libc papers over
differences in old kernels etc, so it seemed the easiest route. However,
older versions of `libc` don't export the `lstat` or `fstatat` symbols
as public symbols, and instead they're just macros.

Finally settled on a similar approach to System.Native, i.e. we P/Invoke
into Datadog.Trace.Native which then makes the `lstat` call.

## Test coverage

Should _mostly_ be covered by existing tests (and smoke tests). I added
an additional unit test to make sure the `stat -c %i` call and the
P/Invoke give the same value, otherwise we should be covered.

I also rebased on top of [this
branch](#7446) which is
where the error appeared - and did a [full-installer
run](https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/results?buildId=186579&view=results),
and it fixed all the issues, so we should be good 🤞 And we still have
the existing fallback if not

Note that I explicitly disabled the process spans in the
version-conflict tests, as whether we get the spans or not is dependent
on the underlying host system, which is a bit gross.

## Other details

~~AI assisted in various places, including generating the structs.~~
None of that worked in the end. Great job AI.

I made the failure an error as it _shouldn't_ fail in normal execution,
and we'd like to report if it does, however there are some cases where
the P/Invoke calls aren't re-written so we know this won't work. In case
of failure, we explicitly check for that, and log the error as debug
instead.

To get everything to compile easily I split the `ContainerMetadata`
implementation for .NET FX as it's not supported in that scenario
anyway.

Also, to be able to unit test the P/Invoke work, I copied the native
libs into the test directories.

Finally, it's worth us looking into [this
method](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.nativelibrary.setdllimportresolver?view=net-9.0)
to allow P/Invokes to happen in the native runner, given we know where
the native libs are, they're just not re-written. Something to think
about in a separate PR I think
@andrewlock andrewlock force-pushed the andrew/update-linux-app-pools branch from f2b0595 to 538beab Compare September 3, 2025 12:07
@andrewlock andrewlock merged commit 1b848c5 into master Sep 3, 2025
151 checks passed
@andrewlock andrewlock deleted the andrew/update-linux-app-pools branch September 3, 2025 13:52
@github-actions github-actions bot added this to the vNext-v3 milestone Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:builds project files, build scripts, pipelines, versioning, releases, packages type:flake-fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants