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

transaction-integration.mddocs/

Transaction Integration

Legacy integration that adds transaction names to events based on stack frame analysis. This integration is deprecated and will be removed in version 8.

Deprecation Notice: This integration is no longer maintained and will be removed in future versions. Modern Sentry SDKs provide better transaction tracking through performance monitoring features.

Capabilities

Legacy Class-based Integration (Deprecated)

/**
 * Adds node transaction names to events based on stack frames
 * @deprecated This integration will be removed in v8
 */
class Transaction implements Integration {
  name: string;
  processEvent(event: Event): Event;
}

Behavior

Transaction Name Generation

The integration analyzes stack frames to generate transaction names:

  1. Frame Analysis: Iterates through stack frames in reverse order (newest to oldest)
  2. In-App Detection: Looks for frames marked as in_app: true
  3. Name Generation: Creates transaction name from first in-app frame found
  4. Event Enhancement: Adds transaction property to the event

Transaction Name Format

Transaction names follow the pattern: module/function

  • With module and function: utils/validateInput
  • Module only: utils/?
  • Function only: ?/validateInput
  • Neither: <unknown>

Frame Priority

The integration processes frames in reverse stack order:

  • Newest frame first: Most recent function call gets priority
  • First in-app frame: Only the first matching frame is used
  • Skip non-app frames: Frames from libraries/dependencies are ignored

Usage Examples

import { Transaction } from '@sentry/integrations';
import * as Sentry from '@sentry/browser';

// Add transaction names to events
Sentry.init({
  dsn: 'YOUR_DSN',
  integrations: [
    new Transaction()
  ]
});

// Example stack trace processing:
function userAction() {           // in_app: true
  helperFunction();
}

function helperFunction() {       // in_app: true  
  throw new Error('Something failed');
}

// Results in event with transaction: "helperFunction/?"
// (assuming no module information available)

Internal Functions

The integration uses internal helper functions:

/**
 * Extracts stack frames from an event
 * @param event - Sentry event to process
 * @returns Array of stack frames or empty array
 */
function _getFramesFromEvent(event: Event): StackFrame[];

/**
 * Generates transaction name from a stack frame
 * @param frame - Stack frame to process
 * @returns Transaction name string
 */
function _getTransaction(frame: StackFrame): string;

Event Processing

Frame Extraction

The integration extracts frames from the exception stacktrace:

  • Exception events only: Only processes events with exception data
  • First exception: Uses the first exception value if multiple exist
  • Stacktrace frames: Accesses frames from exception.stacktrace.frames

Transaction Assignment

Once a suitable frame is found:

  • Event modification: Adds transaction property to the root event object
  • Single assignment: Only the first matching frame determines the transaction name
  • Permanent: Transaction name remains with the event through processing

Migration Path

For modern transaction tracking, use:

Performance Monitoring

import * as Sentry from '@sentry/browser';

Sentry.init({
  dsn: 'YOUR_DSN',
  tracesSampleRate: 1.0,  // Enable performance monitoring
});

// Manual transaction creation
const transaction = Sentry.startTransaction({
  name: 'User Action',
  op: 'navigation'
});

// Automatic transaction tracking (framework-specific)
// React, Vue, Angular SDKs provide automatic transaction naming

Custom Transaction Names

// Set transaction name directly
Sentry.configureScope((scope) => {
  scope.setTransactionName('Custom Transaction Name');
});

// Or use transaction context
Sentry.withScope((scope) => {
  scope.setTransactionName('Specific Action');
  Sentry.captureException(error);
});

Limitations

  • No configuration: Integration has no customization options
  • Simple naming: Basic module/function pattern only
  • Exception events only: Does not process other event types
  • Single frame: Only uses first in-app frame found
  • No context: Does not consider call context or parameters

This integration was designed for basic transaction identification in older Node.js applications but has been superseded by comprehensive performance monitoring and transaction tracking features in modern Sentry SDKs.

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