Skip to content

Add process tags to runtime metrics & dynamic instrumentation metric probes#7871

Merged
lucaspimentel merged 12 commits intomasterfrom
vandonr/process
Jan 23, 2026
Merged

Add process tags to runtime metrics & dynamic instrumentation metric probes#7871
lucaspimentel merged 12 commits intomasterfrom
vandonr/process

Conversation

@vandonr
Copy link
Contributor

@vandonr vandonr commented Nov 26, 2025

Summary of changes

add process tags as constant tags for both runtime metrics and the metrics sent by dynamic instrumentation probes

Reason for change

AIDM-195

Implementation details

Test coverage

Will append existing integration tests

Other details

… probes

# Conflicts:
#	tracer/src/Datadog.Trace/Debugger/DebuggerFactory.cs
#	tracer/src/Datadog.Trace/TracerManagerFactory.cs
@dd-trace-dotnet-ci-bot
Copy link

dd-trace-dotnet-ci-bot bot commented Jan 8, 2026

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7871) 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
duration68.21 ± (68.20 - 68.40) ms68.58 ± (68.58 - 68.85) ms+0.6%✅⬆️
.NET Framework 4.8 - Bailout
duration72.30 ± (72.22 - 72.46) ms72.58 ± (72.44 - 72.72) ms+0.4%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration999.91 ± (1005.41 - 1013.66) ms1007.50 ± (1011.04 - 1019.68) ms+0.8%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms21.81 ± (21.77 - 21.84) ms21.93 ± (21.89 - 21.97) ms+0.6%✅⬆️
process.time_to_main_ms78.95 ± (78.80 - 79.09) ms78.87 ± (78.72 - 79.02) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.88 ± (10.88 - 10.89) MB10.90 ± (10.90 - 10.91) MB+0.2%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.73 ± (21.71 - 21.75) ms21.85 ± (21.82 - 21.87) ms+0.5%✅⬆️
process.time_to_main_ms80.15 ± (80.07 - 80.23) ms80.09 ± (80.00 - 80.19) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.92 ± (10.91 - 10.92) MB10.94 ± (10.93 - 10.94) MB+0.2%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms242.35 ± (238.76 - 245.94) ms242.69 ± (239.17 - 246.20) ms+0.1%✅⬆️
process.time_to_main_ms469.08 ± (468.48 - 469.68) ms471.18 ± (470.59 - 471.78) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.32 ± (48.29 - 48.34) MB48.32 ± (48.29 - 48.34) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.7%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms20.64 ± (20.61 - 20.67) ms20.68 ± (20.64 - 20.71) ms+0.2%✅⬆️
process.time_to_main_ms68.35 ± (68.25 - 68.45) ms68.60 ± (68.46 - 68.73) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.59 ± (10.59 - 10.60) MB10.63 ± (10.62 - 10.63) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.55 ± (20.53 - 20.57) ms20.57 ± (20.56 - 20.59) ms+0.1%✅⬆️
process.time_to_main_ms69.40 ± (69.35 - 69.44) ms69.49 ± (69.43 - 69.54) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.70 ± (10.69 - 10.71) MB10.73 ± (10.73 - 10.73) MB+0.3%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms245.14 ± (243.01 - 247.26) ms247.79 ± (245.65 - 249.94) ms+1.1%✅⬆️
process.time_to_main_ms446.94 ± (446.42 - 447.47) ms448.76 ± (448.25 - 449.28) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.12 ± (49.09 - 49.15) MB49.13 ± (49.11 - 49.16) MB+0.0%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 8 - Baseline
process.internal_duration_ms18.81 ± (18.78 - 18.85) ms18.85 ± (18.82 - 18.88) ms+0.2%✅⬆️
process.time_to_main_ms67.40 ± (67.30 - 67.50) ms67.74 ± (67.62 - 67.86) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.65 - 7.67) MB7.66 ± (7.65 - 7.66) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.85 ± (18.82 - 18.87) ms18.90 ± (18.87 - 18.93) ms+0.3%✅⬆️
process.time_to_main_ms68.49 ± (68.43 - 68.55) ms68.85 ± (68.78 - 68.91) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.74 ± (7.73 - 7.76) MB7.71 ± (7.70 - 7.71) MB-0.4%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms178.72 ± (177.91 - 179.52) ms178.14 ± (177.23 - 179.05) ms-0.3%
process.time_to_main_ms429.67 ± (428.89 - 430.45) ms431.96 ± (431.24 - 432.68) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.55 ± (36.51 - 36.59) MB36.55 ± (36.52 - 36.57) MB-0.0%
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
duration195.39 ± (195.42 - 196.49) ms195.76 ± (195.86 - 196.76) ms+0.2%✅⬆️
.NET Framework 4.8 - Bailout
duration197.59 ± (197.61 - 198.21) ms201.54 ± (201.54 - 202.64) ms+2.0%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1120.43 ± (1125.44 - 1134.45) ms1131.27 ± (1132.57 - 1142.16) ms+1.0%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms190.18 ± (189.78 - 190.58) ms188.50 ± (188.10 - 188.91) ms-0.9%
process.time_to_main_ms82.31 ± (82.07 - 82.54) ms81.95 ± (81.72 - 82.19) ms-0.4%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.11 ± (16.08 - 16.13) MB16.12 ± (16.10 - 16.14) MB+0.1%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (19 - 20)-0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms188.34 ± (187.92 - 188.76) ms189.04 ± (188.62 - 189.47) ms+0.4%✅⬆️
process.time_to_main_ms83.11 ± (82.95 - 83.28) ms83.27 ± (83.09 - 83.44) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.10 ± (16.07 - 16.13) MB16.10 ± (16.08 - 16.13) MB+0.0%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms421.31 ± (417.81 - 424.81) ms430.03 ± (426.16 - 433.89) ms+2.1%✅⬆️
process.time_to_main_ms473.98 ± (473.35 - 474.61) ms474.30 ± (473.68 - 474.92) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.79 ± (58.67 - 58.90) MB58.64 ± (58.50 - 58.79) MB-0.2%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.1%
.NET 6 - Baseline
process.internal_duration_ms192.79 ± (192.41 - 193.17) ms192.44 ± (192.11 - 192.77) ms-0.2%
process.time_to_main_ms70.41 ± (70.23 - 70.59) ms70.78 ± (70.56 - 71.01) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.18 ± (16.07 - 16.29) MB16.34 ± (16.28 - 16.40) MB+1.0%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.6%
.NET 6 - Bailout
process.internal_duration_ms192.19 ± (191.83 - 192.54) ms192.38 ± (192.03 - 192.72) ms+0.1%✅⬆️
process.time_to_main_ms71.60 ± (71.46 - 71.73) ms71.50 ± (71.35 - 71.65) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.26 ± (16.14 - 16.38) MB16.36 ± (16.27 - 16.46) MB+0.6%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.2%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms444.71 ± (441.37 - 448.04) ms448.06 ± (445.00 - 451.13) ms+0.8%✅⬆️
process.time_to_main_ms453.10 ± (452.55 - 453.64) ms452.74 ± (452.25 - 453.23) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.75 ± (58.63 - 58.87) MB58.82 ± (58.70 - 58.94) MB+0.1%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
.NET 8 - Baseline
process.internal_duration_ms192.13 ± (191.74 - 192.52) ms192.10 ± (191.67 - 192.53) ms-0.0%
process.time_to_main_ms70.58 ± (70.35 - 70.81) ms70.78 ± (70.57 - 70.99) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.77 ± (11.75 - 11.79) MB11.78 ± (11.75 - 11.80) MB+0.1%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.2%
.NET 8 - Bailout
process.internal_duration_ms190.74 ± (190.36 - 191.13) ms191.71 ± (191.19 - 192.24) ms+0.5%✅⬆️
process.time_to_main_ms71.19 ± (71.05 - 71.34) ms71.75 ± (71.56 - 71.93) ms+0.8%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.83 ± (11.80 - 11.86) MB11.82 ± (11.79 - 11.84) MB-0.1%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+0.4%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms368.37 ± (366.83 - 369.91) ms370.41 ± (369.11 - 371.71) ms+0.6%✅⬆️
process.time_to_main_ms438.22 ± (437.56 - 438.87) ms437.83 ± (437.13 - 438.53) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed48.25 ± (48.21 - 48.28) MB48.23 ± (48.19 - 48.26) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 29)28 ± (28 - 28)-0.2%
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 (7871) - mean (69ms)  : 67, 71
    master - mean (68ms)  : 67, 70

    section Bailout
    This PR (7871) - mean (73ms)  : 71, 74
    master - mean (72ms)  : 71, 73

    section CallTarget+Inlining+NGEN
    This PR (7871) - mean (1,015ms)  : 953, 1078
    master - mean (1,010ms)  : 950, 1069

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 (7871) - mean (106ms)  : 104, 109
    master - mean (106ms)  : 104, 109

    section Bailout
    This PR (7871) - mean (107ms)  : 106, 108
    master - mean (107ms)  : 106, 108

    section CallTarget+Inlining+NGEN
    This PR (7871) - mean (738ms)  : 680, 795
    master - mean (738ms)  : 679, 797

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7871) - mean (94ms)  : 92, 96
    master - mean (94ms)  : 91, 96

    section Bailout
    This PR (7871) - mean (95ms)  : 94, 96
    master - mean (95ms)  : 94, 96

    section CallTarget+Inlining+NGEN
    This PR (7871) - mean (721ms)  : 690, 753
    master - mean (718ms)  : 684, 753

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7871) - mean (93ms)  : 90, 95
    master - mean (92ms)  : 90, 94

    section Bailout
    This PR (7871) - mean (94ms)  : 93, 95
    master - mean (93ms)  : 92, 95

    section CallTarget+Inlining+NGEN
    This PR (7871) - mean (639ms)  : 622, 655
    master - mean (637ms)  : 621, 652

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 (7871) - mean (196ms)  : 190, 203
    master - mean (196ms)  : 189, 203

    section Bailout
    This PR (7871) - mean (202ms)  : 194, 210
    master - mean (198ms)  : 195, 201

    section CallTarget+Inlining+NGEN
    This PR (7871) - mean (1,137ms)  : 1066, 1209
    master - mean (1,130ms)  : 1065, 1195

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 (7871) - mean (279ms)  : 273, 285
    master - mean (281ms)  : 274, 288

    section Bailout
    This PR (7871) - mean (280ms)  : 275, 286
    master - mean (280ms)  : 275, 286

    section CallTarget+Inlining+NGEN
    This PR (7871) - mean (936ms)  : 891, 981
    master - mean (928ms)  : 881, 975

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7871) - mean (272ms)  : 267, 276
    master - mean (272ms)  : 266, 277

    section Bailout
    This PR (7871) - mean (272ms)  : 267, 278
    master - mean (272ms)  : 268, 276

    section CallTarget+Inlining+NGEN
    This PR (7871) - mean (930ms)  : 883, 977
    master - mean (928ms)  : 877, 978

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7871) - mean (273ms)  : 265, 281
    master - mean (272ms)  : 266, 279

    section Bailout
    This PR (7871) - mean (274ms)  : 266, 282
    master - mean (272ms)  : 266, 278

    section CallTarget+Inlining+NGEN
    This PR (7871) - mean (839ms)  : 824, 855
    master - mean (838ms)  : 816, 860

Loading

@vandonr vandonr marked this pull request as ready for review January 12, 2026 14:02
@vandonr vandonr requested review from a team as code owners January 12, 2026 14:02
@datadog-official

This comment has been minimized.


// two views on the same data
public static readonly List<string> TagsList = GetTagsList();
public static readonly ReadOnlyCollection<string> TagsList = GetTagsList().AsReadOnly();
Copy link
Member

@lucaspimentel lucaspimentel Jan 23, 2026

Choose a reason for hiding this comment

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

(I was going to leave comments in all the other places you used [] to change them to Array.Empty<string>() like in DebuggerFactory, but instead...)

I tried a few things to make it easier to avoid the heap allocation with the [] initializer. Turns out if you change this type to IReadOnlyCollection<string> then [] will use Array.Empty<string>() (since it's guaranteed that the collection won't be mutated).

If you do that, you also don't need AsReadOnly() here because List<T> implements IReadOnlyCollection<T>, avoiding another allocation for the ReadOnlyCollection<T>. And you can change that Array.Empty<string>() in DebuggerFactory back to [] the way you had it originally and keep all the other [] 😅

You'll also have to change IList<string> to IReadOnlyCollection<T> in a few other places to fix compiler errors. I'll leave suggestions for you.

Suggested change
public static readonly ReadOnlyCollection<string> TagsList = GetTagsList().AsReadOnly();
public static readonly IReadOnlyCollection<string> TagsList = GetTagsList();

Copy link
Member

Choose a reason for hiding this comment

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

Done in 51ae1df.

@lucaspimentel lucaspimentel enabled auto-merge (squash) January 23, 2026 16:48
@lucaspimentel lucaspimentel merged commit 993aaba into master Jan 23, 2026
152 of 154 checks passed
@lucaspimentel lucaspimentel deleted the vandonr/process branch January 23, 2026 20:12
@github-actions github-actions bot added this to the vNext-v3 milestone Jan 23, 2026
@vandonr vandonr mentioned this pull request Jan 26, 2026
NachoEchevarria pushed a commit that referenced this pull request Jan 26, 2026
## Summary of changes

signature changed in #7871, and since the benchmark CI step was broken
for another reason, I missed that.

## Reason for change

## Implementation details

## Test coverage

## Other details
<!-- Fixes #{issue} -->


<!--  ⚠️ Note:

Where possible, please obtain 2 approvals prior to merging. Unless
CODEOWNERS specifies otherwise, for external teams it is typically best
to have one review from a team member, and one review from apm-dotnet.
Trivial changes do not require 2 reviews.

MergeQueue is NOT enabled in this repository. If you have write access
to the repo, the PR has 1-2 approvals (see above), and all of the
required checks have passed, you can use the Squash and Merge button to
merge the PR. If you don't have write access, or you need help, reach
out in the #apm-dotnet channel in Slack.
-->
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