dd-trace-dotnet icon indicating copy to clipboard operation
dd-trace-dotnet copied to clipboard

Add process tags to profiles

Open vandonr opened this issue 2 months ago • 4 comments

Summary of changes

Write process tags to profiles

Reason for change

OLDAIDM-701 AIDM-195

Implementation details

Most of the C++ code is AI generated, fed with PR #4298

Test coverage

Other details

vandonr avatar Oct 27 '25 14:10 vandonr

Benchmarks

Benchmark execution time: 2025-12-18 15:05:18

Comparing candidate commit f2c0739d in PR branch vandonr/process2 with baseline commit 16675ffb in branch master.

Found 6 performance improvements and 4 performance regressions! Performance is the same for 165 metrics, 11 unstable metrics.

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net6.0

  • 🟩 execution_time [-20.585ms; -15.014ms] or [-9.510%; -6.937%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net6.0

  • 🟩 execution_time [-24.898ms; -18.316ms] or [-11.533%; -8.485%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs netcoreapp3.1

  • 🟩 execution_time [-20.629ms; -19.449ms] or [-10.171%; -9.590%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • 🟩 execution_time [-111.938ms; -95.490ms] or [-56.363%; -48.081%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+16.717ms; +21.385ms] or [+9.013%; +11.530%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0

  • 🟩 execution_time [-876.293µs; -794.433µs] or [-65.819%; -59.670%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • 🟥 execution_time [+2.693µs; +6.628µs] or [+6.115%; +15.051%]
  • 🟥 throughput [-2665.679op/s; -1218.810op/s] or [-11.692%; -5.346%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0

  • 🟥 execution_time [+13.952ms; +16.909ms] or [+6.994%; +8.476%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope netcoreapp3.1

  • 🟩 execution_time [-20.433ms; -16.670ms] or [-9.562%; -7.801%]

pr-commenter[bot] avatar Oct 27 '25 15:10 pr-commenter[bot]

Execution-Time Benchmarks Report :stopwatch:

Execution-time results for samples comparing This PR (7715) and master.

✅ No regressions detected - check the details below

Full Metrics Comparison

FakeDbCommand

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration75.38 ± (75.49 - 76.20) ms75.84 ± (75.76 - 76.37) ms+0.6%✅⬆️
.NET Framework 4.8 - Bailout
duration79.76 ± (79.52 - 80.18) ms81.47 ± (81.21 - 81.78) ms+2.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1109.88 ± (1111.58 - 1122.37) ms1120.72 ± (1122.07 - 1130.79) ms+1.0%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms23.00 ± (22.93 - 23.07) ms23.08 ± (23.00 - 23.17) ms+0.4%✅⬆️
process.time_to_main_ms87.18 ± (86.84 - 87.52) ms87.71 ± (87.38 - 88.04) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.91) MB10.90 ± (10.90 - 10.90) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.75 ± (22.69 - 22.81) ms23.08 ± (23.00 - 23.16) ms+1.5%✅⬆️
process.time_to_main_ms87.56 ± (87.19 - 87.93) ms90.25 ± (89.88 - 90.62) ms+3.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.94 - 10.95) MB10.94 ± (10.94 - 10.95) MB-0.0%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms218.72 ± (217.39 - 220.04) ms220.49 ± (219.00 - 221.97) ms+0.8%✅⬆️
process.time_to_main_ms548.05 ± (546.77 - 549.33) ms552.26 ± (550.97 - 553.55) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.62 ± (52.60 - 52.64) MB52.52 ± (52.50 - 52.54) MB-0.2%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.5%
.NET 6 - Baseline
process.internal_duration_ms21.67 ± (21.60 - 21.74) ms21.49 ± (21.40 - 21.57) ms-0.8%
process.time_to_main_ms75.78 ± (75.42 - 76.13) ms74.85 ± (74.38 - 75.32) ms-1.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.61 - 10.62) MB10.63 ± (10.63 - 10.64) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.86 ± (21.79 - 21.94) ms21.84 ± (21.77 - 21.92) ms-0.1%
process.time_to_main_ms78.17 ± (77.79 - 78.54) ms78.21 ± (77.84 - 78.58) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.67 ± (10.67 - 10.67) MB10.68 ± (10.67 - 10.68) MB+0.0%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms206.31 ± (204.95 - 207.67) ms207.51 ± (206.01 - 209.01) ms+0.6%✅⬆️
process.time_to_main_ms513.43 ± (512.06 - 514.80) ms510.87 ± (509.96 - 511.77) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.86 ± (51.83 - 51.89) MB51.60 ± (51.57 - 51.63) MB-0.5%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.88 ± (19.81 - 19.95) ms19.86 ± (19.79 - 19.92) ms-0.1%
process.time_to_main_ms75.61 ± (75.27 - 75.94) ms74.43 ± (74.13 - 74.74) ms-1.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.66 - 7.67) MB7.65 ± (7.64 - 7.65) MB-0.2%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.64 ± (19.58 - 19.70) ms19.82 ± (19.75 - 19.88) ms+0.9%✅⬆️
process.time_to_main_ms75.86 ± (75.57 - 76.14) ms76.23 ± (75.88 - 76.58) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.70 - 7.72) MB7.71 ± (7.71 - 7.72) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms191.79 ± (190.93 - 192.66) ms191.43 ± (190.47 - 192.38) ms-0.2%
process.time_to_main_ms492.11 ± (491.10 - 493.13) ms485.11 ± (484.03 - 486.19) ms-1.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.97 ± (38.93 - 39.01) MB38.78 ± (38.74 - 38.82) MB-0.5%
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.0%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration192.05 ± (191.97 - 192.89) ms191.45 ± (191.31 - 192.05) ms-0.3%
.NET Framework 4.8 - Bailout
duration195.26 ± (195.04 - 195.57) ms195.44 ± (195.42 - 196.08) ms+0.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1163.36 ± (1164.37 - 1172.84) ms1167.14 ± (1169.98 - 1178.21) ms+0.3%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms189.26 ± (188.81 - 189.70) ms188.20 ± (187.92 - 188.47) ms-0.6%
process.time_to_main_ms81.34 ± (81.06 - 81.62) ms80.36 ± (80.17 - 80.54) ms-1.2%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.05 ± (16.02 - 16.08) MB16.13 ± (16.10 - 16.16) MB+0.5%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (19 - 20)+0.3%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms187.33 ± (187.01 - 187.65) ms188.18 ± (187.84 - 188.51) ms+0.5%✅⬆️
process.time_to_main_ms81.96 ± (81.84 - 82.07) ms82.04 ± (81.87 - 82.21) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.12 ± (16.09 - 16.15) MB16.17 ± (16.14 - 16.20) MB+0.3%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.4%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms394.95 ± (392.64 - 397.26) ms401.69 ± (398.64 - 404.74) ms+1.7%✅⬆️
process.time_to_main_ms518.95 ± (518.27 - 519.62) ms519.88 ± (518.96 - 520.79) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed63.05 ± (62.89 - 63.21) MB62.95 ± (62.81 - 63.10) MB-0.2%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.0%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms192.46 ± (192.07 - 192.84) ms191.53 ± (191.16 - 191.91) ms-0.5%
process.time_to_main_ms70.02 ± (69.83 - 70.22) ms69.62 ± (69.48 - 69.76) ms-0.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.34 ± (16.31 - 16.37) MB16.24 ± (16.13 - 16.34) MB-0.6%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-2.3%
.NET 6 - Bailout
process.internal_duration_ms191.03 ± (190.75 - 191.31) ms191.00 ± (190.65 - 191.36) ms-0.0%
process.time_to_main_ms70.89 ± (70.77 - 71.00) ms70.68 ± (70.57 - 70.78) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.00 - 16.29) MB15.93 ± (15.76 - 16.10) MB-1.3%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.9%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms411.77 ± (408.71 - 414.83) ms411.94 ± (408.75 - 415.14) ms+0.0%✅⬆️
process.time_to_main_ms487.60 ± (487.05 - 488.14) ms482.03 ± (481.39 - 482.67) ms-1.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.16 ± (62.02 - 62.30) MB62.06 ± (61.91 - 62.21) MB-0.2%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 30)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms190.46 ± (190.15 - 190.76) ms189.24 ± (188.97 - 189.50) ms-0.6%
process.time_to_main_ms69.42 ± (69.28 - 69.56) ms68.95 ± (68.77 - 69.13) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.72 ± (11.69 - 11.75) MB11.77 ± (11.75 - 11.80) MB+0.5%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.4%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms189.46 ± (189.21 - 189.70) ms188.76 ± (188.48 - 189.03) ms-0.4%
process.time_to_main_ms70.39 ± (70.29 - 70.49) ms69.95 ± (69.86 - 70.03) ms-0.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.79 ± (11.76 - 11.83) MB11.84 ± (11.81 - 11.88) MB+0.4%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.1%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms361.79 ± (360.17 - 363.40) ms360.99 ± (359.34 - 362.64) ms-0.2%
process.time_to_main_ms463.84 ± (463.38 - 464.29) ms458.07 ± (457.49 - 458.65) ms-1.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.44 ± (50.40 - 50.49) MB50.33 ± (50.30 - 50.36) MB-0.2%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.1%✅⬆️
Comparison explanation

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

Duration charts
FakeDbCommand (.NET Framework 4.8)
gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7715) - mean (76ms)  : 72, 81
    master - mean (76ms)  : 71, 81

    section Bailout
    This PR (7715) - mean (81ms)  : 77, 86
    master - mean (80ms)  : 75, 85

    section CallTarget+Inlining+NGEN
    This PR (7715) - mean (1,126ms)  : 1064, 1189
    master - mean (1,117ms)  : 1038, 1196

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 (7715) - mean (118ms)  : 112, 125
    master - mean (118ms)  : 110, 125

    section Bailout
    This PR (7715) - mean (121ms)  : 114, 127
    master - mean (118ms)  : 111, 125

    section CallTarget+Inlining+NGEN
    This PR (7715) - mean (814ms)  : 775, 852
    master - mean (800ms)  : 758, 841

FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7715) - mean (103ms)  : 94, 112
    master - mean (104ms)  : 97, 111

    section Bailout
    This PR (7715) - mean (107ms)  : 102, 112
    master - mean (107ms)  : 100, 114

    section CallTarget+Inlining+NGEN
    This PR (7715) - mean (751ms)  : 706, 796
    master - mean (754ms)  : 711, 797

FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7715) - mean (103ms)  : 97, 109
    master - mean (104ms)  : 98, 110

    section Bailout
    This PR (7715) - mean (105ms)  : 98, 111
    master - mean (104ms)  : 99, 109

    section CallTarget+Inlining+NGEN
    This PR (7715) - mean (711ms)  : 673, 750
    master - mean (715ms)  : 689, 740

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 (7715) - mean (192ms)  : 188, 195
    master - mean (192ms)  : 188, 197

    section Bailout
    This PR (7715) - mean (196ms)  : 193, 199
    master - mean (195ms)  : 193, 198

    section CallTarget+Inlining+NGEN
    This PR (7715) - mean (1,174ms)  : 1115, 1233
    master - mean (1,169ms)  : 1105, 1232

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 (7715) - mean (277ms)  : 273, 281
    master - mean (279ms)  : 274, 284

    section Bailout
    This PR (7715) - mean (278ms)  : 274, 283
    master - mean (277ms)  : 273, 281

    section CallTarget+Inlining+NGEN
    This PR (7715) - mean (957ms)  : 891, 1022
    master - mean (947ms)  : 911, 984

HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7715) - mean (269ms)  : 264, 274
    master - mean (271ms)  : 266, 275

    section Bailout
    This PR (7715) - mean (270ms)  : 266, 273
    master - mean (270ms)  : 265, 274

    section CallTarget+Inlining+NGEN
    This PR (7715) - mean (925ms)  : 877, 973
    master - mean (931ms)  : 882, 979

HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7715) - mean (268ms)  : 264, 272
    master - mean (270ms)  : 265, 274

    section Bailout
    This PR (7715) - mean (268ms)  : 265, 271
    master - mean (269ms)  : 265, 274

    section CallTarget+Inlining+NGEN
    This PR (7715) - mean (851ms)  : 831, 871
    master - mean (857ms)  : 836, 879

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 48 Tests failed

CheckProcessTagsContentFormat from Datadog.Profiler.IntegrationTests.ProcessTags.ProcessTagsTest (Datadog) (Fix with Cursor)
Assert.NotEmpty() Failure
CheckProcessTagsContentFormat from Datadog.Profiler.IntegrationTests.ProcessTags.ProcessTagsTest (Datadog) (Fix with Cursor)
Assert.NotEmpty() Failure
CheckProcessTagsContentFormat from Datadog.Profiler.IntegrationTests.ProcessTags.ProcessTagsTest (Datadog) (Fix with Cursor)
Assert.NotEmpty() Failure
View all

ℹ️ Info

❄️ No new flaky tests detected

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

putting it back in draft because I just saw with Gregory that we need to put the tag in a dedicated field that requires a change in libdatadog, an issue that java and go didn't have.

vandonr avatar Nov 20 '25 15:11 vandonr