File tree Expand file tree Collapse file tree 4 files changed +12
-42
lines changed Expand file tree Collapse file tree 4 files changed +12
-42
lines changed Original file line number Diff line number Diff line change 1- import { Integrations } from '@sentry/node-experimental' ;
1+ import { httpIntegration as originalHttpIntegration } from '@sentry/node-experimental' ;
22
3- /**
4- * A custom HTTP integration where we always enable tracing.
5- */
6- export class Http extends Integrations . Http {
7- public constructor ( options ?: ConstructorParameters < typeof Integrations . Http > [ 0 ] ) {
8- super ( {
9- ...options ,
10- tracing : true ,
11- } ) ;
12- }
13- }
3+ export const httpIntegration : typeof originalHttpIntegration = options => {
4+ return originalHttpIntegration ( { ...options , tracing : true } ) ;
5+ } ;
Original file line number Diff line number Diff line change @@ -13,16 +13,14 @@ import { devErrorSymbolicationEventProcessor } from '../common/devErrorSymbolica
1313import { getVercelEnv } from '../common/getVercelEnv' ;
1414import { isBuild } from '../common/utils/isBuild' ;
1515import { distDirRewriteFramesIntegration } from './distDirRewriteFramesIntegration' ;
16- import { Http } from './httpIntegration' ;
17- import { OnUncaughtException } from './onUncaughtExceptionIntegration' ;
16+ import { httpIntegration } from './httpIntegration' ;
17+ import { onUncaughtExceptionIntegration } from './onUncaughtExceptionIntegration' ;
1818
1919export * from '@sentry/node-experimental' ;
2020export { captureUnderscoreErrorException } from '../common/_error' ;
2121
2222export const Integrations = {
2323 ...OriginalIntegrations ,
24- Http,
25- OnUncaughtException,
2624} ;
2725
2826const globalWithInjectedValues = global as typeof global & {
@@ -85,8 +83,8 @@ export function init(options: NodeOptions): void {
8583 ...getDefaultIntegrations ( options ) . filter (
8684 integration => ! [ 'Http' , 'OnUncaughtException' ] . includes ( integration . name ) ,
8785 ) ,
88- new Http ( ) ,
89- new OnUncaughtException ( ) ,
86+ httpIntegration ( ) ,
87+ onUncaughtExceptionIntegration ( ) ,
9088 ] ;
9189
9290 // This value is injected at build time, based on the output directory specified in the build config. Though a default
Original file line number Diff line number Diff line change 1- import { Integrations } from '@sentry/node-experimental' ;
1+ import { onUncaughtExceptionIntegration as originalOnUncaughtExceptionIntegration } from '@sentry/node-experimental' ;
22
3- /**
4- * A custom OnUncaughtException integration that does not exit by default.
5- */
6- export class OnUncaughtException extends Integrations . OnUncaughtException {
7- public constructor ( options ?: ConstructorParameters < typeof Integrations . OnUncaughtException > [ 0 ] ) {
8- super ( {
9- exitEvenIfOtherHandlersAreRegistered : false ,
10- ...options ,
11- } ) ;
12- }
13- }
3+ export const onUncaughtExceptionIntegration : typeof originalOnUncaughtExceptionIntegration = options => {
4+ return originalOnUncaughtExceptionIntegration ( { ...options , exitEvenIfOtherHandlersAreRegistered : false } ) ;
5+ } ;
Original file line number Diff line number Diff line change @@ -151,18 +151,6 @@ describe('Server init()', () => {
151151 expect ( httpIntegration ) . toBeDefined ( ) ;
152152 expect ( httpIntegration ) . toEqual ( expect . objectContaining ( { _tracing : { } } ) ) ;
153153 } ) ;
154-
155- it ( 'forces `_tracing = true` even if set to false' , ( ) => {
156- init ( {
157- integrations : [ new Integrations . Http ( { tracing : false } ) ] ,
158- } ) ;
159-
160- const nodeInitOptions = nodeInit . mock . calls [ 0 ] [ 0 ] as ModifiedInitOptions ;
161- const httpIntegration = findIntegrationByName ( nodeInitOptions . integrations , 'Http' ) ;
162-
163- expect ( httpIntegration ) . toBeDefined ( ) ;
164- expect ( httpIntegration ) . toEqual ( expect . objectContaining ( { _tracing : { } } ) ) ;
165- } ) ;
166154 } ) ;
167155 } ) ;
168156} ) ;
You can’t perform that action at this time.
0 commit comments