Skip to main content
The Dedupe integration prevents duplicate error events from being sent to Sentry by comparing the current event with the previously captured event.

Installation

This integration is enabled by default in all Sentry SDKs.

How It Works

The integration compares consecutive error events and drops duplicates based on:
  1. Message events: Same error message, stacktrace, and fingerprint
  2. Exception events: Same exception type, value, stacktrace, and fingerprint
1

Event Captured

A new error event is captured
2

Compare with Previous

The integration compares it with the last captured event
3

Check Duplicates

Matches are checked for:
  • Exception type and value
  • Error message
  • Stacktrace (filename, line, column, function)
  • Fingerprint
4

Drop or Send

If it’s a duplicate, the event is dropped. Otherwise, it’s sent to Sentry.

What Gets Deduped

Duplicate Exception Events

The same error thrown multiple times in quick succession:

Duplicate Message Events

The same error message captured repeatedly:

What Doesn’t Get Deduped

Different Error Types

Different Stacktraces

Non-Error Events

Transactions, replays, and other event types are never deduped:

Comparison Logic

The integration performs detailed comparison:

Message Comparison

Exception Comparison

Stacktrace Comparison

All stack frames must match exactly:

Disabling Dedupe

If you want to disable deduplication:
Disabling dedupe may result in significantly more events being sent to Sentry, potentially affecting your quota.

Deduplication Scope

The integration only compares with the immediately previous event:

Custom Fingerprinting

Use custom fingerprints to control deduplication:

Source Code

The Dedupe integration is implemented in: packages/core/src/integrations/dedupe.ts:12

Practical Examples

Event Loop Errors

Prevents flooding from errors in event handlers:

Retry Logic

Avoids duplicate reports during retries:

Polling Operations

Prevents duplicate errors from periodic operations:

Limitations

  1. Only compares with previous event: Not a global deduplication across all events
  2. Requires exact match: Small differences in stacktrace will bypass dedupe
  3. No time-based window: Doesn’t aggregate errors over time

Best Practices

Combine dedupe with custom fingerprinting for better error grouping
  1. Let dedupe work automatically: It’s designed to handle common duplicate scenarios
  2. Use fingerprinting for logical grouping: Dedupe handles technical duplicates
  3. Monitor your error volume: Unusual spikes might indicate dedupe isn’t catching something

Debugging

To see when events are deduped, enable debug mode: