Repository navigation
feat(errors): fingerprint v3 grouping with a version-salted hash - #1466
Conversation
…rrors:replay The Resolved tab filtered a mixed page of the 50 most recently seen issues in the browser, so it rendered empty, with no "Load more", whenever that page was all open issues. Done issues archived after 14 days never showed at all. - v2 GET /error_issues takes `state=open|closed`, `search` and `include_archived`; the web list asks the server for exactly its view. - Tabs are Open / Closed / All (old `view` values still decode). Closed holds verifying, done, cancelled and wontfix, archived ones included. - A debounced search box (`?q=`) over type, message, label and service. - The stat strip keeps error events and their share of spans; the toolbar counts issues. - `bun run errors:tick` fires the alerting minute cron on a local stack. - `bun run errors:replay` groups a sample of error events with today's fingerprint and a proposed v3, checks parity against production hashes, and lists the largest merges.
… errors:tick runs The iOS OpenAPI check failed on the new list params. A pasted log line longer than the API's 200-char search cap now clamps instead of failing the page. The minute cron also runs the alert and escalation lanes; the script and doc say so.
A namespaced exception type keeps only its throw site, Effect span frames are dropped, frames lose package versions and (index N), and the issue message signature cuts ClickHouse query echoes and redacts filesystem paths, prefixed ids and ULIDs. JSON values also redact UUIDs. FINGERPRINT_VERSION goes to 3 and is hashed as FINGERPRINT_HASH_SALT, so the bump rotates every hash. Without the salt, retention would archive live issues whose hash v3 leaves unchanged, and nothing un-archives them. Ships as Tinybird MV change, ClickHouse migration 0039 and local schema v30. Replay on a fresh prod sample: TS mirror in parity with production hashes, 19% fewer issues on the top 100 fingerprints, no splits.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Frames: strip file:///bundle/, repeated bundle hashes and Astro asset hashes, and ignore a schema error's `at [..]` key path. A namespaced type keeps one frame only when its message signature is non-empty. Messages: strip ANSI codes; cut only the query a ClickHouse error echoes (after " in scope " / " while processing "), keeping the identifier; end a filesystem root at a separator so /datasets survives, match ~/ paths only, and catch adjacent paths; require a digit or capital in a prefixed id so snake_case names survive; keep 1xx-4xx and 500 statuses exact and fold the other 5xx into one class. The MV computes _msgSig before the frame slice that now reads it. The warehouse client timeout names its query, so timeouts from different queries stay separate issues. FINGERPRINT_VERSION stays 3 with its salt; migration 0039 and local schema v30 are regenerated in place.
…t-v3 # Conflicts: # scripts/errors-replay/candidate.ts
…ng export Both knip findings were already failing on main.
Retention archives on the premise that an issue stopped occurring, and the tick's upsert never cleared archivedAt, so an issue archived too early stayed invisible while it kept accumulating occurrences. A fingerprint bump makes that likely: a self-hosted warehouse keeps producing old hashes until it applies the new view, and a deploy gap does the same. An archived open issue now comes back on its next occurrence with its state intact and its version restamped. A regression on an archived resolved issue reopens it unarchived. An occurrence from a pre-fix build leaves a resolved issue archived, as before.
…ckHouse Spans go through the real migrations and views, and the real tick writes the issues to Postgres. Covers the grouping v3 intends and an archived issue that a warehouse still on the v2 view brings back.
Maple review🟢 Confidence 8/10 · likely safe to merge Fingerprint v3: version-salted hashes, new frame and message-signature rules, a ClickHouse MV recreation (0039), local schema v30, and restore of archived error issues on recurrence. The MV SQL and its TS mirror apply the same chain, and the parity is pinned by ClickHouse e2e tests.
Before merge
What was checked
|
|
Merged with 3 steps from "Before merge" still open. If they are done, tick them on the review comment; if not, now is the time.
|
What
Ports the v3 fingerprint into production grouping, with the v3.1 rules from a replay of every prod fingerprint of the last 30 days.
Frames:
/) keeps only its throw site, when it has a non-empty message signature. With no message it keeps 3 frames, since frames are all that is left. Generic types keep the top 3.(definition)) and a schema error'sat [..]key-path lines are not frames.@1.2.3),(index N),file:///bundle/, repeated bundle hashes and Astro asset hashes.Issue message signature (
ERROR_MSG_REDACTIONS;MSG_TEXT_REDACTIONSis unchanged because the AI tool-error fingerprint and the web's masked display share it):in scope/while processing), keeping the identifier, function or type that names the bug.PATH. The root must end at/,.or a delimiter, so/datasets/xstays. Tilde paths match only as~/....org_...,cus_..., with a digit or capital in the id part, sotop_operationsstays) and ULIDs becomeID.5xx.Also: the warehouse client-timeout message names its query, so timeouts from different queries stay separate issues.
FINGERPRINT_VERSIONgoes to 3 and is hashed asFINGERPRINT_HASH_SALT('fp3', the 6thcityHash64argument).The salt matters. Retention archives every error issue below the current version, and the upsert never clears
archivedAt. Without the salt, live issues whose hash v3 leaves unchanged would be archived and never come back. With it, every hash rotates and archiving on sight is correct. It also makes any future bump safe.Ships as the
error_events_mv/error_events_by_time_mvchange, ClickHouse migration0039_error_fingerprint_v3(frozen DDL), and local store schema v30.Evidence
error-fingerprint-v3.clickhouse.e2e.test.ts): for every rule, the view's hash equalscityHash64of the TS mirror's inputs, 22 seeds.TypeErrors at different callers stay distinct,/datasets/xand~5 minstay, 401 vs 404 vs 500 stay distinct, 502/520/524 merge.Rollout impact
triageissues. Assignee, priority, notes, snooze, resolution and linked PRs do not carry over, and notifications may fire for the new issues as if they were first seen. Worth a heads-up, or a quiet deploy window.error_eventsrows keep their hashes until the 90-day TTL ages them out.Archived issues now recover when they recur
Retention archives on the premise that an issue stopped occurring, and the tick never cleared
archivedAt. So an issue archived too early stayed invisible while it kept accumulating occurrences. The version bump made that a real risk in two places, and both are now handled:Also fixed: a regression on an archived, long-resolved issue used to reopen it while leaving it archived, so the regression stayed hidden. It now reopens unarchived. An occurrence from a pre-fix build still leaves a resolved issue archived.
Summary by CodeRabbit