Pluggable integrations that enhance Sentry JavaScript SDKs with additional error tracking, monitoring, and debugging capabilities.
—
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.
/**
* 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;
}The integration analyzes stack frames to generate transaction names:
in_app: truetransaction property to the eventTransaction names follow the pattern: module/function
utils/validateInpututils/??/validateInput<unknown>The integration processes frames in reverse stack order:
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)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;The integration extracts frames from the exception stacktrace:
Once a suitable frame is found:
transaction property to the root event objectFor modern transaction tracking, use:
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// 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);
});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