fix: improve default fingerprint aggregation to reduce alert noise#13
Merged
Royal-lobster merged 1 commit intomainfrom Apr 6, 2026
Merged
fix: improve default fingerprint aggregation to reduce alert noise#13Royal-lobster merged 1 commit intomainfrom
Royal-lobster merged 1 commit intomainfrom
Conversation
Normalize titles with the same rules used for messages so dynamic values (UUIDs, hex addresses, numbers) don't create separate fingerprints. Reduce default stackDepth from 3 to 1 so the same error originating from one throw site but reached via different callers groups into a single aggregation stream. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request improves alert fingerprinting by normalizing titles to remove dynamic values and reducing the default stack depth from 3 to 1 to better group similar errors. A performance improvement was suggested to lazily compute the normalized title only when it is actually needed as a fallback for the error name.
Comment on lines
+72
to
+75
| const normalizedTitle = normalizeMessage(title, config.normalizers) | ||
| const normalizedMessage = normalizeMessage(message, config.normalizers) | ||
| const stackKey = extractStackKey(error, config.stackDepth) | ||
| const errorName = error?.name ?? title | ||
| const errorName = error?.name ?? normalizedTitle |
There was a problem hiding this comment.
The normalizedTitle is computed eagerly using multiple regex replacements even when an error object is provided. Since error.name takes precedence in the errorName assignment, this computation is redundant when an error is present. It is more efficient to compute it only when needed.
Suggested change
| const normalizedTitle = normalizeMessage(title, config.normalizers) | |
| const normalizedMessage = normalizeMessage(message, config.normalizers) | |
| const stackKey = extractStackKey(error, config.stackDepth) | |
| const errorName = error?.name ?? title | |
| const errorName = error?.name ?? normalizedTitle | |
| const normalizedMessage = normalizeMessage(message, config.normalizers) | |
| const stackKey = extractStackKey(error, config.stackDepth) | |
| const errorName = error?.name ?? normalizeMessage(title, config.normalizers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
stackDepthfrom 3 to 1 so the same error from different callers (e.g.PrismaClientKnownRequestErrorviagetUserPositionsvsgetUserTrades) groups into a single aggregation streamfingerprint: { stackDepth: 3 }Context
In production, a single root-cause error (missing DB table) was creating 6+ separate alert streams because each HTTP endpoint had a different caller in the stack trace. With these changes, they collapse into one stream with proper exponential ramp-up.
Test plan
🤖 Generated with Claude Code
Closes #15