Start free trial
Start free trial Log in

14-day free trial. No credit card.

What is Exception Fingerprinting?

  • Glossary
  • 3 minute read

What is exception fingerprinting?

Exception fingerprinting is the process of reducing an exception to a stable identifier, typically a hash of its class name, top app-level stack frames, and a normalized message with dynamic values stripped. Exceptions sharing a fingerprint are grouped into a single issue, so 10,000 occurrences of the same bug appear as one issue with a count, not 10,000 separate notifications.

Updated

The first time a bug hits production at scale, your error channel does something unhelpful: it sends the same exception a thousand times. Without grouping, ten users hitting one broken endpoint looks identical to ten separate problems, and the one genuinely new exception that matters is buried under the flood. Fingerprinting is how a tracker turns that into a single line: "this happened 1,000 times, here's the one stack trace."

Why raw grouping fails

Group by exception class alone and every QueryException in your app becomes one issue, which is useless. Group by error message and natural variance splits the same bug into thousands of pseudo-issues:

The same bug, different messages
"SQLSTATE[23505]: Unique violation on users_email_unique for alice@example.com"
"SQLSTATE[23505]: Unique violation on users_email_unique for bob@example.com"
"SQLSTATE[23505]: Unique violation on users_email_unique for carol@example.com"

Same root cause. Three unrelated issues in your tracker. Repeat 10,000 times and the signal drowns in noise.

What goes into a fingerprint

Good fingerprinting combines:

  • Exception class: QueryException, ValidationException, etc.
  • Top app-level stack frame: the first frame that isn't vendor code. This is where the bug lives, regardless of what framework path got there.
  • Normalized message: replace dynamic values (IDs, emails, timestamps, quoted strings) with placeholders. "Unique violation on users_email_unique for ?" collapses all three rows above into one.
Pseudo-code fingerprint
$fingerprint = sha1(
    $e::class
    . '|'
    . topAppFrame($e->getTrace())      // App\Http\Controllers\...
    . '|'
    . normalizeMessage($e->getMessage()) // dynamic values → ?
);

What a fingerprint buys you

  • Issue counts: "this bug has happened 4,382 times in 24 hours"
  • First-seen / last-seen: "this appeared after the 14:00 deploy"
  • Status tracking: resolve or ignore the bug once, not each occurrence
  • Regression alerts: when a resolved fingerprint reappears
  • Priority focus: top 10 fingerprints, not top 10,000 occurrences

When fingerprinting goes wrong

Two failure modes, opposite directions.

Over-grouping. A generic class like ModelNotFoundException thrown from the same wrapper method fingerprints two unrelated bugs into one issue. Fix one and the other stays hidden inside a "resolved" group. The defense is to weight the call site, not just the class, and to let a human split a group when the machine got it wrong.

Under-grouping. A value you meant to normalize leaks into the fingerprint (an ID in a stack frame, a timestamp in the message) and one bug fragments into hundreds of near-duplicate issues. That recreates exactly the noise fingerprinting was supposed to remove, so a stricter normalizer is worth getting right.

No scheme is perfect. Some tools let you override the fingerprint; NightOwl keeps the Nightwatch fingerprint as it is and shows every occurrence's message inside the issue.

How NightOwl fingerprints Laravel exceptions

NightOwl uses the fingerprint the Nightwatch package computes: an xxh128 hash of the exception class, the exception code, and a file and line: where it was thrown, or the first stack frame outside vendor/ when it was thrown inside a package. The message is never part of it, so no normalizer is needed, and two exceptions of the same class thrown from the same line group together whatever their messages say. Grouping is per environment, so the same bug in staging and production is two issues. Exceptions you catch and pass to report() are captured too, not only uncaught ones. The full stack and request context are stored with each occurrence, and fingerprints map to issues in the nightowl_issues table, which powers the issues UI with status, priority, assignee, and comments.

Because data lives in your PostgreSQL, you can also query issues directly with SQL: group_hash holds the fingerprint, next to exception_class, environment, status, occurrences_count, first_seen_at and last_seen_at. That's useful for per-team dashboards or your own reports.

See your Laravel exceptions grouped into issues

NightOwl groups each exception by its class, code and the line it came from, per environment, and keeps the stack trace and request context of every occurrence. Each group becomes an issue with a status and an assignee, and a new one sends you an alert.

No credit card needed.

Frequently asked questions

Anything else, write to support@usenightowl.com

What is exception fingerprinting?

Exception fingerprinting is the process of reducing an exception to a stable identifier, typically a hash of its class name, the top app-level stack frames, and a normalized message. Exceptions with the same fingerprint are grouped into a single issue, so thousands of occurrences of the same bug appear as one notification instead of thousands.

Why not just group exceptions by error message?

Error messages often contain dynamic data: user IDs, email addresses, SQL query text, timestamps. Two occurrences of the same bug might produce different messages ('User 742 not found' vs 'User 891 not found') and would be counted separately. Fingerprinting normalizes those values so variations roll up together.

How does fingerprinting handle framework vs application code?

Most trackers weight the first app-level stack frame (the one closest to where the exception was thrown) more heavily than vendor frames. An exception thrown from deep inside Laravel's query builder but triggered by your UserController::store should fingerprint to UserController::store. That's the code you actually need to fix.

Can two different bugs get the same fingerprint?

Rarely, but it happens, usually when a generic error class (ModelNotFoundException, QueryException) is thrown from the same call site for unrelated reasons. Some trackers let you override the fingerprint with custom grouping rules or split a grouped issue. NightOwl uses the Nightwatch fingerprint as it is, so a generic class thrown from one call site for different reasons shares one issue, and the occurrences list shows each message.

How is fingerprinting different from just using exception class names?

Class name alone collapses every QueryException into one issue, which is useless when you have a dozen different failing queries. Fingerprinting combines class + location + normalized message so the 'deadlock on orders table' and 'missing foreign key on users table' appear as distinct issues.

Keep reading

Flat pricing, whatever your traffic does

Every plan starts with a 14-day free trial. No credit card needed.

Hobby
$5 a month

One app for a side project. Issues and alerts, with a 14-day dashboard window.

Start my 14-day trial
TeamRecommended
$15 a month

Up to 3 apps and 5 people per team. Full history, the MCP server, data clearing and agent health.

Start my 14-day trial
Agency
$69 a month

Unlimited client apps and people, one overview of every app, and apps you can hand over.

Start my 14-day trial