Add telemetry metrics for API Security schema extraction#5340
Add telemetry metrics for API Security schema extraction#5340
Conversation
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: ec69065 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
BenchmarksBenchmark execution time: 2026-02-13 14:17:06 Comparing candidate commit ec69065 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 44 metrics, 2 unstable metrics. |
There was a problem hiding this comment.
After discussion we come to the conclusion that some refactoring needed:
- Update extract schema method to mutate events without disclosing event itself
- Metric should be counted on schema extraction
- Absence of the counted metric (via state or other) tracked and added on the metrics export as "no schema"
a9478d7 to
8197e57
Compare
Typing analysisNote: Ignored files are excluded from the next sections.
|
4ab4b28 to
ec69065
Compare
| Metrics::TelemetryExporter.export_api_security_metrics( | ||
| schema_extracted: !!@state[:schema_extracted], | ||
| web_framework: @state[:web_framework] | ||
| ) |
There was a problem hiding this comment.
There is also an option to give entire @state and exporter will figure it out, so we encapsulate it there
There was a problem hiding this comment.
this depends on how much we want the telemetry exporter to know about the context state. Probably it's ok?
What does this PR do?
This PR adds reporting of
appsec.api_security.request.schemaandappsec.api_security.request.no_schematelemetry. One of those metrics must be reported depending of whether the schema was successfully extracted or not.Motivation:
We want to report more telemetry metrics for AppSec.
Change log entry
None.
Additional Notes:
APPSEC-60123
How to test the change?
CI