Skip to content

Reduce warnings in test-applications samples#8519

Merged
NachoEchevarria merged 10 commits into
masterfrom
nacho/DecreaseWarningsSamples
May 5, 2026
Merged

Reduce warnings in test-applications samples#8519
NachoEchevarria merged 10 commits into
masterfrom
nacho/DecreaseWarningsSamples

Conversation

@NachoEchevarria

@NachoEchevarria NachoEchevarria commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes

Reduces build warnings in tracer/test/test-applications/**. On the "Build sample projects" CI log I sampled, the count drops from ~1,650 to ~18.

Reason for change

~17k warnings across a full CI pipeline have largely lost their signal. This is a first pass, scoped to the samples because it's the lowest-risk surface to clean up.

Implementation details

  • Nullable cleanup in Samples.Shared (compiled into most consumers via .shproj): SampleHelpers.cs and WebServer.cs get #nullable enable with proper annotations on reflection-lookup fields and method parameters. Several latent NREs the analyzer was flagging are now explicitly guarded. Two API-visible refinements:
    • GetActiveSpanContext() return type changed objectobject?. Failure paths now return null instead of a NoOpDisposable sentinel — callers reflect over the result via MethodInfo.Invoke(target, …), which would TargetException on a wrong-type sentinel. GetTraceId / GetSpanId / GetOrMakeSamplingDecision updated to short-circuit on null context.
    • InjectScope(…, object scope)(…, object? scope) with a scope is null guard, since its only documented external caller (Samples.Wcf/CalculatorService.cs) feeds GetActiveSpanContext() straight in.
    • TrackUserLogin{Success,Failure}EventMethod lookups moved from field initializers into the static constructor, removing a TracerType! shadow cast that worked only because of incidental co-nullity with EventTrackingSdk.
  • Compiler/LangVersion bumps to allow consumers to compile the now-nullable-enabled shared files:
    • StackExchange.Redis.AssemblyConflict.LegacyProject bumped <LangVersion> from 7.3 to latest (moved to the top-level PropertyGroup). The project regression-tests assembly-conflict resolution, not C# language version.
    • 9 old-style aspnet/security csprojs got <LangVersion>latest</LangVersion> added (Samples.AspNet.VersionConflict, Samples.AspNet472.LoaderOptimizationRegKey, Samples.AspNetAsyncHandler, Samples.AspNetMvc4, Samples.AspNetMvc5, Samples.Owin.Iis.WebApi2, Samples.WebForms, Samples.Security.WebApi, Samples.Security.WebForms). The default for old-format csprojs on net48 is C# 7.3, which rejects #nullable/Type?/!.
    • Samples.AspNet.VersionConflict and Samples.AspNetMvc5 additionally bump their pinned Microsoft.Net.Compilers from 2.10.0 → 4.0.1 (last stable before the .Toolset rename; supports up to C# 10). Without this, even with <LangVersion>latest</LangVersion> set, the pinned 2.10.0 Roslyn doesn't recognize C# 8 syntax.
  • NU1510 cleanup in 13 csprojs: deleted redundant <PackageReference> pins for legacy framework-assembly shims (System.Net.Requests, Microsoft.AspNetCore 2.2, System.Diagnostics.DiagnosticSource, System.Runtime.CompilerServices.Unsafe, System.ValueTuple, etc.) that are now part of the shared framework on every TFM these projects target. Samples.MySql's System.Text.Encoding.CodePages is kept behind Condition="$(TargetFramework.StartsWith('net4')) OR $(TargetFramework.StartsWith('netcoreapp'))"CodePagesEncodingProvider only entered the shared framework in .NET 5.
  • NU1510 suppressed (not deleted) in 5 csprojs where the "redundant" refs are doing real conflict-resolution work: Samples.Elasticsearch, Samples.Elasticsearch.V7, Samples.RabbitMQ, Samples.DataStreams.RabbitMQ, LogsInjection.Serilog. Their original comments explicitly said "avoid package downgrade errors" — the refs prevent transitive NU1605 conflicts from NEST 6.1.0 / Serilog.Sinks.File 2.2.0 / old RabbitMQ.Client via NETStandard.Library 1.6.0. First attempt deleted them and CI failed on nuget.exe restore (which is stricter than dotnet restore); the refs are retained with <NoWarn>NU1510</NoWarn> and a comment on each csproj.
  • Targeted <NoWarn> on samples that intentionally exercise deprecated APIs (each csproj carries a short comment explaining what's suppressed and why): CS0618 on SqlServer, StackExchange.Redis, MongoDB, Couchbase3, AWS.SQS, Hangfire; MSTEST0044/0057 on MSTestTests; CS8981 on GoogleProtobuf (protoc-generated lowercase aliases); NETSDK1206 on SqlServer (transitive win7-* RIDs in the legacy System.Data.SqlClient native dep).
  • Source-level fixes in Samples.OpenFeature/Evaluator.cs: client = null! field init, removed a redundant ?. that was confusing flow analysis, ! after null-asserting helper calls.

Test coverage

Each modified sample under the modern SDK style was built locally with dotnet build -c Release across its full TFM matrix — all produce 0 warnings / 0 errors. LegacyProject re-verified after the LangVersion bump. The old-style ASP.NET csprojs (which need msbuild + nuget.exe restore) couldn't be locally verified end-to-end and rely on CI; the changes there are mechanical (LangVersion / package-version edits). No new tests; this is a build-warning cleanup.

Other details

  • Not fixed: NU1603 in Samples.AWS.DynamoDBv2 (18 occ). The stale minimum versions live in generated PackageVersionsLatest*.g.props; fixing them requires running the GeneratePackageVersions Nuke target, which does a full tracer rebuild. Disproportionate for 18 cosmetic warnings — will self-heal on the next scheduled matrix regen.
  • Compiler/LangVersion bumps semantics: for the 9 csprojs where only <LangVersion>latest</LangVersion> was added, IL output is effectively unchanged (same machine Roslyn, just unlocking newer syntax that the project's own code doesn't use). For the 2 with Microsoft.Net.Compilers 2.10 → 4.0.1, Roslyn version differs so IL details (lambda lowering, async state machines) can differ but the C# semantics are equivalent — worth noting that Samples.AspNet.VersionConflict exists specifically to test assembly-conflict resolution, which depends on assembly references at runtime, not on compiler IL choices.

@github-actions github-actions Bot added the area:tests unit tests, integration tests label Apr 24, 2026
@NachoEchevarria NachoEchevarria changed the title Fix some samples warnings Reduce warnings in test-applications samples Apr 24, 2026
Restores the System.Net.*/System.IO.*/System.Threading.Channels
PackageReferences I had deleted for NU1510 in Samples.Elasticsearch,
Samples.Elasticsearch.V7, Samples.RabbitMQ, Samples.DataStreams.RabbitMQ,
and LogsInjection.Serilog. Their original comments ("avoid package
downgrade errors") were accurate: they resolve transitive NU1605
conflicts introduced by NEST 6.1.0 / Serilog.Sinks.File 2.2.0 /
RabbitMQ.Client < 5 via NETStandard.Library 1.6.0. dotnet restore is
lenient about these but nuget.exe restore (CI) fails hard with NU1605.

Adds <NoWarn>NU1510</NoWarn> per csproj with a comment explaining the
refs are retained for conflict resolution despite being flagged as
framework-provided.
@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Apr 24, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8519) 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
duration72.91 ± (72.88 - 73.25) ms72.43 ± (72.33 - 72.65) ms-0.7%
.NET Framework 4.8 - Bailout
duration79.51 ± (79.55 - 80.10) ms79.59 ± (79.37 - 80.00) ms+0.1%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1118.49 ± (1117.73 - 1124.47) ms1125.94 ± (1123.80 - 1131.91) ms+0.7%✅⬆️
.NET Core 3.1 - Baseline
process.internal_duration_ms22.90 ± (22.84 - 22.96) ms22.87 ± (22.81 - 22.94) ms-0.1%
process.time_to_main_ms86.93 ± (86.62 - 87.25) ms87.26 ± (86.95 - 87.56) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.91 ± (10.91 - 10.91) MB10.91 ± (10.91 - 10.92) MB+0.0%✅⬆️
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.55 ± (22.51 - 22.59) ms22.37 ± (22.33 - 22.41) ms-0.8%
process.time_to_main_ms85.99 ± (85.77 - 86.20) ms86.55 ± (86.26 - 86.83) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.89 ± (10.88 - 10.89) MB10.95 ± (10.94 - 10.95) MB+0.5%✅⬆️
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms205.00 ± (204.41 - 205.58) ms204.16 ± (203.66 - 204.65) ms-0.4%
process.time_to_main_ms565.53 ± (563.94 - 567.12) ms565.67 ± (564.04 - 567.30) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.71 ± (49.68 - 49.73) MB49.67 ± (49.64 - 49.71) MB-0.1%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms21.49 ± (21.43 - 21.55) ms21.08 ± (21.04 - 21.11) ms-1.9%
process.time_to_main_ms74.56 ± (74.29 - 74.84) ms72.67 ± (72.48 - 72.85) ms-2.5%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.60 ± (10.60 - 10.60) MB10.64 ± (10.64 - 10.64) MB+0.3%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms21.50 ± (21.45 - 21.55) ms21.40 ± (21.34 - 21.45) ms-0.5%
process.time_to_main_ms76.42 ± (76.18 - 76.66) ms76.80 ± (76.52 - 77.08) ms+0.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.71 ± (10.71 - 10.72) MB10.75 ± (10.74 - 10.75) MB+0.3%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms352.74 ± (350.77 - 354.72) ms354.45 ± (352.31 - 356.58) ms+0.5%✅⬆️
process.time_to_main_ms561.00 ± (559.69 - 562.32) ms561.27 ± (560.02 - 562.52) ms+0.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed51.04 ± (51.02 - 51.06) MB51.04 ± (51.02 - 51.06) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.38 ± (19.34 - 19.41) ms19.42 ± (19.37 - 19.46) ms+0.2%✅⬆️
process.time_to_main_ms72.41 ± (72.24 - 72.58) ms72.73 ± (72.54 - 72.93) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.67 ± (7.67 - 7.68) MB7.67 ± (7.66 - 7.67) MB-0.1%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.68 ± (19.63 - 19.74) ms19.42 ± (19.37 - 19.48) ms-1.3%
process.time_to_main_ms75.53 ± (75.27 - 75.79) ms73.87 ± (73.72 - 74.03) ms-2.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.73 ± (7.73 - 7.73) MB7.71 ± (7.71 - 7.72) MB-0.2%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms281.60 ± (278.91 - 284.28) ms282.85 ± (280.02 - 285.68) ms+0.4%✅⬆️
process.time_to_main_ms519.87 ± (518.63 - 521.11) ms520.67 ± (519.30 - 522.04) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed37.84 ± (37.82 - 37.87) MB37.77 ± (37.75 - 37.80) 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
duration198.34 ± (198.29 - 199.25) ms204.66 ± (204.14 - 205.60) ms+3.2%✅⬆️
.NET Framework 4.8 - Bailout
duration203.02 ± (202.97 - 204.02) ms202.21 ± (202.15 - 203.09) ms-0.4%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1223.36 ± (1222.76 - 1229.04) ms1223.34 ± (1222.38 - 1228.06) ms-0.0%
.NET Core 3.1 - Baseline
process.internal_duration_ms191.29 ± (190.84 - 191.74) ms191.93 ± (191.49 - 192.37) ms+0.3%✅⬆️
process.time_to_main_ms83.15 ± (82.93 - 83.36) ms83.38 ± (83.17 - 83.59) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed15.99 ± (15.98 - 16.01) MB16.05 ± (16.03 - 16.07) MB+0.3%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)20 ± (20 - 20)+1.1%✅⬆️
.NET Core 3.1 - Bailout
process.internal_duration_ms191.19 ± (190.72 - 191.66) ms192.04 ± (191.57 - 192.51) ms+0.4%✅⬆️
process.time_to_main_ms84.43 ± (84.22 - 84.65) ms84.99 ± (84.77 - 85.22) ms+0.7%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.12 ± (16.09 - 16.14) MB16.10 ± (16.08 - 16.12) MB-0.1%
runtime.dotnet.threads.count21 ± (21 - 21)21 ± (21 - 21)-0.1%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms378.62 ± (377.27 - 379.96) ms375.92 ± (374.81 - 377.03) ms-0.7%
process.time_to_main_ms562.52 ± (560.73 - 564.30) ms556.84 ± (555.28 - 558.39) ms-1.0%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed58.38 ± (58.32 - 58.44) MB58.51 ± (58.46 - 58.56) MB+0.2%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.0%
.NET 6 - Baseline
process.internal_duration_ms198.92 ± (198.31 - 199.52) ms196.60 ± (196.15 - 197.06) ms-1.2%
process.time_to_main_ms73.51 ± (73.25 - 73.77) ms72.65 ± (72.42 - 72.88) ms-1.2%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.30 ± (16.28 - 16.32) MB16.37 ± (16.35 - 16.39) MB+0.4%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.3%
.NET 6 - Bailout
process.internal_duration_ms200.73 ± (200.16 - 201.31) ms197.81 ± (197.33 - 198.29) ms-1.5%
process.time_to_main_ms75.16 ± (74.91 - 75.40) ms74.08 ± (73.89 - 74.28) ms-1.4%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.28 ± (16.26 - 16.30) MB16.40 ± (16.38 - 16.42) MB+0.7%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-0.8%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms569.39 ± (566.70 - 572.08) ms567.72 ± (564.75 - 570.69) ms-0.3%
process.time_to_main_ms557.46 ± (555.91 - 559.02) ms553.68 ± (552.35 - 555.02) ms-0.7%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.92 ± (61.88 - 61.95) MB61.83 ± (61.80 - 61.87) MB-0.1%
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.1%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms198.08 ± (197.57 - 198.59) ms195.83 ± (195.33 - 196.32) ms-1.1%
process.time_to_main_ms72.65 ± (72.39 - 72.90) ms72.08 ± (71.85 - 72.32) ms-0.8%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.68 ± (11.66 - 11.70) MB11.75 ± (11.73 - 11.77) MB+0.6%✅⬆️
runtime.dotnet.threads.count18 ± (18 - 18)18 ± (18 - 18)-0.3%
.NET 8 - Bailout
process.internal_duration_ms197.51 ± (196.94 - 198.08) ms194.98 ± (194.47 - 195.48) ms-1.3%
process.time_to_main_ms73.90 ± (73.66 - 74.15) ms73.16 ± (72.98 - 73.35) ms-1.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.74 ± (11.73 - 11.76) MB11.77 ± (11.75 - 11.79) MB+0.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.3%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms493.82 ± (490.70 - 496.94) ms492.77 ± (489.94 - 495.60) ms-0.2%
process.time_to_main_ms517.42 ± (516.29 - 518.56) ms511.82 ± (510.68 - 512.95) ms-1.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed51.53 ± (51.50 - 51.56) MB51.51 ± (51.48 - 51.54) MB-0.0%
runtime.dotnet.threads.count29 ± (29 - 30)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 (8519) - mean (72ms)  : 70, 75
    master - mean (73ms)  : 70, 76

    section Bailout
    This PR (8519) - mean (80ms)  : 75, 85
    master - mean (80ms)  : 76, 84

    section CallTarget+Inlining+NGEN
    This PR (8519) - mean (1,128ms)  : 1067, 1189
    master - mean (1,121ms)  : 1073, 1169

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 (8519) - mean (117ms)  : 111, 124
    master - mean (117ms)  : 111, 123

    section Bailout
    This PR (8519) - mean (116ms)  : 111, 121
    master - mean (115ms)  : 111, 119

    section CallTarget+Inlining+NGEN
    This PR (8519) - mean (807ms)  : 785, 829
    master - mean (807ms)  : 777, 837

Loading
FakeDbCommand (.NET 6)
gantt
    title Execution time (ms) FakeDbCommand (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8519) - mean (100ms)  : 96, 104
    master - mean (103ms)  : 97, 109

    section Bailout
    This PR (8519) - mean (105ms)  : 98, 111
    master - mean (105ms)  : 100, 109

    section CallTarget+Inlining+NGEN
    This PR (8519) - mean (943ms)  : 907, 979
    master - mean (942ms)  : 902, 982

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

    section Bailout
    This PR (8519) - mean (101ms)  : 98, 104
    master - mean (103ms)  : 98, 108

    section CallTarget+Inlining+NGEN
    This PR (8519) - mean (836ms)  : 773, 898
    master - mean (831ms)  : 784, 879

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 (8519) - mean (205ms)  : 194, 216
    master - mean (199ms)  : 192, 205

    section Bailout
    This PR (8519) - mean (203ms)  : 198, 207
    master - mean (203ms)  : 197, 210

    section CallTarget+Inlining+NGEN
    This PR (8519) - mean (1,225ms)  : 1184, 1266
    master - mean (1,226ms)  : 1181, 1271

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 (8519) - mean (285ms)  : 273, 296
    master - mean (283ms)  : 274, 293

    section Bailout
    This PR (8519) - mean (286ms)  : 274, 298
    master - mean (284ms)  : 277, 292

    section CallTarget+Inlining+NGEN
    This PR (8519) - mean (972ms)  : 946, 997
    master - mean (982ms)  : 949, 1014

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8519) - mean (278ms)  : 268, 288
    master - mean (282ms)  : 269, 294

    section Bailout
    This PR (8519) - mean (280ms)  : 271, 289
    master - mean (285ms)  : 273, 296

    section CallTarget+Inlining+NGEN
    This PR (8519) - mean (1,153ms)  : 1119, 1187
    master - mean (1,157ms)  : 1122, 1192

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8519) - mean (278ms)  : 270, 286
    master - mean (282ms)  : 272, 292

    section Bailout
    This PR (8519) - mean (278ms)  : 269, 287
    master - mean (282ms)  : 270, 294

    section CallTarget+Inlining+NGEN
    This PR (8519) - mean (1,038ms)  : 993, 1084
    master - mean (1,041ms)  : 993, 1090

Loading

@pr-commenter

pr-commenter Bot commented Apr 27, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-04-30 09:54:45

Comparing candidate commit 019f0c7 in PR branch nacho/DecreaseWarningsSamples with baseline commit 01f5157 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 27 metrics, 0 unstable metrics, 60 known flaky benchmarks, 27 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

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

  • 🟩 throughput [+7886.669op/s; +10163.979op/s] or [+6.629%; +8.543%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+318.428ms; +323.332ms] or [+158.015%; +160.449%]
  • 🟥 throughput [-43.044op/s; -39.474op/s] or [-7.745%; -7.102%]

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

  • 🟥 execution_time [+376.923ms; +378.817ms] or [+297.792%; +299.289%]
  • 🟩 throughput [+99.524op/s; +102.733op/s] or [+13.122%; +13.545%]

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

  • 🟥 execution_time [+394.200ms; +396.401ms] or [+348.852%; +350.800%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleMoreComplexBody net472

  • 🟥 allocated_mem [+1.308KB; +1.308KB] or [+27.529%; +27.541%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+9.977%; +9.987%]
  • 🟩 execution_time [-15.980ms; -11.768ms] or [-7.463%; -5.496%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+27.502%; +27.510%]

scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.AllCycleSimpleBody net472

  • 🟥 allocated_mem [+1.307KB; +1.307KB] or [+105.746%; +105.759%]
  • 🟥 throughput [-265839.143op/s; -262947.160op/s] or [-27.143%; -26.848%]

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

  • 🟥 allocated_mem [+471 bytes; +472 bytes] or [+38.558%; +38.566%]
  • 🟩 execution_time [-26.257ms; -21.402ms] or [-11.710%; -9.544%]

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

  • 🟥 allocated_mem [+1.272KB; +1.272KB] or [+105.292%; +105.304%]
  • 🟥 throughput [-141296.078op/s; -125300.216op/s] or [-20.302%; -18.003%]

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

  • 🟩 throughput [+7942.312op/s; +10933.488op/s] or [+5.054%; +6.957%]

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

  • 🟩 throughput [+7197.968op/s; +9832.741op/s] or [+5.734%; +7.833%]

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

  • 🟩 throughput [+352291.643op/s; +372096.233op/s] or [+11.747%; +12.407%]

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

  • 🟩 execution_time [-18.774ms; -14.415ms] or [-8.654%; -6.645%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net472

  • 🟥 execution_time [+299.587ms; +300.367ms] or [+149.693%; +150.083%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeArgs net6.0

  • 🟥 execution_time [+298.391ms; +301.546ms] or [+150.479%; +152.071%]

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

  • 🟥 execution_time [+299.890ms; +302.892ms] or [+151.061%; +152.573%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net472

  • 🟥 execution_time [+296.978ms; +297.793ms] or [+145.864%; +146.264%]

scenario:Benchmarks.Trace.Asm.AppSecEncoderBenchmark.EncodeLegacyArgs net6.0

  • 🟥 execution_time [+296.223ms; +298.644ms] or [+144.812%; +145.996%]

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

  • 🟥 execution_time [+300.208ms; +302.045ms] or [+150.044%; +150.962%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net6.0

  • 🟥 execution_time [+22.264µs; +45.846µs] or [+7.108%; +14.636%]
  • 🟥 throughput [-427.211op/s; -228.766op/s] or [-13.317%; -7.131%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.742ms; +300.393ms] or [+149.602%; +149.927%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net6.0

  • unstable execution_time [+364.140ms; +400.026ms] or [+395.653%; +434.644%]
  • 🟩 throughput [+1071.518op/s; +1212.958op/s] or [+8.805%; +9.967%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest netcoreapp3.1

  • unstable execution_time [+285.980ms; +325.971ms] or [+217.142%; +247.507%]
  • 🟩 throughput [+699.067op/s; +898.480op/s] or [+6.767%; +8.698%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+312.516ms; +358.552ms] or [+143.692%; +164.859%]
  • 🟥 throughput [-528.324op/s; -491.784op/s] or [-47.871%; -44.560%]

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

  • unstable execution_time [+205.756ms; +338.990ms] or [+87.685%; +144.463%]
  • 🟥 throughput [-666.826op/s; -583.401op/s] or [-44.477%; -38.913%]

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

  • 🟥 execution_time [+338.359ms; +345.890ms] or [+202.378%; +206.882%]
  • 🟥 throughput [-381.772op/s; -345.903op/s] or [-26.582%; -24.085%]

scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net6.0

  • 🟩 execution_time [-158.201µs; -137.543µs] or [-8.014%; -6.967%]
  • 🟩 throughput [+38.530op/s; +44.334op/s] or [+7.606%; +8.752%]

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

  • 🟩 throughput [+13.061op/s; +37.708op/s] or [+5.150%; +14.869%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+303.014ms; +304.577ms] or [+152.592%; +153.379%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net6.0

  • 🟥 execution_time [+300.601ms; +302.282ms] or [+150.632%; +151.474%]

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

  • 🟥 execution_time [+301.093ms; +304.206ms] or [+151.256%; +152.820%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+302.244ms; +303.622ms] or [+151.777%; +152.469%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net6.0

  • 🟥 execution_time [+297.060ms; +298.598ms] or [+146.883%; +147.644%]

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

  • 🟥 execution_time [+303.873ms; +307.425ms] or [+154.016%; +155.817%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+301.527ms; +302.720ms] or [+151.339%; +151.938%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net6.0

  • 🟥 execution_time [+299.303ms; +305.726ms] or [+149.175%; +152.376%]
  • 🟩 throughput [+39435.757op/s; +46585.997op/s] or [+7.831%; +9.250%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync netcoreapp3.1

  • 🟥 execution_time [+299.778ms; +302.141ms] or [+149.137%; +150.313%]

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

  • 🟩 execution_time [-16.063ms; -12.397ms] or [-7.469%; -5.765%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net6.0

  • 🟩 allocated_mem [-20.547KB; -20.526KB] or [-7.495%; -7.488%]
  • unstable execution_time [-50.799µs; +0.786µs] or [-10.040%; +0.155%]

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

  • unstable execution_time [+17.773µs; +147.596µs] or [+3.080%; +25.577%]
  • unstable throughput [-167.235op/s; +35.784op/s] or [-9.554%; +2.044%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net6.0

  • 🟥 execution_time [+5.665µs; +9.550µs] or [+13.390%; +22.573%]
  • 🟥 throughput [-4437.481op/s; -2688.134op/s] or [-18.680%; -11.316%]

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

  • unstable execution_time [-13.939µs; -6.689µs] or [-21.626%; -10.378%]
  • 🟩 throughput [+1734.104op/s; +3263.835op/s] or [+10.639%; +20.025%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+301.385ms; +302.625ms] or [+152.337%; +152.963%]

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

  • 🟥 execution_time [+303.295ms; +305.470ms] or [+154.376%; +155.483%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+301.101ms; +303.343ms] or [+150.738%; +151.861%]

scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net6.0

  • 🟩 throughput [+38350.281op/s; +41872.579op/s] or [+7.259%; +7.926%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+300.513ms; +302.327ms] or [+149.779%; +150.683%]

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

  • 🟥 execution_time [+301.764ms; +306.954ms] or [+151.532%; +154.137%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog netcoreapp3.1

  • 🟥 execution_time [+303.997ms; +306.383ms] or [+154.168%; +155.378%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+300.231ms; +300.847ms] or [+149.757%; +150.064%]
  • 🟩 throughput [+66140478.686op/s; +66393638.837op/s] or [+48.168%; +48.352%]

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

  • unstable execution_time [+382.844ms; +414.003ms] or [+476.134%; +514.886%]
  • 🟩 throughput [+996.432op/s; +1176.320op/s] or [+7.703%; +9.094%]

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

  • 🟥 execution_time [+299.387ms; +300.309ms] or [+149.327%; +149.787%]
  • 🟩 throughput [+18401719.916op/s; +19349917.021op/s] or [+8.151%; +8.571%]

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

  • 🟩 throughput [+105027.778op/s; +111886.375op/s] or [+9.806%; +10.446%]

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

  • 🟩 throughput [+53300.961op/s; +73300.261op/s] or [+6.169%; +8.484%]

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

  • 🟩 throughput [+100285.186op/s; +129760.672op/s] or [+7.762%; +10.044%]

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

  • 🟩 throughput [+83651.471op/s; +91760.657op/s] or [+8.308%; +9.113%]

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

  • 🟩 throughput [+51300.018op/s; +56408.001op/s] or [+9.315%; +10.243%]

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

  • 🟩 throughput [+25348.540op/s; +35073.779op/s] or [+5.674%; +7.851%]

scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net6.0

  • 🟩 throughput [+67826.784op/s; +86721.691op/s] or [+7.578%; +9.689%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net472
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorMoreComplexBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark netcoreapp3.1
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472
  • scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net472
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool net6.0
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool netcoreapp3.1
  • scenario:Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472
  • scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatBenchmark net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive net472
  • scenario:Benchmarks.Trace.RedisBenchmark.SendReceive netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishScope net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@NachoEchevarria NachoEchevarria added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Apr 27, 2026
@NachoEchevarria
NachoEchevarria marked this pull request as ready for review April 27, 2026 14:40
@NachoEchevarria
NachoEchevarria requested review from a team as code owners April 27, 2026 14:41

@andrewlock andrewlock left a comment

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.

Thanks, this is great!

FYI, I started an "all frameworks run" here, just to make sure we don't have any issues in earlier TFMs

Comment thread tracer/test/test-applications/integrations/Samples.MySql/Samples.MySql.csproj Outdated

var tracer = GetTracerInstance.Invoke(null, Array.Empty<object>());
return (IDisposable)StartActiveMethod.Invoke(tracer, new object[] { operationName });
return (IDisposable?)StartActiveMethod.Invoke(tracer, new object[] { operationName }) ?? new NoOpDisposable();

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.

Should this not return null, isn't this a change in behaviour? 🤔

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, technically a behavior change, but one that I would keep. The function declares IDisposable (non-null), and the original code returned null only when Invoke returned null while returning NoOpDisposable for other failures. The new code makes both paths consistent with the declared return type. Also, all callers use using (...) which handles both equivalently.

NachoEchevarria added a commit that referenced this pull request Apr 29, 2026
## Summary of changes
Eliminates the 32 native C++ build warnings (15 unique source positions)
emitted by the Windows native build.

## Reason for change
Follow-up to #8519 (sample warnings). Native was the next cluster where
every warning is a real fix rather than structural noise.

## Implementation details
- **C4018** (signed/unsigned `<`): `auto x = 0` → `size_t x = 0` in 5
loops in `rejit_handler.cpp` and `int i = 2` → `size_t i = 2` in shared
`cor_profiler.cpp`. Loop vars only used as indices.
- **C4267 / C4244** (`size_t` / `ptrdiff_t` narrowing into `ULONG` /
`DWORD` / `int` API params): explicit `static_cast` at the call sites in
`calltarget_tokens.cpp`, `fault_tolerant_rewriter.cpp`,
`process_helper.cpp`, `tracer_tokens.cpp`, and the two generated
`.g.cpp` files. All inputs bounded well below the cast range. The
corresponding generator templates in
`tracer/build/_build/CodeGenerators/` are updated alongside the
generated outputs.
- **`SignatureBuilder::EnsureBufferSpace`** param `int` → `size_t` to
match the rest of the class. Also clears a latent signed/unsigned mix in
`_offset + size >= _length`.
- **`fault_tolerant_rewriter.cpp:86,97`**: `std::string(wstr.begin(),
wstr.end())` → `shared::ToString(wstr)` (the C4244 trigger inside
`<xstring>`). Identical behavior for ASCII generic-type names;
UTF-8-correct for non-ASCII where the old form silently truncated.

## Test coverage

## Other details

@bouwkast bouwkast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice!

@NachoEchevarria
NachoEchevarria merged commit f6ebeb2 into master May 5, 2026
151 of 153 checks passed
@NachoEchevarria
NachoEchevarria deleted the nacho/DecreaseWarningsSamples branch May 5, 2026 08:38
@github-actions github-actions Bot added this to the vNext-v3 milestone May 5, 2026
NachoEchevarria added a commit that referenced this pull request May 7, 2026
## Summary of changes

Part 3 of the warning-reduction series. ~25 warning sources eliminated
across sample/regression projects and the runner tool.

Previous PRs:
#8534
#8519

## Reason for change

CI emits ~17k warnings; chipping away at the batch surfaced after parts
1-2 merged.

## Implementation details

- **Deleted redundant `PackageReference`s** (NU1510 — flagged
framework-provided on the target TFM and not needed):
`Microsoft.AspNetCore.Mvc.RazorPages`,
`Microsoft.Extensions.Logging.Debug`,
`System.Runtime.InteropServices.RuntimeInformation`,
`System.Data.Common`, `System.Net.Http 4.3.4`, `System.IO.FileSystem`,
`System.Net.NameResolution`.
- **Targeted `<NoWarn>` (with comment explaining why the reference is
load-bearing)**:
- NU1510 for `System.Memory` / `System.Net.Http` on net4x targets —
Probes, CallTargetNativeTest, VersionConflict.{1x,2x},
DuplicateTypeProxy.
- MSTEST0001/0044/0057 + NU1701 — MSTestTests, MSTestTests2,
MSTestTestsRetries.
- NETSDK1201 — ManualInstrumentation; ASP0014 —
Ocelot.DistributedTracing.
- IL2104 — `Datadog.Trace.Tools.Runner` (third-party assemblies already
rooted via `<TrimmerRootAssembly>`).
- **Nullability fixes**: `SampleHelpers.TrySetServiceName` parameter
widened to `string?` with an early-return guard so we don't
reflection-invoke the setter with null; redundant `evaluation?.Error`
removed in `Samples.FeatureFlags/Evaluator.cs` (was de-narrowing the
flow state and tripping CS8602 on net48); `Samples.GrpcDotNet/Worker.cs`
`[CallerMemberName]` default fixed.

## Test coverage

No behavioral changes. CI verifies the warning count drops without
breaking compilation.

## Other details

---------

Co-authored-by: Andrew Lock <[email protected]>
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 area:tests unit tests, integration tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants