feat(data-collection): add queues option to data collection config#6770
Conversation
Add a `queues` boolean to the data collection spec, gated by send_default_pii like other PII-bearing fields. Depends on getsentry/sentry-docs#18637 and the outcome of discussions there. Fixes PY-2679 Fixes #6739
Codecov Results 📊✅ 90435 passed | ⏭️ 6302 skipped | Total: 96737 | Pass Rate: 93.49% | Execution Time: 313m 10s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2446 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 89.74% 89.76% +0.02%
==========================================
Files 192 193 +1
Lines 23823 23878 +55
Branches 8226 8244 +18
==========================================
+ Hits 21378 21432 +54
- Misses 2445 2446 +1
- Partials 1349 1351 +2Generated by Codecov Action |
| "graphql": _graphql_from_value(d.get("graphql") or {}), | ||
| "gen_ai": _gen_ai_from_value(d.get("gen_ai") or {}), | ||
| "database": _database_from_value(d.get("database") or {}), | ||
| "queues": d.get("queues", True), |
There was a problem hiding this comment.
Bug: The new data_collection['queues'] setting is ignored by queue integrations. They continue to use should_send_default_pii(), potentially leaking data against the user's explicit configuration.
Severity: HIGH
Suggested Fix
Update the queue integrations (RQ, Huey, ARQ, Celery) to check the data_collection['queues'] setting from the client options. The logic should respect this new flag and not send queue arguments if it is set to False, regardless of the send_default_pii setting.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: sentry_sdk/data_collection.py#L161
Potential issue: The new `data_collection['queues']` configuration option is introduced
but not used by any of the queue integrations (RQ, Huey, ARQ, Celery). These
integrations continue to rely solely on `should_send_default_pii()` to decide whether to
capture job arguments and keyword arguments. This creates a situation where a user might
explicitly set `data_collection={'queues': False}` expecting to prevent sensitive data
from being sent, but the SDK will silently ignore this setting and leak the data if
`send_default_pii` is `True`. This is a functional data leakage vulnerability as the
feature does not work as documented.
Also affects:
sentry_sdk/integrations/celery/__init__.py:146sentry_sdk/integrations/rq.py:188sentry_sdk/integrations/huey.py:130sentry_sdk/integrations/arq.py:177
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
It hasn't be implemented yet, but it will be
Add a
queuesboolean to the data collection spec, gated by send_default_pii like other PII-bearing fields.Depends on getsentry/sentry-docs#18637 and the outcome of discussions there.
Fixes PY-2679
Fixes #6739
Stack created with GitHub Stacks CLI • Give Feedback 💬