[Feature request]: Add per-worker thresholds for N+1 query detection
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 22h 21m
- Merged PRs (30d)
- 586
Description
### Problem Statement
Currently, Sentry applies N+1 query detection thresholds globally at the project level. While you can adjust the overall threshold in Settings → Performance, there’s no way to tune detection sensitivity for specific background workers or tags. The customer would like to request more granular controls so that different workloads can have different N+1 time thresholds.
## Feedback from the customer
300ms is a very reasonable duration for queries that need to result in responses to users. But we rely on workers to offload long-running actions that might actually involve equally long-running DB-queries. These should still be monitored but allowed a longer duration.
### Solution Brainstorm
_No response_
### Product Area
Performance
Contributor guide
Research direction
Start by reviewing the existing project-level N+1 query detection threshold and the Performance settings area. Determine how background workers and tags are represented, then define how per-worker thresholds should be configured and applied. Done means different workloads can use distinct N+1 time thresholds while remaining monitored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100