feat(dynamic-sampling): add per-project volume query #114286
Open
@sentry/warden / warden
completed
May 12, 2026 in 3m 22s
1 issue
Medium
Unguarded dict access on 'sentry.dsc.root_project' can raise KeyError/TypeError - `src/sentry/dynamic_sampling/per_org/tasks/queries.py:146`
Row access uses row["sentry.dsc.root_project"] without a presence/None check, then wraps it with int(...). If Snuba returns rows where this column is missing (e.g., spans without a DSC root project tag) or where the value is None, this raises KeyError or TypeError, aborting the entire per-project volume computation for the organization. The sibling helper _get_aggregate_int was explicitly hardened in this same diff to handle None, but the group-by key was not, leaving an inconsistent safety posture.
6 skills analyzed
| Skill | Findings | Duration | Cost |
|---|---|---|---|
| security-review | 0 | 31.4s | $0.28 |
| sentry-backend-bugs | 1 | 35.8s | $0.93 |
| wrdn-pii | 0 | 1m 9s | $0.31 |
| wrdn-authz | 0 | 1m 15s | $0.26 |
| wrdn-code-execution | 0 | 1m 5s | $0.19 |
| wrdn-data-exfil | 0 | 40.5s | $0.19 |
⏱ 5m 17s · 1.0M in / 2.2k out · $2.16 (+verification: $0.66, +dedup: $0.00)
Loading