diff --git a/dev-packages/e2e-tests/test-applications/node-nestjs-basic/src/example.interceptor.ts b/dev-packages/e2e-tests/test-applications/node-nestjs-basic/src/example.interceptor.ts index 75c301b4cffc..260c1798449f 100644 --- a/dev-packages/e2e-tests/test-applications/node-nestjs-basic/src/example.interceptor.ts +++ b/dev-packages/e2e-tests/test-applications/node-nestjs-basic/src/example.interceptor.ts @@ -1,9 +1,10 @@ import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common'; import * as Sentry from '@sentry/nestjs'; +import { Observable } from 'rxjs'; @Injectable() export class ExampleInterceptor implements NestInterceptor { - intercept(context: ExecutionContext, next: CallHandler) { + intercept(context: ExecutionContext, next: CallHandler): Observable { Sentry.startSpan({ name: 'test-interceptor-span' }, () => {}); return next.handle().pipe(); } diff --git a/packages/node/src/integrations/tracing/nest.ts b/packages/node/src/integrations/tracing/nest.ts index 6b452ab3add3..b3d1b3547118 100644 --- a/packages/node/src/integrations/tracing/nest.ts +++ b/packages/node/src/integrations/tracing/nest.ts @@ -23,7 +23,6 @@ import { } from '@sentry/core'; import type { IntegrationFn, Span } from '@sentry/types'; import { addNonEnumerableProperty, logger } from '@sentry/utils'; -import type { Observable } from 'rxjs'; import { generateInstrumentOnce } from '../../otel/instrument'; interface MinimalNestJsExecutionContext { @@ -61,6 +60,13 @@ const supportedVersions = ['>=8.0.0 <11']; const sentryPatched = 'sentryPatched'; +/** + * A minimal interface for an Observable. + */ +export interface Observable { + subscribe(observer: (value: T) => void): void; +} + /** * A NestJS call handler. Used in interceptors to start the route execution. */