Skip to content

feat: add capped sampling rate increase#8286

Open
raphaelgavache wants to merge 2 commits intomasterfrom
raphael/sampling_cap_increase
Open

feat: add capped sampling rate increase#8286
raphaelgavache wants to merge 2 commits intomasterfrom
raphael/sampling_cap_increase

Conversation

@raphaelgavache
Copy link
Copy Markdown
Member

@raphaelgavache raphaelgavache commented Mar 10, 2026

When the trace-agent is restarted, a rate of 100% is initially provided by the trace-agent, increasing dramatically the number of traces sampled. A rate could go suddenly from 0.1% to 100% and back to 0.1% when the trace-agent eventually computes the new sampling rate.

In particular it is observed that when the agent restarts, the payload buffering that waits for new container tags breaches its memory limit and we send spans without container tags.

This PR applies a limit of sampling rate increases of x2 every 1s resulting in a x10 completed every 3-4s
1->100% takes 7s
0.1 -> 100% takes 10s

RFC: https://docs.google.com/document/d/1h8cnGfOUx688pvRVqbhp6irn8s29LIwNYL1ge17nLyw/edit?usp=sharing

Similar PRs

Other details

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Mar 10, 2026

Benchmarks

Benchmark execution time: 2026-03-10 21:55:02

Comparing candidate commit ceb762f in PR branch raphael/sampling_cap_increase with baseline commit f675c92 in branch master.

Found 8 performance improvements and 7 performance regressions! Performance is the same for 154 metrics, 23 unstable metrics.

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net6.0

  • 🟩 execution_time [-80.016ms; -79.739ms] or [-39.750%; -39.613%]

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

  • 🟩 execution_time [-108.519ms; -108.428ms] or [-49.695%; -49.654%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody netcoreapp3.1

  • 🟩 execution_time [-19.145ms; -13.572ms] or [-9.056%; -6.420%]

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

  • 🟩 execution_time [-19.458ms; -13.085ms] or [-8.805%; -5.921%]

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

  • 🟩 throughput [+338.602op/s; +409.311op/s] or [+25.153%; +30.406%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472

  • 🟩 execution_time [-106.951µs; -100.983µs] or [-5.314%; -5.017%]
  • 🟩 throughput [+26.272op/s; +27.857op/s] or [+5.288%; +5.607%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1

  • 🟥 execution_time [+247.789µs; +257.051µs] or [+6.071%; +6.298%]
  • 🟥 throughput [-14.524op/s; -14.016op/s] or [-5.928%; -5.721%]

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

  • 🟥 throughput [-41139.049op/s; -36997.495op/s] or [-8.896%; -8.000%]

scenario:Benchmarks.Trace.NLogBenchmark.EnrichedLog net6.0

  • 🟥 throughput [-12599.351op/s; -9807.083op/s] or [-6.461%; -5.029%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net6.0

  • 🟥 execution_time [+44.020ms; +46.014ms] or [+42.628%; +44.559%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore netcoreapp3.1

  • 🟩 throughput [+14680918.121op/s; +15980977.527op/s] or [+6.514%; +7.091%]

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

  • 🟥 execution_time [+11.046ms; +15.920ms] or [+5.476%; +7.893%]

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

  • 🟥 execution_time [+13.550ms; +19.498ms] or [+6.930%; +9.973%]

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

dd-trace-dotnet-ci-bot Bot commented Mar 10, 2026

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8286) 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
duration74.51 ± (74.48 - 74.85) ms75.31 ± (75.38 - 75.70) ms+1.1%✅⬆️
.NET Framework 4.8 - Bailout
duration78.47 ± (78.35 - 78.69) ms80.28 ± (80.18 - 80.60) ms+2.3%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1080.99 ± (1080.13 - 1085.88) ms1086.18 ± (1086.50 - 1092.38) ms+0.5%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.57 ± (22.53 - 22.61) ms22.91 ± (22.86 - 22.96) ms+1.5%✅⬆️
process.time_to_main_ms85.37 ± (85.21 - 85.54) ms86.90 ± (86.70 - 87.11) ms+1.8%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.91) MB10.92 ± (10.91 - 10.92) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.54 ± (22.49 - 22.58) ms22.76 ± (22.70 - 22.81) ms+1.0%✅⬆️
process.time_to_main_ms86.89 ± (86.70 - 87.08) ms87.65 ± (87.43 - 87.88) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.95 ± (10.94 - 10.95) MB10.96 ± (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_ms238.07 ± (234.10 - 242.03) ms238.53 ± (234.59 - 242.47) ms+0.2%✅⬆️
process.time_to_main_ms498.74 ± (497.92 - 499.57) ms498.78 ± (497.92 - 499.65) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed47.58 ± (47.56 - 47.61) MB47.62 ± (47.60 - 47.64) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.3%
.NET 6 - Baseline
process.internal_duration_ms21.65 ± (21.61 - 21.68) ms21.81 ± (21.76 - 21.85) ms+0.7%✅⬆️
process.time_to_main_ms76.18 ± (76.00 - 76.36) ms76.86 ± (76.67 - 77.05) ms+0.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.63 ± (10.63 - 10.63) MB10.63 ± (10.63 - 10.64) MB+0.1%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.54 ± (21.50 - 21.59) ms21.72 ± (21.67 - 21.77) ms+0.8%✅⬆️
process.time_to_main_ms77.20 ± (77.01 - 77.39) ms78.07 ± (77.88 - 78.27) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.73 ± (10.73 - 10.74) MB10.75 ± (10.74 - 10.75) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms251.99 ± (248.13 - 255.85) ms252.93 ± (249.15 - 256.71) ms+0.4%✅⬆️
process.time_to_main_ms478.98 ± (478.24 - 479.71) ms480.72 ± (480.01 - 481.43) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed48.29 ± (48.27 - 48.31) MB48.35 ± (48.33 - 48.38) MB+0.1%✅⬆️
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%
.NET 8 - Baseline
process.internal_duration_ms19.76 ± (19.72 - 19.79) ms19.98 ± (19.94 - 20.02) ms+1.1%✅⬆️
process.time_to_main_ms74.67 ± (74.51 - 74.83) ms75.45 ± (75.29 - 75.61) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.64 ± (7.64 - 7.65) MB7.69 ± (7.68 - 7.70) MB+0.6%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.75 ± (19.71 - 19.80) ms20.27 ± (20.22 - 20.32) ms+2.6%✅⬆️
process.time_to_main_ms75.96 ± (75.79 - 76.14) ms78.17 ± (77.97 - 78.38) ms+2.9%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.70 ± (7.69 - 7.71) MB7.70 ± (7.70 - 7.71) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms190.30 ± (189.45 - 191.16) ms192.75 ± (192.06 - 193.44) ms+1.3%✅⬆️
process.time_to_main_ms455.41 ± (454.68 - 456.13) ms461.30 ± (460.52 - 462.07) ms+1.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed36.02 ± (35.98 - 36.06) MB36.18 ± (36.14 - 36.21) MB+0.4%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.1%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration195.04 ± (194.91 - 195.81) ms194.16 ± (194.43 - 195.30) ms-0.5%
.NET Framework 4.8 - Bailout
duration199.00 ± (198.76 - 199.53) ms199.23 ± (198.80 - 199.76) ms+0.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1150.09 ± (1150.49 - 1155.77) ms1152.88 ± (1158.16 - 1167.53) ms+0.2%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms188.72 ± (188.38 - 189.07) ms190.36 ± (189.89 - 190.83) ms+0.9%✅⬆️
process.time_to_main_ms82.20 ± (81.95 - 82.45) ms82.41 ± (82.18 - 82.65) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.04 ± (16.01 - 16.07) MB16.06 ± (16.04 - 16.08) MB+0.2%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (20 - 20)+0.1%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms188.84 ± (188.47 - 189.22) ms188.60 ± (188.24 - 188.96) ms-0.1%
process.time_to_main_ms83.47 ± (83.32 - 83.62) ms83.29 ± (83.11 - 83.47) ms-0.2%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.16 ± (16.13 - 16.18) MB16.13 ± (16.11 - 16.16) MB-0.1%
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (20 - 21)-0.2%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms437.71 ± (435.22 - 440.20) ms442.57 ± (440.60 - 444.53) ms+1.1%✅⬆️
process.time_to_main_ms478.36 ± (477.77 - 478.95) ms478.61 ± (478.04 - 479.18) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.06 ± (57.95 - 58.17) MB57.97 ± (57.84 - 58.10) MB-0.2%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
.NET 6 - Baseline
process.internal_duration_ms192.48 ± (192.09 - 192.88) ms192.70 ± (192.37 - 193.03) ms+0.1%✅⬆️
process.time_to_main_ms70.97 ± (70.73 - 71.21) ms71.27 ± (71.10 - 71.45) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.41 ± (16.34 - 16.48) MB16.32 ± (16.23 - 16.40) MB-0.5%
runtime.dotnet.threads.count19 ± (19 - 19)18 ± (18 - 19)-2.7%
.NET 6 - Bailout
process.internal_duration_ms191.65 ± (191.33 - 191.97) ms191.43 ± (191.18 - 191.69) ms-0.1%
process.time_to_main_ms71.91 ± (71.77 - 72.06) ms71.84 ± (71.72 - 71.96) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.30 ± (16.18 - 16.42) MB16.30 ± (16.20 - 16.40) MB+0.0%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.2%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms453.65 ± (451.72 - 455.57) ms449.64 ± (447.17 - 452.11) ms-0.9%
process.time_to_main_ms454.13 ± (453.55 - 454.71) ms453.47 ± (452.98 - 453.95) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed58.03 ± (57.94 - 58.12) MB58.06 ± (57.95 - 58.17) MB+0.0%✅⬆️
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms190.96 ± (190.45 - 191.47) ms191.48 ± (191.07 - 191.89) ms+0.3%✅⬆️
process.time_to_main_ms70.46 ± (70.29 - 70.63) ms70.51 ± (70.30 - 70.72) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.76 ± (11.73 - 11.79) MB11.76 ± (11.73 - 11.79) MB+0.0%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.0%✅⬆️
.NET 8 - Bailout
process.internal_duration_ms192.24 ± (191.76 - 192.72) ms190.89 ± (190.50 - 191.28) ms-0.7%
process.time_to_main_ms71.90 ± (71.75 - 72.05) ms71.53 ± (71.38 - 71.68) ms-0.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.77 ± (11.74 - 11.80) MB11.80 ± (11.77 - 11.82) MB+0.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms369.71 ± (368.32 - 371.11) ms370.17 ± (368.77 - 371.57) ms+0.1%✅⬆️
process.time_to_main_ms437.64 ± (437.04 - 438.25) ms440.52 ± (439.67 - 441.37) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed47.83 ± (47.81 - 47.86) MB47.81 ± (47.78 - 47.84) MB-0.0%
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 (8286) - mean (76ms)  : 73, 78
    master - mean (75ms)  : 72, 77

    section Bailout
    This PR (8286) - mean (80ms)  : 77, 83
    master - mean (79ms)  : 77, 80

    section CallTarget+Inlining+NGEN
    This PR (8286) - mean (1,089ms)  : 1051, 1128
    master - mean (1,083ms)  : 1042, 1124

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 (8286) - mean (117ms)  : 113, 121
    master - mean (115ms)  : 111, 118

    section Bailout
    This PR (8286) - mean (117ms)  : 115, 120
    master - mean (116ms)  : 114, 119

    section CallTarget+Inlining+NGEN
    This PR (8286) - mean (775ms)  : 717, 833
    master - mean (777ms)  : 718, 837

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8286) - mean (105ms)  : 102, 109
    master - mean (104ms)  : 101, 108

    section Bailout
    This PR (8286) - mean (106ms)  : 104, 109
    master - mean (105ms)  : 102, 109

    section CallTarget+Inlining+NGEN
    This PR (8286) - mean (767ms)  : 702, 833
    master - mean (764ms)  : 691, 836

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8286) - mean (103ms)  : 100, 107
    master - mean (102ms)  : 100, 105

    section Bailout
    This PR (8286) - mean (107ms)  : 103, 110
    master - mean (104ms)  : 101, 106

    section CallTarget+Inlining+NGEN
    This PR (8286) - mean (687ms)  : 658, 716
    master - mean (676ms)  : 659, 693

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 (8286) - mean (195ms)  : 188, 201
    master - mean (195ms)  : 190, 200

    section Bailout
    This PR (8286) - mean (199ms)  : 194, 204
    master - mean (199ms)  : 196, 203

    section CallTarget+Inlining+NGEN
    This PR (8286) - mean (1,163ms)  : 1091, 1235
    master - mean (1,153ms)  : 1115, 1191

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 (8286) - mean (282ms)  : 274, 289
    master - mean (280ms)  : 275, 284

    section Bailout
    This PR (8286) - mean (280ms)  : 275, 285
    master - mean (281ms)  : 277, 285

    section CallTarget+Inlining+NGEN
    This PR (8286) - mean (951ms)  : 918, 984
    master - mean (945ms)  : 908, 983

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

    section Bailout
    This PR (8286) - mean (272ms)  : 268, 275
    master - mean (272ms)  : 268, 275

    section CallTarget+Inlining+NGEN
    This PR (8286) - mean (931ms)  : 882, 980
    master - mean (937ms)  : 906, 967

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

    section Bailout
    This PR (8286) - mean (272ms)  : 267, 277
    master - mean (274ms)  : 268, 280

    section CallTarget+Inlining+NGEN
    This PR (8286) - mean (841ms)  : 814, 868
    master - mean (839ms)  : 814, 864

Loading

@raphaelgavache raphaelgavache added AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos type:enhancement Improvement to an existing feature labels Mar 11, 2026
@raphaelgavache raphaelgavache marked this pull request as ready for review March 11, 2026 00:31
@raphaelgavache raphaelgavache requested a review from a team as a code owner March 11, 2026 00:31
Copy link
Copy Markdown
Member

@andrewlock andrewlock left a comment

Choose a reason for hiding this comment

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

Thanks, but I think there's a bug which can leave you stuck never updating the rates (I haven't checked whether the same issue exists in the other referenced PRs). Also a few stylistic things

Comment thread tracer/src/Datadog.Trace/Sampling/AgentSamplingRule.cs Outdated
Comment thread tracer/src/Datadog.Trace/Sampling/AgentSamplingRule.cs Outdated
Comment thread tracer/src/Datadog.Trace/Sampling/AgentSamplingRule.cs Outdated
Comment thread tracer/src/Datadog.Trace/Sampling/AgentSamplingRule.cs Outdated
Comment thread tracer/src/Datadog.Trace/Sampling/AgentSamplingRule.cs Outdated
Comment thread tracer/test/Datadog.Trace.Tests/Sampling/AgentSamplingRuleTests.cs Outdated
[InlineData(0.2f, 0.8f, false, 0.2f)] // increase blocked during cooldown
public void CappedRate(float oldRate, float newRate, bool canIncrease, float expected)
{
AgentSamplingRule.CappedRate(oldRate, newRate, canIncrease).Should().Be(expected);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will need to fix this test in line with the suggested changes above

Co-authored-by: Andrew Lock <andrewlock.net@gmail.com>
@lucaspimentel
Copy link
Copy Markdown
Member

@codex review

@raphaelgavache
Copy link
Copy Markdown
Member Author

raphaelgavache commented Mar 24, 2026

I havn't reworked the PR yet, sorry, I'll do it by EOW (need to get my dotnet setup working)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos type:enhancement Improvement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants