appsec: improvements in metrics#3850
Draft
cataphract wants to merge 9 commits intomasterfrom
Draft
Conversation
… for bundled rules
- report_diagnostics_errors now takes rc_path as Option<&rc::RcPath> and an
explicit action tag, so both the init path (action:init) and the update path
(action:update) submit the waf.config_errors metric.
- The init path passes None for rc_path and constructs a synthetic
ParsedConfigKey{product:"bundled_rules", config_id:"bundled_rules"} so
diagnostic telemetry logs are also emitted for errors in the bundled rules.
- The init-path TelemetryLogsCollector is reused as the service's
logs_collector so those logs are flushed on the first request.
- Integration test @order(21) verifies the metric (action:init,
event_rules_version:9.9.9) and the diagnostic log
(rc::bundled_rules::diagnostic) in a single drain loop, since
drainTelemetry is destructive.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces rasp.c/h with duration_acc.c/h to accumulate both WAF and RASP round-trip times measured by the extension. Sends them in request_shutdown (now 6 args). Rust helper emits waf.duration, waf.duration_ext, and rasp.duration_ext as DDSketch distributions, and _dd.appsec.waf.duration_ext as a span metric. Adds integration tests with a Groovy DDSketch protobuf decoder to cross-check span metric values against distribution bins.
…sql_injection
Adds rule_variant as a new optional field in the request_exec protocol
(msgpack map key "rule_variant", sent only when non-empty). The PHP
extension parses an optional third argument to push_addresses() and
packs it when present.
FilesystemIntegration passes "request" for SSRF pre-hooks. PDO and
Mysqli integrations rename "sqli" to "sql_injection" for consistency
with other tracers.
In the Rust helper, WafRunType::RaspRule becomes a struct variant
{ rule_type, rule_variant: Option<String> }. The rasp_per_rule HashMap
is keyed on (rule_type, rule_variant); the rule_variant tag is emitted
only when non-empty (the sidecar rejects tags ending with a bare colon).
Also adds event_rules_version to the three RASP per-rule metrics
(rasp.rule.eval, rasp.rule.match, rasp.timeout).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Benchmarks [ appsec ]Benchmark execution time: 2026-04-30 17:01:00 Comparing candidate commit db09024 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. |
Benchmarks [ tracer ]Benchmark execution time: 2026-04-30 17:37:57 Comparing candidate commit db09024 in PR branch Found 0 performance improvements and 5 performance regressions! Performance is the same for 188 metrics, 1 unstable metrics. scenario:MessagePackSerializationBench/benchMessagePackSerialization
scenario:PHPRedisBench/benchRedisOverhead
scenario:SamplingRuleMatchingBench/benchRegexMatching1
scenario:SamplingRuleMatchingBench/benchRegexMatching2
scenario:SamplingRuleMatchingBench/benchRegexMatching4
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reviewer checklist