Commit 130cb06
authored
fix: sample high-volume "Token required" Sentry errors at 1% (#116)
## Summary
- Adds a `before_send` hook to Sentry SDK init that samples "Token
required" error events at 1% (1 in 100), dropping the rest
- Issue [CLI-S](https://codecov.sentry.io/issues/CLI-S) has ~21M
occurrences flooding Sentry; this reduces volume while still capturing
representative samples
- The sampling pattern list (`_SAMPLED_MESSAGES`) is extensible for
future high-volume errors
## Test plan
- [ ] Verify existing tests pass (`pytest tests/helpers/test_args.py`)
- [ ] Confirm other Sentry events (non-"Token required") are unaffected
and always sent
- [ ] After deploy, monitor CLI-S event volume in Sentry to confirm ~99%
reduction1 parent c1401cf commit 130cb06
1 file changed
+29
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
10 | 38 | | |
11 | 39 | | |
12 | 40 | | |
| |||
20 | 48 | | |
21 | 49 | | |
22 | 50 | | |
| 51 | + | |
23 | 52 | | |
24 | 53 | | |
25 | 54 | | |
| |||
0 commit comments