Skip to content

Conversation

@andrewlock
Copy link
Member

@andrewlock andrewlock commented Nov 6, 2025

Summary of changes

Deletes a bunch of enum members from PublicApiUsage which are unused

Reason for change

These were unused or couldn't logically be called in production code, so were just adding overhead as we allocate the array to record them.

Fixed one case where we Should have been recording it, but weren't

Implementation details

FindAllReferences on each member => if it's not used in Datadog.Trace, remove it

Test coverage

Covered by existing

Other details

Part of a stack

@datadog-official

This comment has been minimized.

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

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

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (7787) 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.10 ± (74.03 - 74.59) ms74.99 ± (74.91 - 75.61) ms+1.2%✅⬆️
.NET Framework 4.8 - Bailout
duration78.91 ± (78.80 - 79.52) ms78.68 ± (78.63 - 79.31) ms-0.3%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1102.17 ± (1104.68 - 1115.24) ms1101.43 ± (1103.00 - 1112.97) ms-0.1%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.77 ± (22.69 - 22.85) ms22.87 ± (22.79 - 22.95) ms+0.5%✅⬆️
process.time_to_main_ms86.64 ± (86.26 - 87.01) ms87.56 ± (87.16 - 87.96) ms+1.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.87 ± (10.87 - 10.87) MB10.88 ± (10.88 - 10.88) MB+0.1%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms23.02 ± (22.95 - 23.10) ms22.67 ± (22.61 - 22.74) ms-1.5%
process.time_to_main_ms89.67 ± (89.33 - 90.01) ms87.73 ± (87.38 - 88.08) ms-2.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.91) MB10.93 ± (10.92 - 10.93) MB+0.1%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms218.63 ± (217.27 - 220.00) ms217.92 ± (216.56 - 219.28) ms-0.3%
process.time_to_main_ms545.43 ± (544.25 - 546.61) ms548.49 ± (547.38 - 549.61) ms+0.6%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed52.63 ± (52.61 - 52.66) MB52.43 ± (52.41 - 52.45) MB-0.4%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.1%
.NET 6 - Baseline
process.internal_duration_ms21.67 ± (21.60 - 21.73) ms21.54 ± (21.48 - 21.61) ms-0.6%
process.time_to_main_ms75.47 ± (75.18 - 75.76) ms75.14 ± (74.81 - 75.46) ms-0.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.59 ± (10.58 - 10.59) MB10.62 ± (10.61 - 10.62) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.59 ± (21.53 - 21.65) ms21.49 ± (21.44 - 21.54) ms-0.5%
process.time_to_main_ms76.61 ± (76.25 - 76.97) ms76.36 ± (76.07 - 76.65) ms-0.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.62 ± (10.62 - 10.63) MB10.65 ± (10.65 - 10.65) MB+0.2%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms205.46 ± (203.98 - 206.94) ms206.15 ± (204.89 - 207.41) ms+0.3%✅⬆️
process.time_to_main_ms513.10 ± (512.03 - 514.17) ms511.79 ± (510.70 - 512.89) ms-0.3%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.69 ± (51.66 - 51.73) MB51.59 ± (51.56 - 51.63) MB-0.2%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.73 ± (19.67 - 19.78) ms19.73 ± (19.67 - 19.79) ms+0.0%✅⬆️
process.time_to_main_ms74.54 ± (74.22 - 74.87) ms74.58 ± (74.24 - 74.92) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.63 ± (7.62 - 7.64) MB7.63 ± (7.62 - 7.63) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.60 ± (19.55 - 19.65) ms19.63 ± (19.58 - 19.69) ms+0.2%✅⬆️
process.time_to_main_ms74.85 ± (74.57 - 75.12) ms75.07 ± (74.78 - 75.36) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.68 ± (7.67 - 7.68) MB7.68 ± (7.68 - 7.69) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms191.31 ± (190.39 - 192.23) ms189.28 ± (188.40 - 190.16) ms-1.1%
process.time_to_main_ms492.27 ± (491.26 - 493.28) ms483.28 ± (482.42 - 484.14) ms-1.8%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.93 ± (38.89 - 38.96) MB38.85 ± (38.81 - 38.89) MB-0.2%
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
duration191.87 ± (191.64 - 192.47) ms191.34 ± (191.22 - 192.18) ms-0.3%
.NET Framework 4.8 - Bailout
duration194.99 ± (194.67 - 195.20) ms194.69 ± (194.42 - 194.83) ms-0.2%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1152.71 ± (1154.15 - 1161.82) ms1157.93 ± (1158.93 - 1167.44) ms+0.5%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms186.81 ± (186.46 - 187.16) ms186.65 ± (186.39 - 186.90) ms-0.1%
process.time_to_main_ms80.82 ± (80.55 - 81.09) ms80.40 ± (80.21 - 80.59) ms-0.5%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.14 ± (16.10 - 16.17) MB16.12 ± (16.10 - 16.15) MB-0.1%
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (19 - 20)-0.5%
.NET Core 3.1 - Bailout
process.internal_duration_ms186.90 ± (186.58 - 187.22) ms185.85 ± (185.51 - 186.19) ms-0.6%
process.time_to_main_ms81.91 ± (81.78 - 82.05) ms81.51 ± (81.33 - 81.69) ms-0.5%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.10 ± (16.02 - 16.17) MB16.19 ± (16.16 - 16.22) MB+0.6%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (20 - 21)-0.2%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms397.12 ± (393.97 - 400.27) ms392.30 ± (389.88 - 394.71) ms-1.2%
process.time_to_main_ms515.88 ± (515.25 - 516.52) ms514.86 ± (514.25 - 515.47) ms-0.2%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed62.94 ± (62.76 - 63.13) MB62.62 ± (62.46 - 62.78) MB-0.5%
runtime.dotnet.threads.count29 ± (29 - 29)29 ± (29 - 29)-0.0%
.NET 6 - Baseline
process.internal_duration_ms189.95 ± (189.67 - 190.23) ms190.52 ± (190.21 - 190.83) ms+0.3%✅⬆️
process.time_to_main_ms69.48 ± (69.35 - 69.62) ms69.31 ± (69.15 - 69.46) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.03 ± (15.87 - 16.18) MB16.04 ± (15.89 - 16.19) MB+0.1%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)+0.6%✅⬆️
.NET 6 - Bailout
process.internal_duration_ms189.60 ± (189.27 - 189.93) ms189.41 ± (189.07 - 189.75) ms-0.1%
process.time_to_main_ms70.69 ± (70.56 - 70.82) ms70.31 ± (70.23 - 70.38) ms-0.5%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed15.87 ± (15.70 - 16.05) MB15.90 ± (15.73 - 16.08) MB+0.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.5%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms409.54 ± (406.37 - 412.71) ms403.14 ± (400.31 - 405.98) ms-1.6%
process.time_to_main_ms485.83 ± (485.25 - 486.40) ms485.47 ± (484.83 - 486.12) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed62.09 ± (61.93 - 62.24) MB61.39 ± (61.25 - 61.53) MB-1.1%
runtime.dotnet.threads.count29 ± (29 - 29)30 ± (29 - 30)+0.4%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms188.87 ± (188.53 - 189.21) ms188.56 ± (188.29 - 188.83) ms-0.2%
process.time_to_main_ms69.07 ± (68.90 - 69.23) ms69.15 ± (68.99 - 69.31) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.78 ± (11.75 - 11.80) MB11.73 ± (11.70 - 11.75) MB-0.4%
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.0%
.NET 8 - Bailout
process.internal_duration_ms187.58 ± (187.33 - 187.82) ms187.15 ± (186.95 - 187.35) ms-0.2%
process.time_to_main_ms70.02 ± (69.93 - 70.11) ms69.86 ± (69.77 - 69.95) ms-0.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.73 ± (11.64 - 11.82) MB11.74 ± (11.66 - 11.82) MB+0.1%✅⬆️
runtime.dotnet.threads.count19 ± (18 - 19)19 ± (18 - 19)-0.3%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms357.36 ± (355.71 - 359.01) ms360.70 ± (359.16 - 362.24) ms+0.9%✅⬆️
process.time_to_main_ms464.36 ± (463.77 - 464.96) ms458.85 ± (458.14 - 459.57) ms-1.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed50.42 ± (50.38 - 50.46) MB50.27 ± (50.24 - 50.30) MB-0.3%
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 (7787) - mean (75ms)  : 70, 81
    master - mean (74ms)  : 70, 78

    section Bailout
    This PR (7787) - mean (79ms)  : 74, 84
    master - mean (79ms)  : 74, 84

    section CallTarget+Inlining+NGEN
    This PR (7787) - mean (1,108ms)  : 1035, 1181
    master - mean (1,110ms)  : 1033, 1187

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 (7787) - mean (118ms)  : 109, 127
    master - mean (117ms)  : 110, 124

    section Bailout
    This PR (7787) - mean (118ms)  : 112, 124
    master - mean (120ms)  : 114, 127

    section CallTarget+Inlining+NGEN
    This PR (7787) - mean (804ms)  : 758, 849
    master - mean (802ms)  : 753, 851

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7787) - mean (104ms)  : 98, 109
    master - mean (104ms)  : 99, 110

    section Bailout
    This PR (7787) - mean (105ms)  : 100, 109
    master - mean (105ms)  : 97, 114

    section CallTarget+Inlining+NGEN
    This PR (7787) - mean (750ms)  : 711, 788
    master - mean (750ms)  : 711, 790

Loading
FakeDbCommand (.NET 8)
gantt
    title Execution time (ms) FakeDbCommand (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7787) - mean (102ms)  : 96, 108
    master - mean (102ms)  : 97, 108

    section Bailout
    This PR (7787) - mean (103ms)  : 97, 108
    master - mean (102ms)  : 97, 107

    section CallTarget+Inlining+NGEN
    This PR (7787) - mean (708ms)  : 679, 736
    master - mean (716ms)  : 687, 745

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 (7787) - mean (192ms)  : 187, 197
    master - mean (192ms)  : 188, 196

    section Bailout
    This PR (7787) - mean (195ms)  : 193, 197
    master - mean (195ms)  : 192, 197

    section CallTarget+Inlining+NGEN
    This PR (7787) - mean (1,163ms)  : 1102, 1225
    master - mean (1,158ms)  : 1102, 1214

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 (7787) - mean (275ms)  : 271, 279
    master - mean (276ms)  : 272, 281

    section Bailout
    This PR (7787) - mean (275ms)  : 271, 280
    master - mean (277ms)  : 272, 282

    section CallTarget+Inlining+NGEN
    This PR (7787) - mean (947ms)  : 910, 984
    master - mean (953ms)  : 914, 991

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7787) - mean (268ms)  : 264, 272
    master - mean (268ms)  : 263, 273

    section Bailout
    This PR (7787) - mean (268ms)  : 264, 272
    master - mean (269ms)  : 264, 274

    section CallTarget+Inlining+NGEN
    This PR (7787) - mean (922ms)  : 875, 968
    master - mean (932ms)  : 884, 981

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (7787) - mean (267ms)  : 263, 271
    master - mean (268ms)  : 263, 273

    section Bailout
    This PR (7787) - mean (267ms)  : 264, 270
    master - mean (267ms)  : 263, 271

    section CallTarget+Inlining+NGEN
    This PR (7787) - mean (849ms)  : 830, 868
    master - mean (853ms)  : 832, 873

Loading

@andrewlock andrewlock force-pushed the andrew/remove-unused-enum-members branch from 2f81847 to d7a6df3 Compare November 6, 2025 14:44
@andrewlock andrewlock requested review from a team as code owners November 6, 2025 14:44
@pr-commenter
Copy link

pr-commenter bot commented Nov 6, 2025

Benchmarks

Benchmarks Report for benchmark platform 🐌

Benchmarks for #7787 compared to master:

  • 1 benchmarks are slower, with geometric mean 1.155
  • 6 benchmarks have fewer allocations
  • 5 benchmarks have more allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7787

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.ActivityBenchmark.StartStopWithChild‑net472 6.02 KB 6.09 KB 72 B 1.20%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 10.4μs 53.3ns 301ns 0 0 0 5.54 KB
master StartStopWithChild netcoreapp3.1 13.9μs 73.5ns 382ns 0 0 0 5.73 KB
master StartStopWithChild net472 22.3μs 122ns 678ns 0.975 0.433 0.108 6.02 KB
#7787 StartStopWithChild net6.0 10.7μs 55.1ns 270ns 0 0 0 5.53 KB
#7787 StartStopWithChild netcoreapp3.1 13.5μs 68ns 319ns 0 0 0 5.71 KB
#7787 StartStopWithChild net472 22.2μs 126ns 864ns 0.882 0.22 0 6.09 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7787

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 3.31 KB 3.35 KB 46 B 1.39%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 934μs 178ns 689ns 0 0 0 2.71 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 1.03ms 438ns 1.7μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 1.2ms 591ns 2.29μs 0 0 0 3.31 KB
#7787 WriteAndFlushEnrichedTraces net6.0 940μs 304ns 1.18μs 0 0 0 2.71 KB
#7787 WriteAndFlushEnrichedTraces netcoreapp3.1 1.02ms 1.53μs 5.91μs 0 0 0 2.7 KB
#7787 WriteAndFlushEnrichedTraces net472 1.22ms 753ns 2.82μs 0 0 0 3.35 KB
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master AllCycleSimpleBody net6.0 1.04μs 6.4ns 64ns 0 0 0 1.22 KB
master AllCycleSimpleBody netcoreapp3.1 1.41μs 7.62ns 45.1ns 0 0 0 1.2 KB
master AllCycleSimpleBody net472 1.02μs 0.247ns 0.959ns 0.194 0 0 1.23 KB
master AllCycleMoreComplexBody net6.0 6.98μs 38.4ns 220ns 0 0 0 4.72 KB
master AllCycleMoreComplexBody netcoreapp3.1 9.01μs 41.9ns 173ns 0 0 0 4.62 KB
master AllCycleMoreComplexBody net472 7.66μs 4.11ns 15.9ns 0.729 0 0 4.74 KB
master ObjectExtractorSimpleBody net6.0 319ns 1.76ns 9.93ns 0 0 0 280 B
master ObjectExtractorSimpleBody netcoreapp3.1 402ns 2.14ns 11.5ns 0 0 0 272 B
master ObjectExtractorSimpleBody net472 296ns 0.103ns 0.399ns 0.0432 0 0 281 B
master ObjectExtractorMoreComplexBody net6.0 6.3μs 16.2ns 62.8ns 0 0 0 3.78 KB
master ObjectExtractorMoreComplexBody netcoreapp3.1 7.84μs 21.4ns 80.2ns 0 0 0 3.69 KB
master ObjectExtractorMoreComplexBody net472 6.72μs 2.02ns 7.81ns 0.57 0 0 3.8 KB
#7787 AllCycleSimpleBody net6.0 1.08μs 5.77ns 28.9ns 0 0 0 1.22 KB
#7787 AllCycleSimpleBody netcoreapp3.1 1.41μs 7.87ns 53.9ns 0 0 0 1.2 KB
#7787 AllCycleSimpleBody net472 1.01μs 0.444ns 1.66ns 0.194 0 0 1.23 KB
#7787 AllCycleMoreComplexBody net6.0 7.15μs 39.4ns 240ns 0 0 0 4.72 KB
#7787 AllCycleMoreComplexBody netcoreapp3.1 8.97μs 37.9ns 147ns 0 0 0 4.62 KB
#7787 AllCycleMoreComplexBody net472 7.69μs 4.96ns 17.9ns 0.729 0 0 4.74 KB
#7787 ObjectExtractorSimpleBody net6.0 323ns 1.6ns 7.34ns 0 0 0 280 B
#7787 ObjectExtractorSimpleBody netcoreapp3.1 396ns 2.22ns 13.9ns 0 0 0 272 B
#7787 ObjectExtractorSimpleBody net472 298ns 0.0944ns 0.366ns 0.0435 0 0 281 B
#7787 ObjectExtractorMoreComplexBody net6.0 6.38μs 32.4ns 138ns 0 0 0 3.78 KB
#7787 ObjectExtractorMoreComplexBody netcoreapp3.1 7.77μs 40ns 179ns 0 0 0 3.69 KB
#7787 ObjectExtractorMoreComplexBody net472 6.67μs 1.05ns 3.92ns 0.601 0 0 3.8 KB
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EncodeArgs net6.0 77.4μs 361ns 1.4μs 0 0 0 32.4 KB
master EncodeArgs netcoreapp3.1 96.5μs 264ns 1.02μs 0 0 0 32.4 KB
master EncodeArgs net472 109μs 24.9ns 96.5ns 4.93 0 0 32.5 KB
master EncodeLegacyArgs net6.0 141μs 55ns 206ns 0 0 0 2.15 KB
master EncodeLegacyArgs netcoreapp3.1 200μs 641ns 2.48μs 0 0 0 2.14 KB
master EncodeLegacyArgs net472 266μs 252ns 977ns 0 0 0 2.16 KB
#7787 EncodeArgs net6.0 76.8μs 174ns 675ns 0 0 0 32.4 KB
#7787 EncodeArgs netcoreapp3.1 97.1μs 138ns 536ns 0 0 0 32.4 KB
#7787 EncodeArgs net472 112μs 23.3ns 90.2ns 5.02 0 0 32.5 KB
#7787 EncodeLegacyArgs net6.0 146μs 77.9ns 291ns 0 0 0 2.15 KB
#7787 EncodeLegacyArgs netcoreapp3.1 201μs 264ns 1.02μs 0 0 0 2.14 KB
#7787 EncodeLegacyArgs net472 262μs 109ns 422ns 0 0 0 2.16 KB
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunWafRealisticBenchmark net6.0 405μs 64.5ns 250ns 0 0 0 4.55 KB
master RunWafRealisticBenchmark netcoreapp3.1 853μs 4.76μs 33.3μs 0 0 0 4.48 KB
master RunWafRealisticBenchmark net472 433μs 76.8ns 287ns 0 0 0 4.66 KB
master RunWafRealisticBenchmarkWithAttack net6.0 289μs 42.5ns 159ns 0 0 0 2.24 KB
master RunWafRealisticBenchmarkWithAttack netcoreapp3.1 298μs 190ns 686ns 0 0 0 2.22 KB
master RunWafRealisticBenchmarkWithAttack net472 311μs 40.6ns 152ns 0 0 0 2.29 KB
#7787 RunWafRealisticBenchmark net6.0 394μs 103ns 371ns 0 0 0 4.55 KB
#7787 RunWafRealisticBenchmark netcoreapp3.1 843μs 4.36μs 23.1μs 0 0 0 4.48 KB
#7787 RunWafRealisticBenchmark net472 435μs 62ns 240ns 0 0 0 4.66 KB
#7787 RunWafRealisticBenchmarkWithAttack net6.0 286μs 56.6ns 219ns 0 0 0 2.24 KB
#7787 RunWafRealisticBenchmarkWithAttack netcoreapp3.1 296μs 61.3ns 221ns 0 0 0 2.22 KB
#7787 RunWafRealisticBenchmarkWithAttack net472 312μs 25.7ns 96.1ns 0 0 0 2.29 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 60.9μs 74.4ns 258ns 0 0 0 14.52 KB
master SendRequest netcoreapp3.1 72.1μs 107ns 401ns 0 0 0 17.42 KB
master SendRequest net472 0.00304ns 0.00142ns 0.00549ns 0 0 0 0 b
#7787 SendRequest net6.0 61.5μs 73.8ns 276ns 0 0 0 14.52 KB
#7787 SendRequest netcoreapp3.1 72.4μs 65.7ns 237ns 0 0 0 17.42 KB
#7787 SendRequest net472 0.00419ns 0.00174ns 0.00675ns 0 0 0 0 b
Benchmarks.Trace.CharSliceBenchmark - Same speed ✔️ Fewer allocations 🎉

Fewer allocations 🎉 in #7787

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net6.0 5 B 4 B -1 B -20.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice‑net472 73 B 0 b -73 B -100.00%
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑net472 47 B 0 b -47 B -100.00%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master OriginalCharSlice net6.0 1.91ms 663ns 2.39μs 0 0 0 640.01 KB
master OriginalCharSlice netcoreapp3.1 2.13ms 7.29μs 28.2μs 0 0 0 640 KB
master OriginalCharSlice net472 2.55ms 213ns 767ns 100 0 0 641.95 KB
master OptimizedCharSlice net6.0 1.41ms 654ns 2.53μs 0 0 0 7 B
master OptimizedCharSlice netcoreapp3.1 1.71ms 524ns 2.03μs 0 0 0 1 B
master OptimizedCharSlice net472 1.99ms 329ns 1.28μs 0 0 0 73 B
master OptimizedCharSliceWithPool net6.0 836μs 24.4ns 94.4ns 0 0 0 5 B
master OptimizedCharSliceWithPool netcoreapp3.1 874μs 86.8ns 325ns 0 0 0 1 B
master OptimizedCharSliceWithPool net472 1.13ms 76.2ns 295ns 0 0 0 47 B
#7787 OriginalCharSlice net6.0 1.93ms 223ns 803ns 0 0 0 640.01 KB
#7787 OriginalCharSlice netcoreapp3.1 2.15ms 9.02μs 33.8μs 0 0 0 640 KB
#7787 OriginalCharSlice net472 2.74ms 405ns 1.52μs 100 0 0 641.95 KB
#7787 OptimizedCharSlice net6.0 1.44ms 126ns 487ns 0 0 0 7 B
#7787 OptimizedCharSlice netcoreapp3.1 1.77ms 813ns 3.15μs 0 0 0 1 B
#7787 OptimizedCharSlice net472 1.97ms 258ns 997ns 0 0 0 0 b
#7787 OptimizedCharSliceWithPool net6.0 802μs 48.4ns 188ns 0 0 0 4 B
#7787 OptimizedCharSliceWithPool netcoreapp3.1 917μs 115ns 446ns 0 0 0 1 B
#7787 OptimizedCharSliceWithPool net472 1.16ms 150ns 582ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Slower ⚠️ More allocations ⚠️

Slower ⚠️ in #7787

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 1.155 685,849.52 792,197.32

More allocations ⚠️ in #7787

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 42.07 KB 42.8 KB 728 B 1.73%

Fewer allocations 🎉 in #7787

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net6.0 42.64 KB 42.35 KB -292 B -0.68%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 719μs 1.18μs 4.56μs 0 0 0 42.64 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 686μs 690ns 2.67μs 0 0 0 42.07 KB
master WriteAndFlushEnrichedTraces net472 868μs 3.28μs 12.7μs 8.33 0 0 56.12 KB
#7787 WriteAndFlushEnrichedTraces net6.0 686μs 3.97μs 34.4μs 0 0 0 42.35 KB
#7787 WriteAndFlushEnrichedTraces netcoreapp3.1 789μs 3.53μs 15.4μs 0 0 0 42.8 KB
#7787 WriteAndFlushEnrichedTraces net472 829μs 1.75μs 6.56μs 7.81 0 0 56.19 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.97μs 9.76ns 44.7ns 0 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 2.83μs 2.07ns 7.75ns 0 0 0 1.02 KB
master ExecuteNonQuery net472 2.97μs 3.88ns 15ns 0.149 0.0149 0 987 B
#7787 ExecuteNonQuery net6.0 1.98μs 3.76ns 14.6ns 0 0 0 1.02 KB
#7787 ExecuteNonQuery netcoreapp3.1 2.62μs 2.6ns 10.1ns 0 0 0 1.02 KB
#7787 ExecuteNonQuery net472 2.87μs 3.35ns 13ns 0.143 0.0143 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.69μs 8.77ns 41.2ns 0 0 0 1.03 KB
master CallElasticsearch netcoreapp3.1 2.3μs 11.2ns 44.9ns 0 0 0 1.03 KB
master CallElasticsearch net472 3.61μs 3.31ns 12.4ns 0.163 0 0 1.04 KB
master CallElasticsearchAsync net6.0 1.92μs 7.02ns 27.2ns 0 0 0 1.01 KB
master CallElasticsearchAsync netcoreapp3.1 2.37μs 11.7ns 49.4ns 0 0 0 1.08 KB
master CallElasticsearchAsync net472 3.66μs 2.24ns 8.66ns 0.165 0 0 1.1 KB
#7787 CallElasticsearch net6.0 1.67μs 8.36ns 39.2ns 0 0 0 1.03 KB
#7787 CallElasticsearch netcoreapp3.1 2.14μs 11ns 52.8ns 0 0 0 1.03 KB
#7787 CallElasticsearch net472 3.54μs 4.51ns 17.5ns 0.158 0 0 1.04 KB
#7787 CallElasticsearchAsync net6.0 1.87μs 2.96ns 11.1ns 0 0 0 1.01 KB
#7787 CallElasticsearchAsync netcoreapp3.1 2.44μs 11.4ns 42.7ns 0 0 0 1.08 KB
#7787 CallElasticsearchAsync net472 3.62μs 7.92ns 30.7ns 0.161 0 0 1.1 KB
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.84μs 9.31ns 40.6ns 0 0 0 952 B
master ExecuteAsync netcoreapp3.1 2.42μs 5.75ns 22.3ns 0 0 0 952 B
master ExecuteAsync net472 2.57μs 1.17ns 4.39ns 0.141 0 0 915 B
#7787 ExecuteAsync net6.0 1.86μs 9.63ns 44.2ns 0 0 0 953 B
#7787 ExecuteAsync netcoreapp3.1 2.46μs 12.6ns 57.5ns 0 0 0 952 B
#7787 ExecuteAsync net472 2.54μs 1.2ns 4.34ns 0.14 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 6.68μs 5.51ns 20.6ns 0 0 0 2.36 KB
master SendAsync netcoreapp3.1 8.87μs 7ns 26.2ns 0 0 0 2.9 KB
master SendAsync net472 12.2μs 11.8ns 45.8ns 0.486 0 0 3.18 KB
#7787 SendAsync net6.0 6.9μs 11.9ns 46ns 0 0 0 2.36 KB
#7787 SendAsync netcoreapp3.1 8.64μs 4.36ns 16.3ns 0 0 0 2.9 KB
#7787 SendAsync net472 12.5μs 15.2ns 58.9ns 0.499 0 0 3.18 KB
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️

More allocations ⚠️ in #7787

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net472 57.34 KB 65.54 KB 8.19 KB 14.29%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 274.03 KB 276.72 KB 2.69 KB 0.98%

Fewer allocations 🎉 in #7787

Benchmark Base Allocated Diff Allocated Change Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 259.17 KB 256.49 KB -2.68 KB -1.03%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark‑net6.0 46.5 KB 44.03 KB -2.46 KB -5.30%

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StringConcatBenchmark net6.0 46.3μs 272ns 2.19μs 0 0 0 46.5 KB
master StringConcatBenchmark netcoreapp3.1 51μs 298ns 2.58μs 0 0 0 42.67 KB
master StringConcatBenchmark net472 57.2μs 118ns 426ns 0 0 0 57.34 KB
master StringConcatAspectBenchmark net6.0 478μs 1.69μs 6.08μs 0 0 0 274.03 KB
master StringConcatAspectBenchmark netcoreapp3.1 519μs 2.53μs 10.4μs 0 0 0 259.17 KB
master StringConcatAspectBenchmark net472 405μs 2.1μs 12.1μs 0 0 0 278.53 KB
#7787 StringConcatBenchmark net6.0 45.3μs 258ns 1.88μs 0 0 0 44.03 KB
#7787 StringConcatBenchmark netcoreapp3.1 47.8μs 263ns 2.23μs 0 0 0 42.67 KB
#7787 StringConcatBenchmark net472 57.6μs 159ns 551ns 0 0 0 65.54 KB
#7787 StringConcatAspectBenchmark net6.0 471μs 2.24μs 9.22μs 0 0 0 276.72 KB
#7787 StringConcatAspectBenchmark netcoreapp3.1 521μs 2.61μs 11.7μs 0 0 0 256.49 KB
#7787 StringConcatAspectBenchmark net472 409μs 2.25μs 15.4μs 0 0 0 278.53 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.68μs 14ns 68.5ns 0 0 0 1.71 KB
master EnrichedLog netcoreapp3.1 3.63μs 17.7ns 73.1ns 0 0 0 1.7 KB
master EnrichedLog net472 4.04μs 6.46ns 25ns 0.243 0 0 1.64 KB
#7787 EnrichedLog net6.0 2.61μs 13.9ns 73.6ns 0 0 0 1.7 KB
#7787 EnrichedLog netcoreapp3.1 3.68μs 16.1ns 62.2ns 0 0 0 1.7 KB
#7787 EnrichedLog net472 3.87μs 5.82ns 22.6ns 0.25 0 0 1.64 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 122μs 25.6ns 99ns 0 0 0 4.31 KB
master EnrichedLog netcoreapp3.1 127μs 55.3ns 207ns 0 0 0 4.31 KB
master EnrichedLog net472 169μs 93.2ns 361ns 0 0 0 4.52 KB
#7787 EnrichedLog net6.0 123μs 120ns 451ns 0 0 0 4.31 KB
#7787 EnrichedLog netcoreapp3.1 127μs 232ns 835ns 0 0 0 4.31 KB
#7787 EnrichedLog net472 171μs 616ns 2.39μs 0 0 0 4.52 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.99μs 5.31ns 20.6ns 0 0 0 2.26 KB
master EnrichedLog netcoreapp3.1 6.91μs 21.9ns 84.7ns 0 0 0 2.26 KB
master EnrichedLog net472 7.54μs 5.77ns 22.3ns 0.301 0 0 2.08 KB
#7787 EnrichedLog net6.0 5.19μs 14.9ns 57.7ns 0 0 0 2.26 KB
#7787 EnrichedLog netcoreapp3.1 7.18μs 26.5ns 103ns 0 0 0 2.26 KB
#7787 EnrichedLog net472 7.68μs 5.33ns 20.6ns 0.306 0 0 2.08 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 2.02μs 10.1ns 42.7ns 0 0 0 1.2 KB
master SendReceive netcoreapp3.1 2.57μs 10.5ns 40.6ns 0 0 0 1.2 KB
master SendReceive net472 3.11μs 2.87ns 10.7ns 0.186 0 0 1.2 KB
#7787 SendReceive net6.0 2.03μs 1.55ns 5.8ns 0 0 0 1.2 KB
#7787 SendReceive netcoreapp3.1 2.63μs 13ns 50.2ns 0 0 0 1.2 KB
#7787 SendReceive net472 3.02μs 2.39ns 9.27ns 0.181 0 0 1.2 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 4.24μs 2.59ns 10ns 0 0 0 1.58 KB
master EnrichedLog netcoreapp3.1 5.81μs 9.17ns 35.5ns 0 0 0 1.63 KB
master EnrichedLog net472 6.65μs 5.37ns 20.8ns 0.3 0 0 2.03 KB
#7787 EnrichedLog net6.0 4.29μs 13.5ns 52.1ns 0 0 0 1.58 KB
#7787 EnrichedLog netcoreapp3.1 5.59μs 18.4ns 71.4ns 0 0 0 1.63 KB
#7787 EnrichedLog net472 6.65μs 7.34ns 28.4ns 0.297 0 0 2.03 KB
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 783ns 3.95ns 17.7ns 0 0 0 576 B
master StartFinishSpan netcoreapp3.1 966ns 0.247ns 0.923ns 0 0 0 576 B
master StartFinishSpan net472 951ns 0.536ns 2.08ns 0.0906 0 0 578 B
master StartFinishScope net6.0 932ns 4.48ns 17.9ns 0 0 0 696 B
master StartFinishScope netcoreapp3.1 1.19μs 6.04ns 26.3ns 0 0 0 696 B
master StartFinishScope net472 1.12μs 0.556ns 2.15ns 0.101 0 0 658 B
#7787 StartFinishSpan net6.0 775ns 3.7ns 14.3ns 0 0 0 576 B
#7787 StartFinishSpan netcoreapp3.1 976ns 4.72ns 20.6ns 0 0 0 576 B
#7787 StartFinishSpan net472 961ns 1.57ns 6.07ns 0.0909 0 0 578 B
#7787 StartFinishScope net6.0 929ns 4.55ns 19.8ns 0 0 0 696 B
#7787 StartFinishScope netcoreapp3.1 1.23μs 5.96ns 26ns 0 0 0 696 B
#7787 StartFinishScope net472 1.14μs 0.325ns 1.26ns 0.103 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 1.07μs 5.52ns 27.6ns 0 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 1.43μs 6.69ns 25.9ns 0 0 0 696 B
master RunOnMethodBegin net472 1.45μs 1.29ns 5.01ns 0.101 0 0 658 B
#7787 RunOnMethodBegin net6.0 1.07μs 0.403ns 1.51ns 0 0 0 696 B
#7787 RunOnMethodBegin netcoreapp3.1 1.41μs 7.1ns 30.1ns 0 0 0 696 B
#7787 RunOnMethodBegin net472 1.44μs 0.544ns 2.04ns 0.1 0 0 658 B

@andrewlock andrewlock force-pushed the andrew/remove-unused-enum-members branch from d7a6df3 to 3c51752 Compare November 7, 2025 10:06
@andrewlock andrewlock force-pushed the andrew/remove-more-public-api branch from 3238dc9 to 1c911e2 Compare November 7, 2025 10:06
Copy link
Member

@lucaspimentel lucaspimentel left a comment

Choose a reason for hiding this comment

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

Beautiful

Image

andrewlock added a commit that referenced this pull request Nov 10, 2025
## Summary of changes

- Remove `[PublicApi]` usages that aren't necessary any more
- Rename `DebugEnabledInternal` => `DebugEnabled`
- Delete some "public" methods that aren't, and are no longer necessary
(as they're unused)

## Reason for change

Cleaning up

## Implementation details

Mostly <kbd>del</kbd>

## Test coverage

Covered by existing

## Other details


Part of a stack

- #7786 👈
- #7787
- #7788
Base automatically changed from andrew/remove-more-public-api to master November 10, 2025 11:23
@andrewlock andrewlock requested review from a team as code owners November 10, 2025 11:23
@andrewlock andrewlock requested a review from link04 November 10, 2025 11:24
These just take up space and aren't ever called, so aren't useful
@andrewlock andrewlock force-pushed the andrew/remove-unused-enum-members branch from 3c51752 to 6e3d383 Compare November 10, 2025 11:26
@andrewlock andrewlock enabled auto-merge (squash) November 10, 2025 12:21
@andrewlock andrewlock merged commit 12c20ca into master Nov 10, 2025
151 checks passed
@andrewlock andrewlock deleted the andrew/remove-unused-enum-members branch November 10, 2025 12:58
@github-actions github-actions bot added this to the vNext-v3 milestone Nov 10, 2025
andrewlock added a commit that referenced this pull request Nov 14, 2025
## Summary of changes

Repurposes the now-defunct `PublicApiAnalyzer` to an
`InternalForTestingAnalyzer`

## Reason for change

We have various methods in `Datadog.Trace` that should never be called
by production code, and are only exposed to make testing functionality
easier. Currently we rely on method names and comments to avoid this.
With this change, we can add an attribute instead, and using the method
from Datadog.Trace etc becomes a build error.

## Implementation details

- Basically just renamed `PublicApi*` -> `InternalForTesting*`
- Decorated methods that were currently relying on comments/naming to
avoid being called

## Test coverage

Refactored the analyzer tests, so should still be covered the same

## Other details

Note that there are a bunch of comments for methods `// internal for
testing` which are a bit different. In those cases, we _do_ call it in
Datadog.Trace, the comment is just explaining why the method isn't
`private`. Those remain as-is, this attribute is purely if you have a
"don't call this method in production code, use that other one instead"
method 😄

Part of a stack

- #7786
- #7787
- #7788 👈
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants