Skip to content

[AAP] Migrate libddwaf to 2.0.1 - #8959

Merged
dromanol merged 10 commits into
masterfrom
dani/aap/waf_v2.0.0
Jul 31, 2026
Merged

[AAP] Migrate libddwaf to 2.0.1#8959
dromanol merged 10 commits into
masterfrom
dani/aap/waf_v2.0.0

Conversation

@dromanol

@dromanol dromanol commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

Migrates the libddwaf native dependency from 1.30.0 to 2.0.1: new bindings for the 2.0 object model (16 byte ddwaf_object, map keys in a separate ddwaf_object_kv), ddwaf_config replaced by builder configuration, ephemeral data replaced by subcontexts, both encoders migrated, and 1.x moved to the incompatible list. Managed only — no C++ in this repo calls the WAF API.

Reason for change

libddwaf 2.0 is a breaking redesign of the C API (allocator-based ownership, smaller ddwaf_object, no ddwaf_config, subcontexts). Staying on 1.x means missing every future WAF release.

Implementation details

Worth a reviewer's attention:

  • One subcontext per ephemeral batch, not per request. A subcontext inherits a copy of the parent's evaluation caches, so a reused one swallowed every RASP match after the first. Per-batch matches v1 exactly.
  • DDWAF_MATCH now means "produced an event, attribute, etc", so attribute-only runs (fingerprints, API Security) return Match. ShouldReportSecurityResult therefore requires events, otherwise RuleTriggered would count every API Security run as an attack.
  • Strings are UTF-8 in both directions. Decoding was Marshal.PtrToStringAnsi, and encoding passed an ANSI-marshalled string with a UTF-16 count, so length and encoding already disagreed for non-ASCII. EncoderLegacy converts into a reused per-thread buffer, which is safe because libddwaf copies the bytes it is handed.
  • Container sizes are uint16, so both encoders clamp to 65535 regardless of applySafetyLimits, reporting the truncation through the existing telemetry.

Test coverage

  • New DdwafObjectLayoutTests pins the object/kv sizes and every field offset, round-trips a map built by libddwaf itself, and cross-checks the hand-written encoder against a natively built object — a wrong offset corrupts memory rather than failing to compile.
  • Security unit tests pass on net48, netcoreapp2.1/3.1, net8.0 and net10.0, and with DD_EXPERIMENTAL_APPSEC_USE_UNSAFE_ENCODER=true.
  • Snapshots updated for the two intended behaviour changes: _dd.appsec.waf.version, and key_path array indices now being integers (["arg",0]).

Other details

Jira: APPSEC-69462

Removed a dead libddwaf 1.8.2 PackageReference from Datadog.Trace.Security.IntegrationTests.

🤖 Generated with Claude Code

libddwaf 2.0 is a deliberate redesign of the C API: explicit memory
ownership through allocators, a 16 byte ddwaf_object with map keys moved
out into ddwaf_object_kv, no ddwaf_config, and subcontexts in place of
ephemeral data.

- pin 2.0.1 and require major >= 2, moving all 1.x to the incompatible list
- rewrite the native bindings to the new object model and API surface
- move the obfuscator regexes to a builder configuration
- evaluate ephemeral (RASP) batches in a per-call subcontext
- migrate both encoders, clamping containers to the new uint16 limit
- require events to be present before reporting a security result, since
  2.x also returns DDWAF_MATCH for attribute-only runs

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
dromanol and others added 2 commits July 29, 2026 20:55
…s.csv

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Nothing ran in that case, so the call's wall clock would otherwise leak into
the aggregated WAF runtime.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dd-trace-dotnet-ci-bot

dd-trace-dotnet-ci-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing This PR (8959) 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
duration70.89 ± (70.93 - 71.25) ms74.10 ± (73.97 - 74.50) ms+4.5%✅⬆️
.NET Framework 4.8 - Bailout
duration78.52 ± (78.20 - 78.86) ms76.25 ± (76.18 - 76.51) ms-2.9%
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1093.77 ± (1092.38 - 1099.92) ms1093.01 ± (1092.37 - 1099.86) ms-0.1%
.NET Core 3.1 - Baseline
process.internal_duration_ms22.32 ± (22.26 - 22.37) ms22.12 ± (22.08 - 22.16) ms-0.9%
process.time_to_main_ms83.75 ± (83.41 - 84.09) ms83.27 ± (83.02 - 83.51) ms-0.6%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed11.01 ± (11.01 - 11.02) MB11.00 ± (10.99 - 11.00) MB-0.1%
runtime.dotnet.threads.count12 ± (12 - 12)12 ± (12 - 12)+0.0%
.NET Core 3.1 - Bailout
process.internal_duration_ms22.30 ± (22.26 - 22.33) ms21.98 ± (21.95 - 22.01) ms-1.4%
process.time_to_main_ms85.00 ± (84.75 - 85.25) ms83.17 ± (83.01 - 83.32) ms-2.2%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed11.05 ± (11.05 - 11.05) MB11.05 ± (11.04 - 11.05) MB-0.1%
runtime.dotnet.threads.count13 ± (13 - 13)13 ± (13 - 13)+0.0%
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms209.43 ± (208.56 - 210.31) ms211.79 ± (210.78 - 212.79) ms+1.1%✅⬆️
process.time_to_main_ms537.32 ± (536.00 - 538.63) ms542.43 ± (541.06 - 543.81) ms+1.0%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed49.62 ± (49.59 - 49.64) MB49.47 ± (49.44 - 49.50) MB-0.3%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)-0.4%
.NET 6 - Baseline
process.internal_duration_ms20.97 ± (20.93 - 21.00) ms20.93 ± (20.90 - 20.96) ms-0.2%
process.time_to_main_ms72.03 ± (71.83 - 72.23) ms71.93 ± (71.77 - 72.10) ms-0.1%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.72 ± (10.72 - 10.73) MB10.74 ± (10.74 - 10.75) MB+0.2%✅⬆️
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 6 - Bailout
process.internal_duration_ms20.97 ± (20.93 - 21.01) ms20.81 ± (20.77 - 20.85) ms-0.8%
process.time_to_main_ms74.70 ± (74.46 - 74.93) ms72.92 ± (72.76 - 73.09) ms-2.4%
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed10.84 ± (10.84 - 10.84) MB10.85 ± (10.85 - 10.86) MB+0.1%✅⬆️
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms371.62 ± (369.60 - 373.63) ms371.02 ± (368.99 - 373.04) ms-0.2%
process.time_to_main_ms544.81 ± (543.58 - 546.03) ms546.44 ± (545.40 - 547.47) ms+0.3%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed50.65 ± (50.62 - 50.67) MB50.64 ± (50.62 - 50.66) MB-0.0%
runtime.dotnet.threads.count28 ± (28 - 28)28 ± (28 - 28)+0.0%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms19.10 ± (19.07 - 19.13) ms19.53 ± (19.48 - 19.57) ms+2.2%✅⬆️
process.time_to_main_ms70.17 ± (70.04 - 70.29) ms74.04 ± (73.81 - 74.27) ms+5.5%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.76 ± (7.76 - 7.77) MB7.76 ± (7.75 - 7.76) MB-0.0%
runtime.dotnet.threads.count10 ± (10 - 10)10 ± (10 - 10)+0.0%
.NET 8 - Bailout
process.internal_duration_ms19.16 ± (19.14 - 19.19) ms19.19 ± (19.16 - 19.22) ms+0.1%✅⬆️
process.time_to_main_ms72.44 ± (72.21 - 72.67) ms72.51 ± (72.34 - 72.68) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed7.82 ± (7.81 - 7.82) MB7.80 ± (7.80 - 7.81) MB-0.2%
runtime.dotnet.threads.count11 ± (11 - 11)11 ± (11 - 11)+0.0%
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms298.88 ± (296.44 - 301.32) ms298.52 ± (296.20 - 300.83) ms-0.1%
process.time_to_main_ms493.57 ± (492.49 - 494.66) ms494.32 ± (493.29 - 495.35) ms+0.2%✅⬆️
runtime.dotnet.exceptions.count0 ± (0 - 0)0 ± (0 - 0)+0.0%
runtime.dotnet.mem.committed38.04 ± (38.02 - 38.07) MB38.07 ± (38.05 - 38.10) MB+0.1%✅⬆️
runtime.dotnet.threads.count27 ± (27 - 27)27 ± (27 - 27)-0.7%

HttpMessageHandler

Metric Master (Mean ± 95% CI) Current (Mean ± 95% CI) Change Status
.NET Framework 4.8 - Baseline
duration208.47 ± (208.51 - 209.60) ms208.66 ± (208.63 - 209.60) ms+0.1%✅⬆️
.NET Framework 4.8 - Bailout
duration213.61 ± (213.27 - 214.01) ms213.62 ± (213.35 - 214.12) ms+0.0%✅⬆️
.NET Framework 4.8 - CallTarget+Inlining+NGEN
duration1246.69 ± (1248.03 - 1253.95) ms1244.06 ± (1245.12 - 1251.25) ms-0.2%
.NET Core 3.1 - Baseline
process.internal_duration_ms200.43 ± (200.09 - 200.76) ms200.12 ± (199.77 - 200.47) ms-0.2%
process.time_to_main_ms88.78 ± (88.50 - 89.07) ms88.07 ± (87.85 - 88.29) ms-0.8%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.07 ± (16.04 - 16.09) MB16.18 ± (16.15 - 16.21) MB+0.7%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)-1.1%
.NET Core 3.1 - Bailout
process.internal_duration_ms200.51 ± (200.23 - 200.80) ms200.49 ± (200.19 - 200.78) ms-0.0%
process.time_to_main_ms90.14 ± (89.93 - 90.35) ms89.63 ± (89.45 - 89.80) ms-0.6%
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed16.04 ± (16.02 - 16.06) MB16.22 ± (16.20 - 16.24) MB+1.1%✅⬆️
runtime.dotnet.threads.count21 ± (20 - 21)21 ± (20 - 21)+0.0%✅⬆️
.NET Core 3.1 - CallTarget+Inlining+NGEN
process.internal_duration_ms395.43 ± (394.27 - 396.59) ms395.67 ± (394.59 - 396.75) ms+0.1%✅⬆️
process.time_to_main_ms557.96 ± (556.82 - 559.11) ms558.74 ± (557.55 - 559.93) ms+0.1%✅⬆️
runtime.dotnet.exceptions.count3 ± (3 - 3)3 ± (3 - 3)+0.0%
runtime.dotnet.mem.committed59.63 ± (59.44 - 59.81) MB59.63 ± (59.45 - 59.81) MB-0.0%
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)+0.4%✅⬆️
.NET 6 - Baseline
process.internal_duration_ms205.95 ± (205.54 - 206.36) ms204.75 ± (204.43 - 205.07) ms-0.6%
process.time_to_main_ms77.87 ± (77.61 - 78.14) ms77.04 ± (76.83 - 77.25) ms-1.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.44 ± (16.42 - 16.47) MB16.48 ± (16.46 - 16.51) MB+0.2%✅⬆️
runtime.dotnet.threads.count20 ± (19 - 20)19 ± (19 - 19)-0.4%
.NET 6 - Bailout
process.internal_duration_ms205.09 ± (204.74 - 205.44) ms204.44 ± (204.15 - 204.72) ms-0.3%
process.time_to_main_ms78.48 ± (78.30 - 78.66) ms78.46 ± (78.28 - 78.64) ms-0.0%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed16.41 ± (16.38 - 16.43) MB16.48 ± (16.46 - 16.50) MB+0.5%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 21)+0.9%✅⬆️
.NET 6 - CallTarget+Inlining+NGEN
process.internal_duration_ms579.03 ± (576.35 - 581.71) ms580.31 ± (577.27 - 583.35) ms+0.2%✅⬆️
process.time_to_main_ms574.48 ± (573.56 - 575.40) ms574.03 ± (572.82 - 575.24) ms-0.1%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed61.38 ± (61.33 - 61.43) MB61.40 ± (61.34 - 61.47) MB+0.0%✅⬆️
runtime.dotnet.threads.count31 ± (31 - 31)31 ± (31 - 31)+0.2%✅⬆️
.NET 8 - Baseline
process.internal_duration_ms205.18 ± (204.83 - 205.53) ms204.94 ± (204.57 - 205.31) ms-0.1%
process.time_to_main_ms77.15 ± (76.89 - 77.41) ms76.93 ± (76.70 - 77.16) ms-0.3%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.80 ± (11.77 - 11.82) MB11.83 ± (11.81 - 11.84) MB+0.2%✅⬆️
runtime.dotnet.threads.count19 ± (19 - 19)19 ± (19 - 19)-0.6%
.NET 8 - Bailout
process.internal_duration_ms204.91 ± (204.60 - 205.23) ms204.45 ± (204.12 - 204.77) ms-0.2%
process.time_to_main_ms78.13 ± (77.95 - 78.31) ms78.41 ± (78.26 - 78.57) ms+0.4%✅⬆️
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed11.81 ± (11.78 - 11.83) MB11.89 ± (11.87 - 11.91) MB+0.7%✅⬆️
runtime.dotnet.threads.count20 ± (20 - 20)20 ± (20 - 20)+1.0%✅⬆️
.NET 8 - CallTarget+Inlining+NGEN
process.internal_duration_ms518.62 ± (513.59 - 523.65) ms510.23 ± (505.60 - 514.86) ms-1.6%
process.time_to_main_ms525.82 ± (525.05 - 526.60) ms522.87 ± (522.06 - 523.68) ms-0.6%
runtime.dotnet.exceptions.count4 ± (4 - 4)4 ± (4 - 4)+0.0%
runtime.dotnet.mem.committed51.38 ± (51.33 - 51.43) MB51.51 ± (51.46 - 51.55) MB+0.2%✅⬆️
runtime.dotnet.threads.count30 ± (30 - 30)30 ± (30 - 30)-0.4%
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 (8959) - mean (74ms)  : 70, 78
    master - mean (71ms)  : 69, 73

    section Bailout
    This PR (8959) - mean (76ms)  : 74, 79
    master - mean (79ms)  : 73, 84

    section CallTarget+Inlining+NGEN
    This PR (8959) - mean (1,096ms)  : 1042, 1150
    master - mean (1,096ms)  : 1041, 1152

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 (8959) - mean (112ms)  : 107, 118
    master - mean (113ms)  : 107, 120

    section Bailout
    This PR (8959) - mean (112ms)  : 109, 114
    master - mean (115ms)  : 110, 120

    section CallTarget+Inlining+NGEN
    This PR (8959) - mean (792ms)  : 766, 818
    master - mean (785ms)  : 766, 803

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

    section Bailout
    This PR (8959) - mean (100ms)  : 98, 102
    master - mean (102ms)  : 98, 107

    section CallTarget+Inlining+NGEN
    This PR (8959) - mean (959ms)  : 919, 999
    master - mean (948ms)  : 900, 995

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

    section Bailout
    This PR (8959) - mean (99ms)  : 96, 103
    master - mean (99ms)  : 95, 104

    section CallTarget+Inlining+NGEN
    This PR (8959) - mean (826ms)  : 776, 877
    master - mean (824ms)  : 775, 873

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 (8959) - mean (209ms)  : 204, 214
    master - mean (209ms)  : 203, 215

    section Bailout
    This PR (8959) - mean (214ms)  : 210, 218
    master - mean (214ms)  : 210, 217

    section CallTarget+Inlining+NGEN
    This PR (8959) - mean (1,248ms)  : 1205, 1292
    master - mean (1,251ms)  : 1208, 1294

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 (8959) - mean (299ms)  : 294, 304
    master - mean (299ms)  : 293, 306

    section Bailout
    This PR (8959) - mean (300ms)  : 296, 304
    master - mean (301ms)  : 296, 306

    section CallTarget+Inlining+NGEN
    This PR (8959) - mean (997ms)  : 978, 1016
    master - mean (995ms)  : 971, 1019

Loading
HttpMessageHandler (.NET 6)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8959) - mean (292ms)  : 288, 296
    master - mean (294ms)  : 289, 299

    section Bailout
    This PR (8959) - mean (293ms)  : 288, 298
    master - mean (293ms)  : 289, 298

    section CallTarget+Inlining+NGEN
    This PR (8959) - mean (1,192ms)  : 1161, 1224
    master - mean (1,191ms)  : 1147, 1236

Loading
HttpMessageHandler (.NET 8)
gantt
    title Execution time (ms) HttpMessageHandler (.NET 8)
    dateFormat  x
    axisFormat %Q
    todayMarker off
    section Baseline
    This PR (8959) - mean (293ms)  : 288, 299
    master - mean (293ms)  : 288, 299

    section Bailout
    This PR (8959) - mean (293ms)  : 288, 299
    master - mean (294ms)  : 290, 298

    section CallTarget+Inlining+NGEN
    This PR (8959) - mean (1,068ms)  : 1003, 1132
    master - mean (1,076ms)  : 1006, 1146

Loading

@pr-commenter

pr-commenter Bot commented Jul 29, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-30 18:21:39

Comparing candidate commit bde2214 in PR branch dani/aap/waf_v2.0.0 with baseline commit 17aa8f5 in branch master.

📊 Benchmarking dashboard

Found 1 performance improvements and 0 performance regressions! Performance is the same for 71 metrics, 0 unstable metrics, 64 known flaky benchmarks, 62 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 ----------------------------------'

scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TracerBenchmark.StartActiveSpan net6.0

  • 🟩 throughput [+13721.836op/s; +19481.476op/s] or [+5.009%; +7.112%]

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 net472

  • 🟥 throughput [-8790.914op/s; -8399.668op/s] or [-10.423%; -9.960%]

scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild netcoreapp3.1

  • 🟥 throughput [-7669.510op/s; -6394.015op/s] or [-7.798%; -6.501%]

scenario:Benchmarks.Trace.AgentWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • 🟥 execution_time [+306.964ms; +314.468ms] or [+152.326%; +156.050%]
  • 🟥 throughput [-45.628op/s; -41.532op/s] or [-8.209%; -7.472%]

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

  • 🟥 execution_time [+375.634ms; +379.792ms] or [+296.774%; +300.059%]
  • 🟩 throughput [+83.603op/s; +87.358op/s] or [+11.023%; +11.518%]

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

  • 🟥 execution_time [+394.382ms; +396.244ms] or [+349.013%; +350.660%]

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

  • 🟥 allocated_mem [+4.693KB; +4.694KB] or [+98.806%; +98.821%]
  • 🟥 throughput [-60115.215op/s; -59691.547op/s] or [-46.773%; -46.443%]

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

  • 🟥 allocated_mem [+3.816KB; +3.816KB] or [+80.699%; +80.711%]
  • 🟩 execution_time [-15.766ms; -11.579ms] or [-7.363%; -5.408%]
  • 🟥 throughput [-60286.493op/s; -57515.708op/s] or [-44.006%; -41.983%]

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

  • 🟥 allocated_mem [+4.544KB; +4.544KB] or [+98.261%; +98.274%]
  • 🟥 throughput [-48617.286op/s; -46368.682op/s] or [-43.956%; -41.923%]

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

  • 🟥 allocated_mem [+1.315KB; +1.315KB] or [+106.388%; +106.404%]
  • 🟥 throughput [-270891.223op/s; -266559.652op/s] or [-27.659%; -27.217%]

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

  • 🟥 allocated_mem [+479 bytes; +480 bytes] or [+39.212%; +39.221%]
  • 🟩 execution_time [-25.999ms; -21.137ms] or [-11.595%; -9.426%]
  • 🟥 throughput [-84219.947op/s; -61259.420op/s] or [-8.997%; -6.544%]

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

  • 🟥 allocated_mem [+1.280KB; +1.280KB] or [+105.947%; +105.963%]
  • 🟥 throughput [-169144.612op/s; -152139.223op/s] or [-24.303%; -21.859%]

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

  • 🟥 allocated_mem [+3.378KB; +3.378KB] or [+89.003%; +89.017%]
  • 🟥 throughput [-72990.836op/s; -72202.758op/s] or [-49.122%; -48.592%]

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

  • 🟥 allocated_mem [+3.336KB; +3.336KB] or [+88.150%; +88.161%]
  • 🟥 throughput [-72852.189op/s; -69974.874op/s] or [-46.355%; -44.524%]

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

  • 🟥 allocated_mem [+3.264KB; +3.264KB] or [+88.493%; +88.506%]
  • 🟥 throughput [-56239.412op/s; -53620.002op/s] or [-44.802%; -42.715%]

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

  • 🟩 throughput [+251849.321op/s; +305283.636op/s] or [+8.398%; +10.179%]

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

  • 🟩 execution_time [-19.613ms; -15.253ms] or [-9.041%; -7.031%]

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

  • 🟩 allocated_mem [-13.759KB; -13.757KB] or [-42.326%; -42.318%]
  • 🟥 execution_time [+300.018ms; +300.938ms] or [+149.909%; +150.369%]
  • 🟩 throughput [+973.258op/s; +990.404op/s] or [+10.750%; +10.939%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+297.457ms; +311.955ms] or [+150.008%; +157.320%]
  • 🟩 throughput [+2118.902op/s; +2503.983op/s] or [+16.206%; +19.152%]

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

  • 🟩 allocated_mem [-13.722KB; -13.718KB] or [-42.341%; -42.329%]
  • 🟥 execution_time [+300.235ms; +302.631ms] or [+151.235%; +152.442%]
  • 🟩 throughput [+1819.806op/s; +1953.016op/s] or [+17.569%; +18.855%]

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

  • 🟥 execution_time [+296.122ms; +297.152ms] or [+145.444%; +145.949%]
  • 🟩 throughput [+583.506op/s; +597.700op/s] or [+15.469%; +15.845%]

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

  • 🟥 execution_time [+294.738ms; +298.911ms] or [+144.087%; +146.127%]
  • 🟩 throughput [+2807.448op/s; +2866.400op/s] or [+40.787%; +41.643%]

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

  • 🟥 execution_time [+300.957ms; +301.789ms] or [+150.418%; +150.834%]
  • 🟩 throughput [+1347.748op/s; +1390.278op/s] or [+26.752%; +27.596%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmark net472

  • 🟩 execution_time [-148.331µs; -144.149µs] or [-30.454%; -29.596%]
  • 🟩 throughput [+867.320op/s; +895.991op/s] or [+42.242%; +43.639%]

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

  • 🟩 execution_time [-138.926µs; -112.293µs] or [-31.863%; -25.754%]
  • 🟩 throughput [+861.214op/s; +982.867op/s] or [+37.442%; +42.731%]

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

  • 🟩 execution_time [-141.381µs; -119.359µs] or [-30.291%; -25.573%]
  • 🟩 throughput [+765.506op/s; +848.865op/s] or [+35.337%; +39.185%]

scenario:Benchmarks.Trace.Asm.AppSecWafBenchmark.RunWafRealisticBenchmarkWithAttack net472

  • 🟩 execution_time [-127.842µs; -123.582µs] or [-34.516%; -33.366%]
  • 🟩 throughput [+1363.575op/s; +1413.583op/s] or [+50.500%; +52.353%]

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

  • 🟩 execution_time [-104.270µs; -80.713µs] or [-33.288%; -25.767%]
  • 🟩 throughput [+1222.811op/s; +1422.844op/s] or [+38.119%; +44.354%]

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

  • 🟩 execution_time [-138.299µs; -115.877µs] or [-37.833%; -31.699%]
  • 🟩 throughput [+1338.899op/s; +1477.342op/s] or [+48.048%; +53.016%]

scenario:Benchmarks.Trace.AspNetCoreBenchmark.SendRequest net472

  • 🟥 execution_time [+299.848ms; +300.620ms] or [+149.655%; +150.040%]

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

  • 🟥 execution_time [+425.211ms; +432.547ms] or [+462.009%; +469.980%]

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

  • unstable execution_time [+293.856ms; +344.876ms] or [+223.122%; +261.861%]

scenario:Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces net472

  • unstable execution_time [+296.432ms; +343.344ms] or [+136.296%; +157.866%]
  • 🟥 throughput [-501.478op/s; -466.938op/s] or [-45.439%; -42.309%]

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

  • unstable execution_time [+211.175ms; +344.388ms] or [+89.994%; +146.764%]
  • 🟥 throughput [-666.675op/s; -583.188op/s] or [-44.467%; -38.899%]

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

  • 🟥 execution_time [+338.179ms; +350.955ms] or [+202.270%; +209.912%]
  • 🟥 throughput [-416.843op/s; -378.099op/s] or [-29.024%; -26.327%]

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

  • 🟩 execution_time [-188.968µs; -133.089µs] or [-9.572%; -6.742%]
  • 🟩 throughput [+39.272op/s; +53.492op/s] or [+7.753%; +10.560%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearch net472

  • 🟥 execution_time [+300.584ms; +302.116ms] or [+151.368%; +152.140%]

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

  • 🟥 execution_time [+301.504ms; +303.216ms] or [+151.084%; +151.942%]

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

  • 🟥 execution_time [+299.856ms; +303.607ms] or [+150.635%; +152.519%]
  • 🟩 throughput [+25666.856op/s; +33201.666op/s] or [+5.407%; +6.994%]

scenario:Benchmarks.Trace.ElasticsearchBenchmark.CallElasticsearchAsync net472

  • 🟥 execution_time [+301.978ms; +303.641ms] or [+151.643%; +152.478%]

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

  • 🟥 execution_time [+298.124ms; +300.406ms] or [+147.409%; +148.537%]

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

  • 🟥 execution_time [+301.963ms; +305.852ms] or [+153.048%; +155.019%]

scenario:Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync net472

  • 🟥 execution_time [+299.018ms; +301.198ms] or [+150.080%; +151.174%]

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

  • 🟥 execution_time [+300.787ms; +302.914ms] or [+149.915%; +150.975%]
  • 🟩 throughput [+53028.929op/s; +57185.350op/s] or [+10.530%; +11.355%]

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

  • 🟥 execution_time [+301.297ms; +305.074ms] or [+149.893%; +151.772%]

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

  • 🟩 execution_time [-16.467ms; -12.801ms] or [-7.657%; -5.953%]

scenario:Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark net472

  • unstable execution_time [+16.097µs; +60.318µs] or [+3.976%; +14.899%]

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

  • 🟩 allocated_mem [-19.277KB; -19.253KB] or [-7.032%; -7.023%]
  • unstable execution_time [-35.512µs; +20.243µs] or [-7.019%; +4.001%]

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

  • unstable execution_time [-72.171µs; -10.318µs] or [-12.507%; -1.788%]
  • unstable throughput [+50.288op/s; +227.035op/s] or [+2.873%; +12.971%]

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

  • unstable execution_time [+7.341µs; +12.906µs] or [+17.352%; +30.505%]
  • 🟥 throughput [-5376.148op/s; -3374.041op/s] or [-22.632%; -14.204%]

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

  • unstable execution_time [-14.600µs; -6.786µs] or [-22.651%; -10.529%]
  • unstable throughput [+1742.143op/s; +3433.934op/s] or [+10.689%; +21.068%]

scenario:Benchmarks.Trace.Log4netBenchmark.EnrichedLog net472

  • 🟥 execution_time [+300.613ms; +302.332ms] or [+151.947%; +152.815%]

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

  • 🟥 execution_time [+302.225ms; +304.394ms] or [+153.832%; +154.936%]

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

  • 🟥 execution_time [+300.476ms; +304.263ms] or [+150.425%; +152.321%]

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

  • 🟩 throughput [+36303.281op/s; +41251.874op/s] or [+6.871%; +7.808%]

scenario:Benchmarks.Trace.SerilogBenchmark.EnrichedLog net472

  • 🟥 execution_time [+296.669ms; +298.663ms] or [+147.863%; +148.857%]

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

  • 🟥 execution_time [+300.881ms; +302.156ms] or [+151.088%; +151.728%]

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

  • 🟥 execution_time [+303.043ms; +305.412ms] or [+153.684%; +154.885%]

scenario:Benchmarks.Trace.SingleSpanAspNetCoreBenchmark.SingleSpanAspNetCore net472

  • 🟥 execution_time [+299.749ms; +300.478ms] or [+149.516%; +149.880%]
  • 🟩 throughput [+64968957.284op/s; +65977066.045op/s] or [+47.314%; +48.049%]

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

  • unstable execution_time [+338.523ms; +395.299ms] or [+421.014%; +491.625%]

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

  • 🟥 execution_time [+299.327ms; +300.561ms] or [+149.297%; +149.913%]
  • 🟩 throughput [+18197363.330op/s; +19179337.485op/s] or [+8.060%; +8.495%]

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

  • 🟩 throughput [+67664.802op/s; +78056.452op/s] or [+6.318%; +7.288%]

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

  • 🟩 throughput [+74576.892op/s; +82863.925op/s] or [+7.407%; +8.230%]

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

  • 🟩 throughput [+36002.948op/s; +41298.517op/s] or [+6.537%; +7.499%]

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

  • 🟩 throughput [+56046.026op/s; +73050.852op/s] or [+6.262%; +8.162%]

Known flaky benchmarks without significant changes:

  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.ActivityBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_AddEvent_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_GetContext_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_RecordException_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetAttributes_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_SetStatus_Sampled netcoreapp3.1
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net472
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled net6.0
  • scenario:Benchmarks.OpenTelemetry.InstrumentedApi.Trace.TelemetrySpanBenchmark.StartSpan_UpdateName_Sampled netcoreapp3.1
  • scenario:Benchmarks.Trace.ActivityBenchmark.StartStopWithChild net6.0
  • scenario:Benchmarks.Trace.Asm.AppSecBodyBenchmark.ObjectExtractorSimpleBody net472
  • 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.CharSliceBenchmark.OriginalCharSlice netcoreapp3.1
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog net472
  • scenario:Benchmarks.Trace.ILoggerBenchmark.EnrichedLog netcoreapp3.1
  • 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.StartFinishScope netcoreapp3.1
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishSpan net6.0
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes net472
  • scenario:Benchmarks.Trace.SpanBenchmark.StartFinishTwoScopes netcoreapp3.1
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin net472
  • scenario:Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin netcoreapp3.1

@github-actions

This comment was marked as low quality.

@dromanol
dromanol marked this pull request as ready for review July 30, 2026 09:51
@dromanol
dromanol requested review from a team as code owners July 30, 2026 09:51
@dromanol

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 36768b59ea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@e-n-0 e-n-0 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.

I found one additional concurrency issue that cannot be anchored inline because the affected lock block is unchanged in this diff.

tracer/src/Datadog.Trace/AppSec/Waf/Waf.cs:104: the replacement WAF is built before the write lock is acquired. If EnterWriteLock() fails, or disposal wins and sets Disposed, the new handle is neither installed nor freed, but the successful update result is still returned. Please destroy every candidate handle that is not adopted and return a failed update when installation cannot occur.

Comment thread tracer/src/Datadog.Trace/AppSec/Waf/NativeBindings/WafLibraryInvoker.cs Outdated
Addresses review feedback on the libddwaf 2.0 migration:

- Bind ddwaf_builder_destroy and release the builder on Waf.Dispose, plus
  free both native handles in Waf.Create when no Waf takes ownership.
- Guard the builder with its own lock so Dispose can't destroy it while an
  update is still calling ddwaf_builder_*, which crashed WafConcurrencyTests
  with an AccessViolationException.
- Pass builder configuration paths as UTF-8 bytes with a byte count: path_len
  feeds a std::string_view, so a character count truncated or overran any
  non-ASCII path.
- Destroy every candidate instance Update builds but doesn't install, and
  return a failed result when installation can't happen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

This comment was marked as outdated.

@dromanol

Copy link
Copy Markdown
Contributor Author

@e-n-0 thanks — all three findings were real and are fixed in 4d7b668.

On the third one (Waf.cs:104, the one you couldn't anchor inline): confirmed, both paths leaked the freshly built instance and the write-lock failure still returned a successful UpdateResult. Update now treats itself as the sole owner of the candidate handle until it is installed, so:

  • write lock acquired but DisposedDestroy(newHandle), record the error metric, return failed.
  • write lock not acquired — same, and the returned message is now "Couldn't acquire lock to update waf: the new instance couldn't be installed" instead of a success.

Verifying that fix turned up a crash worth flagging: once ddwaf_builder_destroy was wired up, WafConcurrencyTests.MultipleWafOps aborted the test host with an AccessViolationException in BuilderAddOrUpdateConfigDispose was freeing the builder while an update was still using it. Waf now has a dedicated builder lock (details in the thread on WafConfigurator.cs).

Local verification after the fixes: security unit tests 1041 passed / 0 failed / 4 skipped on net8.0 and 1029 / 0 / 4 on net48 — both matching the pre-change baseline — WafConcurrencyTests green over 5 consecutive runs, and Datadog.Trace building clean on net6.0 and net461.

e-n-0
e-n-0 previously requested changes Jul 30, 2026

@e-n-0 e-n-0 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.

Two related issues are outside the changed hunks, so I could not anchor them inline:

  • RaspModule still records every DDWAF_MATCH as a RASP rule match. In v2, Match also covers attribute- or action-only output, so benign evaluations can inflate the match metric. Use ShouldReportSecurityResult for the match flag and block outcome. RaspModule.cs:228-238

  • GetKnownAddresses() still uses Marshal.PtrToStringAnsi. libddwaf strings are UTF-8, so this can corrupt non-ASCII addresses on Windows. Decode those buffers as UTF-8. WafLibraryInvoker.cs:303-308

Comment thread tracer/src/Datadog.Trace/AppSec/Waf/Waf.cs Outdated
Comment thread tracer/src/Datadog.Trace/AppSec/Waf/Waf.cs
e-n-0

This comment was marked as resolved.

@e-n-0
e-n-0 dismissed their stale review July 30, 2026 14:29

it's me

dromanol and others added 2 commits July 30, 2026 16:53
Release every native handle nobody took ownership of: the builder when
initialization throws before the Waf is built, and the freshly built instance
when the update that produced it can't install it. A Dispose that couldn't take
a lock now leaves the handle in place and lets the next caller finish the job,
instead of leaking it for good.

The obfuscator configuration also reports what the WAF complained about when it
fails to load, as those diagnostics aren't surfaced anywhere else.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Since libddwaf 2.x a run that only produces attributes or actions also returns
DDWAF_MATCH, so RASP was counting attribute only evaluations as rule matches.
Use the same event aware status the reporting path already uses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

This comment was marked as duplicate.

@e-n-0 e-n-0 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.

LGTM thanks!

Comment thread tracer/src/Datadog.Trace/AppSec/Waf/Waf.cs
…ked it

When Dispose can't take a lock, the operation holding it releases the native
handles on its way out, so the ruleset isn't leaked for the process lifetime.
@github-actions

This comment was marked as duplicate.

@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.

:blindfold:

:approval: for the build.steps.cs and smoke tests changes, you may want another pair of eyes on the ASM stuff given the extent of the changes, up to you!

@dromanol
dromanol merged commit c62d6bf into master Jul 31, 2026
153 checks passed
@dromanol
dromanol deleted the dani/aap/waf_v2.0.0 branch July 31, 2026 10:22
@github-actions github-actions Bot added this to the vNext-v3 milestone Jul 31, 2026
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