fix(rum): fix CSP metric and align injection reasons #504
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 268 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.335
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #504"
general
weight: 0.35
pawelchcki
Overview
Content-Security-Policyheader are now counted ininjection.content_security_policy(tagsstatus:seen,kind:header), not ininjection.failed.injection.skippedreasoninvalid_content_typeis renamed tocontent-type.injection.failedreasonmissing_header_tagis renamed tono_injection_point.telemetry.hstates the rule: skipped means not tried (decided from headers or config),failed means an eligible HTML response was tried but not injected.
Motivation
injection.failedper week.Dashboards and monitors change: anything that filters on
reason:invalid_content_type,reason:missing_header_tag, or on nginxinjection.failed, will see different numbers.Additional Notes
Tests: the RUM integration tests now check the telemetry sent to the fake agent, for the CSP
metric and the
content-typeskip reason (RUM=ON NGINX_VERSION=1.31.10 make build-musl test,cases.rum.test_injection). Locally 12/17 pass, including thecontent-typecheck. The 5 teststhat proxy to a backend on the host (including the CSP test) time out on my machine because the host
firewall blocks container-to-host traffic. CI must validate the CSP test.
Manual check in Docker (fake agent, small test backend):
master:injection.failedwithstatus:seen,kind:header.injection.content_security_policywithstatus:seen,kind:header.<head>, this branch:injection.failedwithreason:no_injection_point.No hits in DataDog/system-tests for the RUM metric names.
invalid_content_typeonly appears inunrelated AppSec tests.
References
Jira ticket: INPLAT-1452, INPLAT-1454
Contributor Checklist