Skip to content

Conversation

@vandonr
Copy link
Contributor

@vandonr vandonr commented Nov 18, 2025

Summary of changes

add a process tags field next to where the service name is added in the snapshot json.

dotnet version of DataDog/dd-trace-java#8779

Reason for change

AIDM-195

Implementation details

I wanted to inject the setting from

internal static DynamicInstrumentation CreateDynamicInstrumentation(IDiscoveryService discoveryService, IRcmSubscriptionManager remoteConfigurationManager, TracerSettings tracerSettings, string serviceName, DebuggerSettings debuggerSettings, IGitMetadataTagsProvider gitMetadataTagsProvider)
but looking at the call chain to bring it to the snapshot creator, it was quite tedious and messy.
Another option was to put it in the debugger settings, but it felt out of place as those settings are specific to the live debugger, not a repeat of global tracer settings.
In the end I decided to inject a little bit so that I could specify the value in tests.

Test coverage

just made sure the test that checks json correctness includes this

Other details

@vandonr vandonr requested a review from a team as a code owner November 18, 2025 13:29
@vandonr vandonr changed the title Add process tags to dynamic instrumentatoin snapshots Add process tags to dynamic instrumentation snapshots Nov 18, 2025
@datadog-datadog-prod-us1

This comment has been minimized.

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

dd-trace-dotnet-ci-bot bot commented Nov 18, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7839) 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.84 ± (75.81 - 76.76) ms75.42 ± (75.16 - 75.95) ms-0.6%
.NET Framework 4.8 - Bailout
duration80.78 ± (80.30 - 81.27) ms79.45 ± (79.26 - 80.09) ms-1.6%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1122.35 ± (1126.60 - 1138.25) ms1121.47 ± (1123.40 - 1134.36) ms-0.1%
.NET Core 3.1 - Baseline
process.internal_duration_ms23.14 ± (23.06 - 23.23) ms23.32 ± (23.23 - 23.41) ms+0.8%✅⬆️
process.time_to_main_ms88.11 ± (87.67 - 88.55) ms88.40 ± (88.02 - 88.79) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.92 - 10.93) MB10.92 ± (10.92 - 10.93) MB-0.0%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.94 ± (22.88 - 23.01) ms23.01 ± (22.92 - 23.09) ms+0.3%✅⬆️
process.time_to_main_ms88.95 ± (88.56 - 89.35) ms89.93 ± (89.60 - 90.26) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.96 ± (10.96 - 10.96) MB10.95 ± (10.95 - 10.96) MB-0.1%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms220.66 ± (219.27 - 222.06) ms219.68 ± (218.37 - 220.98) ms-0.4%
process.time_to_main_ms550.40 ± (549.26 - 551.53) ms546.79 ± (545.66 - 547.91) ms-0.7%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.50 ± (52.48 - 52.51) MB52.56 ± (52.54 - 52.58) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.4%
.NET 6 - Baseline
process.internal_duration_ms21.98 ± (21.90 - 22.07) ms21.92 ± (21.84 - 21.99) ms-0.3%
process.time_to_main_ms77.23 ± (76.86 - 77.60) ms77.59 ± (77.21 - 77.98) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.61 ± (10.61 - 10.61) MB10.63 ± (10.63 - 10.63) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.77 ± (21.69 - 21.85) ms21.73 ± (21.67 - 21.78) ms-0.2%
process.time_to_main_ms78.10 ± (77.70 - 78.49) ms77.97 ± (77.65 - 78.30) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.67 ± (10.66 - 10.67) MB10.66 ± (10.66 - 10.66) MB-0.1%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms208.41 ± (207.06 - 209.76) ms208.81 ± (207.35 - 210.26) ms+0.2%✅⬆️
process.time_to_main_ms516.76 ± (515.57 - 517.96) ms520.25 ± (519.17 - 521.33) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.70 ± (51.67 - 51.73) MB51.78 ± (51.75 - 51.81) MB+0.2%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 8 - Baseline
process.internal_duration_ms20.03 ± (19.96 - 20.10) ms20.06 ± (19.99 - 20.13) ms+0.1%✅⬆️
process.time_to_main_ms75.97 ± (75.59 - 76.36) ms76.07 ± (75.71 - 76.42) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.65 - 7.66) MB7.67 ± (7.66 - 7.68) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.90 ± (19.83 - 19.97) ms19.96 ± (19.90 - 20.03) ms+0.3%✅⬆️
process.time_to_main_ms76.58 ± (76.24 - 76.92) ms77.15 ± (76.85 - 77.44) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.69 ± (7.69 - 7.69) MB7.72 ± (7.72 - 7.73) MB+0.4%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms192.68 ± (191.76 - 193.60) ms193.10 ± (192.26 - 193.94) ms+0.2%✅⬆️
process.time_to_main_ms495.96 ± (494.97 - 496.96) ms491.34 ± (490.24 - 492.44) ms-0.9%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.85 ± (38.81 - 38.89) MB38.98 ± (38.94 - 39.02) MB+0.3%✅⬆️
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
duration194.73 ± (194.67 - 195.55) ms194.70 ± (194.21 - 195.04) ms-0.0%
.NET Framework 4.8 - Bailout
duration197.63 ± (197.58 - 198.06) ms197.33 ± (197.19 - 198.08) ms-0.2%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1165.15 ± (1167.77 - 1176.25) ms1179.62 ± (1183.05 - 1194.41) ms+1.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms189.60 ± (189.26 - 189.94) ms188.73 ± (188.34 - 189.12) ms-0.5%
process.time_to_main_ms81.44 ± (81.20 - 81.68) ms81.08 ± (80.83 - 81.32) ms-0.4%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.15 ± (16.13 - 16.18) MB16.14 ± (16.11 - 16.17) MB-0.1%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.4%
.NET Core 3.1 - Bailout
process.internal_duration_ms189.48 ± (189.14 - 189.82) ms188.40 ± (188.10 - 188.71) ms-0.6%
process.time_to_main_ms82.97 ± (82.77 - 83.17) ms81.79 ± (81.66 - 81.91) ms-1.4%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.19 ± (16.16 - 16.21) MB16.18 ± (16.15 - 16.21) MB-0.0%
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (21 - 21)+0.6%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms393.49 ± (391.39 - 395.58) ms393.60 ± (391.00 - 396.20) ms+0.0%✅⬆️
process.time_to_main_ms522.49 ± (521.86 - 523.12) ms519.89 ± (519.21 - 520.57) ms-0.5%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed63.25 ± (63.11 - 63.39) MB62.69 ± (62.53 - 62.85) MB-0.9%
runtime.dotnet.threads.count29 ± (29 - 30)29 ± (29 - 29)-0.1%
.NET 6 - Baseline
process.internal_duration_ms193.29 ± (192.91 - 193.66) ms195.27 ± (194.81 - 195.74) ms+1.0%✅⬆️
process.time_to_main_ms70.52 ± (70.30 - 70.74) ms70.97 ± (70.78 - 71.17) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.15 ± (16.03 - 16.27) MB16.33 ± (16.30 - 16.36) MB+1.1%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+2.2%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms193.20 ± (192.90 - 193.50) ms191.84 ± (191.48 - 192.21) ms-0.7%
process.time_to_main_ms71.48 ± (71.37 - 71.59) ms71.02 ± (70.92 - 71.13) ms-0.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.30 ± (16.19 - 16.41) MB16.16 ± (16.02 - 16.30) MB-0.9%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.9%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms418.81 ± (415.57 - 422.05) ms413.95 ± (410.64 - 417.26) ms-1.2%
process.time_to_main_ms490.03 ± (489.39 - 490.67) ms492.72 ± (491.95 - 493.49) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.32 ± (62.20 - 62.45) MB62.29 ± (62.15 - 62.43) MB-0.0%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms190.24 ± (189.87 - 190.61) ms190.52 ± (190.19 - 190.85) ms+0.1%✅⬆️
process.time_to_main_ms69.31 ± (69.13 - 69.48) ms69.38 ± (69.18 - 69.57) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.75 ± (11.73 - 11.78) MB11.77 ± (11.74 - 11.80) MB+0.1%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.1%
.NET 8 - Bailout
process.internal_duration_ms189.31 ± (189.08 - 189.55) ms192.31 ± (191.84 - 192.78) ms+1.6%✅⬆️
process.time_to_main_ms70.19 ± (70.08 - 70.31) ms71.01 ± (70.83 - 71.20) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.79 ± (11.73 - 11.85) MB11.73 ± (11.71 - 11.76) MB-0.5%
runtime.dotnet.threads.count19 ± (18 - 19)19 ± (19 - 19)+2.7%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms361.99 ± (360.41 - 363.56) ms365.30 ± (363.85 - 366.75) ms+0.9%✅⬆️
process.time_to_main_ms465.70 ± (465.04 - 466.37) ms464.53 ± (463.68 - 465.38) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.26 ± (50.22 - 50.30) MB50.42 ± (50.38 - 50.45) MB+0.3%✅⬆️
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 (7839) - mean (76ms)  : 70, 82
    master - mean (76ms)  : 69, 84

    section Bailout
    This PR (7839) - mean (80ms)  : 73, 86
    master - mean (81ms)  : 73, 88

    section CallTarget+Inlining+NGEN
    This PR (7839) - mean (1,129ms)  : 1051, 1207
    master - mean (1,132ms)  : 1047, 1218

Loading
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 (7839) - mean (120ms)  : 111, 128
    master - mean (119ms)  : 110, 127

    section Bailout
    This PR (7839) - mean (121ms)  : 115, 127
    master - mean (120ms)  : 112, 128

    section CallTarget+Inlining+NGEN
    This PR (7839) - mean (804ms)  : 762, 845
    master - mean (812ms)  : 776, 848

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7839) - mean (107ms)  : 99, 114
    master - mean (106ms)  : 99, 114

    section Bailout
    This PR (7839) - mean (107ms)  : 101, 112
    master - mean (107ms)  : 100, 115

    section CallTarget+Inlining+NGEN
    This PR (7839) - mean (762ms)  : 714, 811
    master - mean (758ms)  : 716, 800

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7839) - mean (105ms)  : 99, 111
    master - mean (105ms)  : 96, 113

    section Bailout
    This PR (7839) - mean (106ms)  : 100, 111
    master - mean (105ms)  : 99, 112

    section CallTarget+Inlining+NGEN
    This PR (7839) - mean (723ms)  : 695, 751
    master - mean (727ms)  : 699, 756

Loading
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 (7839) - mean (195ms)  : 191, 199
    master - mean (195ms)  : 190, 200

    section Bailout
    This PR (7839) - mean (198ms)  : 193, 203
    master - mean (198ms)  : 195, 200

    section CallTarget+Inlining+NGEN
    This PR (7839) - mean (1,189ms)  : 1100, 1278
    master - mean (1,172ms)  : 1112, 1232

Loading
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 (7839) - mean (278ms)  : 272, 284
    master - mean (280ms)  : 275, 285

    section Bailout
    This PR (7839) - mean (278ms)  : 275, 282
    master - mean (281ms)  : 275, 287

    section CallTarget+Inlining+NGEN
    This PR (7839) - mean (945ms)  : 899, 990
    master - mean (947ms)  : 901, 993

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7839) - mean (275ms)  : 264, 285
    master - mean (272ms)  : 267, 278

    section Bailout
    This PR (7839) - mean (271ms)  : 267, 275
    master - mean (273ms)  : 269, 276

    section CallTarget+Inlining+NGEN
    This PR (7839) - mean (937ms)  : 888, 986
    master - mean (938ms)  : 889, 987

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

    section Bailout
    This PR (7839) - mean (273ms)  : 266, 279
    master - mean (269ms)  : 266, 272

    section CallTarget+Inlining+NGEN
    This PR (7839) - mean (862ms)  : 840, 885
    master - mean (859ms)  : 831, 886

Loading

Copy link
Contributor

@GreenMatan GreenMatan left a comment

Choose a reason for hiding this comment

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

LGTM

@vandonr vandonr merged commit 3f1d126 into master Nov 20, 2025
156 checks passed
@vandonr vandonr deleted the vandonr/process branch November 20, 2025 20:27
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants