CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-sentry--integrations

Pluggable integrations that enhance Sentry JavaScript SDKs with additional error tracking, monitoring, and debugging capabilities.

Pending
Overview
Eval results
Files

error-deduplication.mddocs/

Error Deduplication

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.

Capabilities

Modern Function-based Integration

/**
 * Deduplication filter for error events
 * @returns Integration instance that filters duplicate events
 */
function dedupeIntegration(): Integration;

Legacy Class-based Integration (Deprecated)

/**
 * Legacy class-based deduplication integration
 * @deprecated Use dedupeIntegration() instead
 */
class Dedupe implements Integration {
  name: string;
  processEvent(event: Event): Event | null;
}

Behavior

Event Filtering

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.

Comparison Logic

Events are considered duplicates if they match on:

  1. Message Events: Same message text, fingerprint, and stacktrace
  2. Exception Events: Same exception type, value, fingerprint, and stacktrace

Fingerprint Comparison

Events with custom fingerprints are compared by joining fingerprint arrays:

  • If both events have no fingerprint: considered matching
  • If only one has fingerprint: not matching
  • If both have fingerprints: compared by joining array elements

Stacktrace Comparison

Stacktraces are compared frame by frame:

  • Same number of frames required
  • Each frame compared on: filename, line number, column number, function name
  • Missing stacktraces on both events: considered matching
  • Stacktrace on only one event: not matching

Usage Examples

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');

Test Utilities

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;

Event Types Processed

  • Error events: Events with exception information
  • Message events: Events with message text
  • Non-error events: Transaction and replay events are ignored (never deduped)

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

docs

console-capture.md

context-lines.md

debug-integration.md

error-deduplication.md

extra-error-data.md

frame-rewriting.md

http-client.md

index.md

offline-support.md

reporting-observer.md

session-timing.md

transaction-integration.md

tile.json