Repository navigation
feat(appsec): report duration metrics for waf and rasp - #9286
Conversation
…rasp.duration_ext telemetry metrics
Overall package sizeSelf size: 8.25 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.3 | 125.43 kB | 445.14 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: e33508d | Docs | View more details | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9286 +/- ##
=======================================
Coverage 98.54% 98.54%
=======================================
Files 982 982
Lines 145106 145161 +55
Branches 12488 12461 -27
=======================================
+ Hits 143000 143055 +55
Misses 2106 2106
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9e4345209
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
BenchmarksBenchmark execution time: 2026-08-20 07:22:52 Comparing candidate commit e33508d in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2282 metrics, 10 unstable metrics.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0330556e7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM with one minor comment addressed
IlyasShabi
left a comment
There was a problem hiding this comment.
I think that bring back duration metrics for RASP and WAF is not ready yet because they they should be sent as “sketch” and not as “distribution” metrics which is not the case yet on our tracer DataDog/libdatadog#268
|
@IlyasShabi I believe that landed by now |
|
Ready to land 🚀 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5992492cf0
ℹ️ 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".
…istribution metrics
Re-implements waf.duration, waf.duration_ext, rasp.duration and rasp.duration_ext
Re-implements waf.duration, waf.duration_ext, rasp.duration and rasp.duration_ext
Re-implements waf.duration, waf.duration_ext, rasp.duration and rasp.duration_ext
Re-implements waf.duration, waf.duration_ext, rasp.duration and rasp.duration_ext
What does this PR do?
Re-implements
waf.duration,waf.duration_ext,rasp.durationandrasp.duration_extas instrumentation telemetry distribution metrics, closing a coverage gap where these values were only visible as span tags (_dd.appsec.waf.duration, etc.) but never reported to telemetry.The per-request totals were already being accumulated internally (
addWafRequestMetrics/addRaspRequestMetrics); this PR adds the missing emission step, flushing each total once per request, viaincrementWafDurationMetrics/incrementRaspDurationMetrics, orchestrated by a newincrementRequestDurationMetricsintelemetry/index.jsand wired intoreporter.js#finishRequestbefore the per-request store is cleared.Motivation
These metrics were originally added in #5458 and reverted shortly after in #5534. The revert commit attributed the removal to the metrics themselves, but investigation (git history + cross-tracer comparison with dd-trace-py, which implements the equivalent correctly) showed the real defect was reporting frequency: the original implementation reported a partial cumulative sum on every individual WAF/RASP evaluation instead of once per request, producing cardinality/skew in the resulting distributions.
This PR fixes the reporting frequency rather than reintroducing the old per-eval pattern, restoring visibility into WAF/RASP evaluation duration in telemetry that has been missing since #5534.
Additional Notes
APPSEC-69055