Repository navigation
[AppSec] Emit appsec.waf.config_errors telemetry - #9481
Conversation
Count the errors the WAF reports for each configuration it loads, tagged with action:init or action:update, and count a failed init the WAF reported no errors for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Obfuscator configuration diagnostics are destroyed before the new counter runs, so those configuration errors remain absent from appsec.waf.config_errors when ruleset initialization succeeds.
🤖 Bits Code Review · Commit c85e300
BenchmarksBenchmark execution time: 2026-10-22 10:22:37 Comparing candidate commit 2f75e2f in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 71 metrics, 1 unstable metrics, 8 known flaky benchmarks, 118 flaky benchmarks without significant changes.
|
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (9481) and master.
|
|||||||||||||||
| Metric | Master (Mean ± 95% CI) | Current (Mean ± 95% CI) | Change | Status |
|---|---|---|---|---|
| .NET Framework 4.8 - Baseline | ||||
| duration | 72.87 ± (72.80 - 73.11) ms | 79.43 ± (78.04 - 79.74) ms | +9.0% | ❌⬆️ |
e-n-0
left a comment
There was a problem hiding this comment.
Looks good to me. I left a few non-blocking comments.
Walk the native diagnostics map and read only the error fields, and cover a partially loaded ruleset in the tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary of changes
Emit the
appsec.waf.config_errorscount metric, tagged withwaf_version,event_rules_versionandaction:init|update.Reason for change
The .NET tracer never emitted this metric, while the other tracers do, so a partially loaded ruleset (some rules accepted, others dropped) is invisible for .NET in the AAP dashboards. APPSEC-69545.
Implementation details
WafConfigurator.Updatecounts the errors of each configuration as it loads it: one per top-level or per-sectionerror, plus one per message in a section'serrorsmap (same as dd-trace-js). Counting per config also covers configs whose diagnostics were discarded because only the last one is kept.action:initerror only when the WAF reported none (e.g. an unparseable rules file), so errors are not counted twice.common_metrics.json: add theactiontag already used by the other tracers and by system-tests;config_keyandscopeare optional. The dd-go copy needs the same update after merge.Test coverage
SecurityWafConfigErrorsTelemetryTests: update with duplicate action ids, valid update, invalid + valid config in one update, corrupted rules file, ruleset with only invalid rules, default rules.Test_CorruptedRules_Telemetry(APPSEC_CORRUPTED_RULES) andTest_Invalid_Config(APPSEC_RUNTIME_ACTIVATION), both currentlymissing_featurefor dotnet; they will be enabled in system-tests once released.Other details
https://github.com/ddoghq/dd-go/pull/24797
🤖 Generated with Claude Code