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

[FFE] Feature Flags SDK

Open daniel-romano-DD opened this issue 1 month ago • 3 comments

Summary of changes

Add support for Feature Flag configuration frameworks

Reason for change

Spec document can be found here

Implementation details

Retrieved FF config from backend through Remote Config. Enable SDK functions. Supplied OpenFeature provider implementation

Test coverage

Added unit and integration tests

Other details

daniel-romano-DD avatar Dec 03 '25 12:12 daniel-romano-DD

Benchmarks

Benchmark execution time: 2025-12-24 12:41:45

Comparing candidate commit 58f1c811 in PR branch dani/apm/feature_flags with baseline commit 1d8371f0 in branch master.

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

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0

  • 🟩 throughput [+5276.786op/s; +8243.684op/s] or [+5.887%; +9.197%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟥 execution_time [+90.625ms; +90.844ms] or [+82.705%; +82.905%]

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

  • 🟩 execution_time [-19.041ms; -18.442ms] or [-9.510%; -9.211%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1

  • 🟥 throughput [-330.184op/s; -136.971op/s] or [-14.518%; -6.023%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+43.803ms; +48.954ms] or [+22.290%; +24.911%]
  • 🟥 throughput [-97.934op/s; -73.504op/s] or [-8.591%; -6.448%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces netcoreapp3.1

  • 🟩 execution_time [-61.477ms; -56.979ms] or [-30.310%; -28.093%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch netcoreapp3.1

  • 🟩 execution_time [-17.438ms; -13.305ms] or [-8.202%; -6.258%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark netcoreapp3.1

  • 🟥 throughput [-439.319op/s; -222.370op/s] or [-20.194%; -10.222%]

scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net6.0

  • 🟥 execution_time [+11.663ms; +15.586ms] or [+5.863%; +7.835%]

pr-commenter[bot] avatar Dec 03 '25 13:12 pr-commenter[bot]

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

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

datadog-official[bot] avatar Dec 15 '25 13:12 datadog-official[bot]

Execution-Time Benchmarks Report :stopwatch:

Execution-time results for samples comparing This PR (7896) 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.23 ± (68.20 - 68.44) ms68.40 ± (68.38 - 68.56) ms+0.3%✅⬆️
.NET Framework 4.8 - Bailout
duration72.38 ± (72.26 - 72.54) ms72.18 ± (72.09 - 72.27) ms-0.3%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1001.64 ± (1003.93 - 1009.10) ms1001.42 ± (1002.96 - 1008.60) ms-0.0%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.01 ± (21.97 - 22.04) ms22.08 ± (22.04 - 22.12) ms+0.3%✅⬆️
process.time_to_main_ms78.84 ± (78.70 - 78.97) ms78.92 ± (78.75 - 79.09) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.93 ± (10.92 - 10.93) MB10.94 ± (10.94 - 10.95) MB+0.2%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms21.93 ± (21.90 - 21.95) ms21.82 ± (21.80 - 21.84) ms-0.5%
process.time_to_main_ms79.91 ± (79.81 - 80.00) ms79.80 ± (79.72 - 79.89) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.95 - 10.96) MB10.96 ± (10.96 - 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_ms210.26 ± (208.77 - 211.74) ms211.83 ± (209.99 - 213.67) ms+0.7%✅⬆️
process.time_to_main_ms472.69 ± (471.84 - 473.54) ms472.55 ± (472.03 - 473.08) ms-0.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.12 ± (48.10 - 48.14) MB48.14 ± (48.12 - 48.16) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%
.NET 6 - Baseline
process.internal_duration_ms20.61 ± (20.59 - 20.63) ms20.63 ± (20.60 - 20.65) ms+0.1%✅⬆️
process.time_to_main_ms68.15 ± (68.03 - 68.28) ms68.13 ± (68.03 - 68.23) ms-0.0%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.60 ± (10.60 - 10.61) MB10.64 ± (10.64 - 10.65) MB+0.4%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.54 ± (20.51 - 20.57) ms20.54 ± (20.51 - 20.56) ms-0.0%
process.time_to_main_ms69.03 ± (68.95 - 69.10) ms69.04 ± (68.98 - 69.10) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.74 ± (10.73 - 10.74) MB10.69 ± (10.68 - 10.69) MB-0.4%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms200.40 ± (199.26 - 201.55) ms199.65 ± (198.60 - 200.71) ms-0.4%
process.time_to_main_ms441.40 ± (440.82 - 441.98) ms439.38 ± (438.78 - 439.98) ms-0.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.28 ± (48.21 - 48.35) MB48.27 ± (48.21 - 48.34) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms18.82 ± (18.79 - 18.84) ms18.87 ± (18.85 - 18.90) ms+0.3%✅⬆️
process.time_to_main_ms67.26 ± (67.15 - 67.37) ms67.23 ± (67.13 - 67.32) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.66 ± (7.66 - 7.67) MB7.68 ± (7.68 - 7.69) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms18.84 ± (18.82 - 18.87) ms18.81 ± (18.78 - 18.83) ms-0.2%
process.time_to_main_ms68.39 ± (68.34 - 68.44) ms68.28 ± (68.22 - 68.33) ms-0.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.71 ± (7.71 - 7.72) MB7.75 ± (7.74 - 7.76) MB+0.5%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms178.62 ± (177.79 - 179.46) ms179.32 ± (178.50 - 180.14) ms+0.4%✅⬆️
process.time_to_main_ms423.38 ± (422.92 - 423.84) ms426.02 ± (425.48 - 426.56) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.24 ± (36.21 - 36.27) MB36.38 ± (36.35 - 36.41) MB+0.4%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)+0.4%✅⬆️

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration193.97 ± (193.77 - 194.66) ms192.80 ± (192.60 - 193.48) ms-0.6%
.NET Framework 4.8 - Bailout
duration197.04 ± (196.97 - 197.62) ms197.30 ± (197.04 - 197.72) ms+0.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1106.81 ± (1106.01 - 1111.40) ms1114.38 ± (1116.91 - 1126.32) ms+0.7%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms188.04 ± (187.65 - 188.42) ms187.72 ± (187.36 - 188.09) ms-0.2%
process.time_to_main_ms81.11 ± (80.85 - 81.36) ms80.67 ± (80.42 - 80.92) ms-0.5%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.08 ± (16.05 - 16.11) MB16.13 ± (16.10 - 16.16) MB+0.3%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.8%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms187.40 ± (187.11 - 187.69) ms187.66 ± (187.37 - 187.96) ms+0.1%✅⬆️
process.time_to_main_ms82.00 ± (81.86 - 82.13) ms81.84 ± (81.71 - 81.97) ms-0.2%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.11 - 16.17) MB16.21 ± (16.18 - 16.24) MB+0.4%✅⬆️
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.2%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms397.00 ± (394.20 - 399.81) ms396.53 ± (393.85 - 399.21) ms-0.1%
process.time_to_main_ms474.64 ± (473.98 - 475.30) ms473.73 ± (473.03 - 474.43) ms-0.2%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.42 ± (58.27 - 58.57) MB58.55 ± (58.41 - 58.70) MB+0.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 30)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms192.23 ± (191.81 - 192.64) ms195.40 ± (195.00 - 195.80) ms+1.7%✅⬆️
process.time_to_main_ms70.05 ± (69.89 - 70.21) ms70.89 ± (70.66 - 71.11) ms+1.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.28 ± (16.20 - 16.36) MB16.34 ± (16.31 - 16.36) MB+0.3%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)+2.4%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms191.51 ± (191.25 - 191.76) ms191.96 ± (191.50 - 192.42) ms+0.2%✅⬆️
process.time_to_main_ms70.91 ± (70.81 - 71.01) ms70.94 ± (70.76 - 71.12) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.29 ± (16.17 - 16.41) MB16.09 ± (15.95 - 16.23) MB-1.2%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+0.2%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms410.43 ± (407.86 - 413.01) ms409.72 ± (407.10 - 412.34) ms-0.2%
process.time_to_main_ms445.08 ± (444.50 - 445.66) ms444.39 ± (443.79 - 444.99) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.99 ± (58.85 - 59.13) MB59.15 ± (59.02 - 59.28) MB+0.3%✅⬆️
runtime.dotnet.threads.count30 ± (29 - 30)30 ± (30 - 30)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms190.55 ± (190.16 - 190.94) ms189.52 ± (189.15 - 189.90) ms-0.5%
process.time_to_main_ms69.40 ± (69.23 - 69.56) ms69.36 ± (69.17 - 69.56) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.74 ± (11.71 - 11.77) MB11.75 ± (11.70 - 11.80) MB+0.0%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.3%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms189.75 ± (189.53 - 189.97) ms189.00 ± (188.73 - 189.27) ms-0.4%
process.time_to_main_ms70.61 ± (70.51 - 70.71) ms70.22 ± (70.11 - 70.33) ms-0.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.87 ± (11.84 - 11.90) MB11.82 ± (11.78 - 11.85) MB-0.4%
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.4%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms364.38 ± (362.76 - 365.99) ms364.74 ± (363.28 - 366.20) ms+0.1%✅⬆️
process.time_to_main_ms426.95 ± (426.42 - 427.48) ms427.69 ± (427.06 - 428.32) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.89 ± (47.85 - 47.92) MB48.00 ± (47.96 - 48.03) MB+0.2%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+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 (7896) - mean (68ms)  : 67, 70
    master - mean (68ms)  : 67, 70

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

    section CallTarget+Inlining+NGEN
    This PR (7896) - mean (1,006ms)  : 966, 1046
    master - mean (1,007ms)  : 970, 1043

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

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

    section CallTarget+Inlining+NGEN
    This PR (7896) - mean (714ms)  : 673, 755
    master - mean (720ms)  : 668, 772

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

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

    section CallTarget+Inlining+NGEN
    This PR (7896) - mean (666ms)  : 640, 691
    master - mean (668ms)  : 647, 690

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

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

    section CallTarget+Inlining+NGEN
    This PR (7896) - mean (634ms)  : 615, 652
    master - mean (631ms)  : 614, 647

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 (7896) - mean (193ms)  : 189, 197
    master - mean (194ms)  : 190, 199

    section Bailout
    This PR (7896) - mean (197ms)  : 194, 201
    master - mean (197ms)  : 194, 200

    section CallTarget+Inlining+NGEN
    This PR (7896) - mean (1,122ms)  : 1053, 1190
    master - mean (1,109ms)  : 1070, 1147

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 (7896) - mean (277ms)  : 272, 282
    master - mean (278ms)  : 272, 284

    section Bailout
    This PR (7896) - mean (278ms)  : 273, 282
    master - mean (278ms)  : 274, 281

    section CallTarget+Inlining+NGEN
    This PR (7896) - mean (901ms)  : 856, 947
    master - mean (912ms)  : 869, 956

HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7896) - mean (274ms)  : 268, 281
    master - mean (271ms)  : 266, 276

    section Bailout
    This PR (7896) - mean (271ms)  : 265, 277
    master - mean (270ms)  : 267, 273

    section CallTarget+Inlining+NGEN
    This PR (7896) - mean (884ms)  : 843, 925
    master - mean (891ms)  : 844, 938

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

    section Bailout
    This PR (7896) - mean (268ms)  : 265, 272
    master - mean (270ms)  : 267, 272

    section CallTarget+Inlining+NGEN
    This PR (7896) - mean (824ms)  : 803, 845
    master - mean (822ms)  : 801, 843

@codex review

daniel-romano-DD avatar Dec 18 '25 11:12 daniel-romano-DD