fix(sentry): stop reporting expected 404s, and group the rest by route - #2585
fix(sentry): stop reporting expected 404s, and group the rest by route#2585Hugo0 wants to merge 1 commit into
Conversation
/ens/reverse produced 1,948 Sentry events in 24h on 2026-07-29 — 15 new issues in one hour, each a single address, burying every other signal in the feed. Two separate causes, and the obvious one is the smaller one. First: the 404 is not a failure. usePrimaryNameServer asks the server, then falls back to a client-side lookup, so the user never sees anything. The route isn't even deployed (peanut-api-ts #1237 is still open), so every address rendered by AddressLink and TransactionCard reports one. /rhino/status/404 is the same shape: a poll-until-present loop where 404 is the waiting tick. Both now skip reporting; timeouts and 5xx still report, because those are real. Second: what did get reported split per address. sanitizeUrl feeds the fingerprint but only collapsed numeric ids and UUIDs, so a hex segment survived and every address minted its own group. It now collapses 0x runs too — addresses, tx hashes and send-link pubKeys, generically, rather than a per-route allowlist. The message carried the raw URL as well, and that matters more than it looks: captureConsoleIntegration turns the console.warn into a second Sentry event with no fingerprint at all, grouped on message text. Fixing only the fingerprint would have halved the flood, not stopped it. All three message sites now use the sanitized URL; the real one stays on extra.url, so nothing becomes harder to debug. Hex is matched before the numeric rule — an all-digit hex body would otherwise become '/0x{id}' and split the group again. A test pins that.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Code-analysis diffPainscore total: 6739.08 → 6739.19 (+0.11) 🆕 New findings (2)
✅ Resolved (2)
|
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
Summary
/ens/reverseproduced 1,948 Sentry events in 24 hours on 2026-07-29 — 15 new issues in a single hour, each holding one address. It buried every other signal: in one monitor sweep it accounted for 15 of 15 new issues. A monitor whose feed is entirely one benign signal is one bad hour from missing something real.Two separate causes, and the one named in the title is the smaller of them.
1. The 404 is an answer, not a failure — this is the primary fix
usePrimaryNameServerasks the server for a primary name and falls back to a client-side lookup when that misses, so a 404 costs the user nothing. And the route isn't deployed at all:/ens/reverse/:addressexists on neithermainnordevin peanut-api-ts (src/routes/ens/index.tsregisters only/ens/:ensName), because peanut-api-ts#1237 is still open. So every address rendered byAddressLinkandTransactionCardreports one./rhino/status/:addr404 is the same shape — a poll-until-present loop where 404 is the normal waiting tick, once per poll per address.Both now skip reporting. Timeouts and 5xx on those routes still report — those are real signal, and the 20s timeouts have been genuine.
2. What did get reported split per address
sanitizeUrlfeedssetFingerprint, but only collapsed numeric ids and UUIDs — a hex segment survived verbatim, so every address minted its own fingerprint. It now collapses0xruns too (addresses, tx hashes, send-link pubKeys) as a generic path-segment rule, not a per-route allowlist, so the sibling routes are covered by construction.The messages carried the raw URL too, and that mattered more than it looks:
captureConsoleIntegration({ levels: ['error','warn'] })turns theconsole.warninto a second Sentry event with no fingerprint at all, grouped on message text. Fixing only the fingerprint would have halved the flood, not stopped it. All three message sites now use the sanitized URL.Debuggability is preserved
The real URL was already attached as
extra.urland still is — a test pins that. Nothing gets harder to investigate; you lose only the per-address issue explosion.Risks
(route, status)pair and leaving 5xx/timeouts reporting — with tests asserting a 500 on those same routes still reports./0x{id}and split the group again. Pinned by a test.sanitizeUrlis promoted from a closure to an exported function — it was untestable before, and is now unit-tested. No behaviour change for existing callers beyond the added rule.QA
npx jest src/utils/__tests__/sentry.utils.test.ts— 12 new cases, all passing.Full suite: 178 suites / 2330 tests, 0 failures.
npm run typecheckclean.Key cases:
/ens/reverse+/rhino/status404 report neither to Sentry nor toconsole.warn· a 500 on those routes still reports · two different addresses produce an identical message (the whole point) ·extra.urlkeeps the real URL · hex/UUID/numeric collapse ·/ens/vitalik.ethuntouched · all-digit hex body ordering guard.Screenshots: N/A— observability plumbing, no rendered change.Follow-up (not this PR)
usePrimaryNameServercalls a route that has never existed in production, so every ENS lookup pays a wasted round-trip before falling back. Either land #1237 or drop the server-first call. Worth its own ticket — this PR just stops the noise either way.