Pluggable integrations that enhance Sentry JavaScript SDKs with additional error tracking, monitoring, and debugging capabilities.
—
Removes duplicate error events to prevent spam from repeated errors. The integration compares incoming events against the previously captured event and drops duplicates based on message, exception details, stacktrace, and fingerprint.
/**
* Deduplication filter for error events
* @returns Integration instance that filters duplicate events
*/
function dedupeIntegration(): Integration;/**
* Legacy class-based deduplication integration
* @deprecated Use dedupeIntegration() instead
*/
class Dedupe implements Integration {
name: string;
processEvent(event: Event): Event | null;
}The integration maintains a reference to the previously processed event and compares each new event against it. Events are filtered out (return null) if they match the previous event.
Events are considered duplicates if they match on:
Events with custom fingerprints are compared by joining fingerprint arrays:
Stacktraces are compared frame by frame:
import { dedupeIntegration } from '@sentry/integrations';
import * as Sentry from '@sentry/browser';
Sentry.init({
dsn: 'YOUR_DSN',
integrations: [
dedupeIntegration()
]
});
// First occurrence - will be sent
throw new Error('Network timeout');
// Immediate duplicate - will be filtered out
throw new Error('Network timeout');
// Different error - will be sent
throw new Error('Validation failed');For testing purposes, the integration exports internal comparison functions:
/**
* Determines if current event should be dropped as duplicate
* Only exported for testing purposes
*/
function _shouldDropEvent(currentEvent: Event, previousEvent?: Event): boolean;The integration only processes error-type events and ignores other event types like transactions or replays to avoid interfering with performance monitoring data.
Install with Tessl CLI
npx tessl i tessl/npm-sentry--integrations