@sentry/node 8.46.0 → 8.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/build/cjs/index.js +2 -1
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/anr/index.js +2 -1
  4. package/build/cjs/integrations/anr/index.js.map +1 -1
  5. package/build/cjs/integrations/local-variables/local-variables-async.js +2 -1
  6. package/build/cjs/integrations/local-variables/local-variables-async.js.map +1 -1
  7. package/build/cjs/integrations/tracing/express.js +19 -1
  8. package/build/cjs/integrations/tracing/express.js.map +1 -1
  9. package/build/cjs/integrations/tracing/prisma.js +3 -1
  10. package/build/cjs/integrations/tracing/prisma.js.map +1 -1
  11. package/build/cjs/sdk/index.js +3 -1
  12. package/build/cjs/sdk/index.js.map +1 -1
  13. package/build/cjs/sdk/initOtel.js +4 -3
  14. package/build/cjs/sdk/initOtel.js.map +1 -1
  15. package/build/esm/index.js +2 -2
  16. package/build/esm/integrations/anr/index.js +2 -1
  17. package/build/esm/integrations/anr/index.js.map +1 -1
  18. package/build/esm/integrations/anr/worker-script.js +2 -2
  19. package/build/esm/integrations/local-variables/local-variables-async.js +2 -1
  20. package/build/esm/integrations/local-variables/local-variables-async.js.map +1 -1
  21. package/build/esm/integrations/local-variables/worker-script.js +2 -2
  22. package/build/esm/integrations/tracing/express.js +19 -1
  23. package/build/esm/integrations/tracing/express.js.map +1 -1
  24. package/build/esm/integrations/tracing/prisma.js +3 -1
  25. package/build/esm/integrations/tracing/prisma.js.map +1 -1
  26. package/build/esm/package.json +1 -1
  27. package/build/esm/sdk/index.js +3 -1
  28. package/build/esm/sdk/index.js.map +1 -1
  29. package/build/esm/sdk/initOtel.js +4 -3
  30. package/build/esm/sdk/initOtel.js.map +1 -1
  31. package/build/types/index.d.ts +2 -2
  32. package/build/types/index.d.ts.map +1 -1
  33. package/build/types/integrations/anr/index.d.ts.map +1 -1
  34. package/build/types/integrations/local-variables/local-variables-async.d.ts.map +1 -1
  35. package/build/types/integrations/tracing/express.d.ts +4 -3
  36. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  37. package/build/types/integrations/tracing/prisma.d.ts.map +1 -1
  38. package/build/types/sdk/index.d.ts.map +1 -1
  39. package/build/types/sdk/initOtel.d.ts +7 -2
  40. package/build/types/sdk/initOtel.d.ts.map +1 -1
  41. package/build/types/types.d.ts +5 -1
  42. package/build/types/types.d.ts.map +1 -1
  43. package/build/types-ts3.8/index.d.ts +2 -2
  44. package/build/types-ts3.8/integrations/tracing/express.d.ts +4 -3
  45. package/build/types-ts3.8/sdk/initOtel.d.ts +7 -2
  46. package/build/types-ts3.8/types.d.ts +5 -1
  47. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  import type { Span as WriteableSpan } from '@opentelemetry/api';
2
2
  import type { Instrumentation } from '@opentelemetry/instrumentation';
3
- import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';
3
+ import type { ReadableSpan, SpanProcessor } from '@opentelemetry/sdk-trace-base';
4
4
  import type { ClientOptions, Options, SamplingContext, Scope, Span, TracePropagationTargets } from '@sentry/core';
5
5
  import type { NodeTransportOptions } from './transports';
6
6
  /**
@@ -107,6 +107,10 @@ export interface BaseNodeOptions {
107
107
  * Use this option if you want to register OpenTelemetry instrumentation that the Sentry SDK does not yet have support for.
108
108
  */
109
109
  openTelemetryInstrumentations?: Instrumentation[];
110
+ /**
111
+ * Provide an array of additional OpenTelemetry SpanProcessors that should be registered.
112
+ */
113
+ openTelemetrySpanProcessors?: SpanProcessor[];
110
114
  /**
111
115
  * The max. duration in seconds that the SDK will wait for parent spans to be finished before discarding a span.
112
116
  * The SDK will automatically clean up spans that have no finished parent after this duration.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAA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AAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,IAAI,CAAC"}
@@ -44,7 +44,7 @@ export { NodeClient } from './sdk/client';
44
44
  export { cron } from './cron';
45
45
  export { NodeOptions } from './types';
46
46
  export { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData } from '@sentry/core';
47
- export { addOpenTelemetryInstrumentation, continueTrace, setOpenTelemetryContextAsyncContextStrategy as setNodeAsyncContextStrategy, } from '@sentry/opentelemetry';
48
- export { addBreadcrumb, isInitialized, getGlobalScope, lastEventId, close, createTransport, flush, SDK_VERSION, getSpanStatusFromHttpCode, setHttpStatus, captureCheckIn, withMonitor, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, addEventProcessor, setContext, setExtra, setExtras, setTag, setTags, setUser, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, setCurrentClient, Scope, setMeasurement, getSpanDescendants, parameterize, getClient, getCurrentHub, getCurrentScope, getIsolationScope, getTraceData, getTraceMetaTags, withScope, withIsolationScope, captureException, captureEvent, captureMessage, captureFeedback, captureConsoleIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, metricsDefault as metrics, startSession, captureSession, endSession, addIntegration, startSpan, startSpanManual, startInactiveSpan, startNewTrace, suppressTracing, getActiveSpan, withActiveSpan, getRootSpan, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, zodErrorsIntegration, profiler, } from '@sentry/core';
47
+ export { addOpenTelemetryInstrumentation, setOpenTelemetryContextAsyncContextStrategy as setNodeAsyncContextStrategy, } from '@sentry/opentelemetry';
48
+ export { addBreadcrumb, isInitialized, getGlobalScope, lastEventId, close, createTransport, flush, SDK_VERSION, getSpanStatusFromHttpCode, setHttpStatus, captureCheckIn, withMonitor, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, addEventProcessor, setContext, setExtra, setExtras, setTag, setTags, setUser, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, setCurrentClient, Scope, setMeasurement, getSpanDescendants, parameterize, getClient, getCurrentHub, getCurrentScope, getIsolationScope, getTraceData, getTraceMetaTags, continueTrace, withScope, withIsolationScope, captureException, captureEvent, captureMessage, captureFeedback, captureConsoleIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, metricsDefault as metrics, startSession, captureSession, endSession, addIntegration, startSpan, startSpanManual, startInactiveSpan, startNewTrace, suppressTracing, getActiveSpan, withActiveSpan, getRootSpan, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, zodErrorsIntegration, profiler, } from '@sentry/core';
49
49
  export { Breadcrumb, BreadcrumbHint, PolymorphicRequest, Request, RequestEventData, SdkInfo, Event, EventHint, ErrorEvent, Exception, Session, SeverityLevel, StackFrame, Stacktrace, Thread, User, Span, } from '@sentry/core';
50
50
  //# sourceMappingURL=index.d.ts.map
@@ -28,7 +28,8 @@ interface MiddlewareError extends Error {
28
28
  statusCode?: number | string;
29
29
  };
30
30
  }
31
- type ExpressMiddleware = (error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void;
31
+ type ExpressMiddleware = (req: http.IncomingMessage, res: http.ServerResponse, next: () => void) => void;
32
+ type ExpressErrorMiddleware = (error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void;
32
33
  interface ExpressHandlerOptions {
33
34
  /**
34
35
  * Callback method deciding whether error should be captured and sent to Sentry
@@ -39,7 +40,7 @@ interface ExpressHandlerOptions {
39
40
  /**
40
41
  * An Express-compatible error handler.
41
42
  */
42
- export declare function expressErrorHandler(options?: ExpressHandlerOptions): ExpressMiddleware;
43
+ export declare function expressErrorHandler(options?: ExpressHandlerOptions): ExpressErrorMiddleware;
43
44
  /**
44
45
  * Add an Express error handler to capture errors to Sentry.
45
46
  *
@@ -65,7 +66,7 @@ export declare function expressErrorHandler(options?: ExpressHandlerOptions): Ex
65
66
  * ```
66
67
  */
67
68
  export declare function setupExpressErrorHandler(app: {
68
- use: (middleware: ExpressMiddleware) => unknown;
69
+ use: (middleware: ExpressMiddleware | ExpressErrorMiddleware) => unknown;
69
70
  }, options?: ExpressHandlerOptions): void;
70
71
  export {};
71
72
  //# sourceMappingURL=express.d.ts.map
@@ -1,10 +1,15 @@
1
+ import { SpanProcessor } from '@opentelemetry/sdk-trace-base';
1
2
  import { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';
2
3
  import { EsmLoaderHookOptions } from '../types';
3
4
  import { NodeClient } from './client';
5
+ interface AdditionalOpenTelemetryOptions {
6
+ /** Additional SpanProcessor instances that should be used. */
7
+ spanProcessors?: SpanProcessor[];
8
+ }
4
9
  /**
5
10
  * Initialize OpenTelemetry for Node.
6
11
  */
7
- export declare function initOpenTelemetry(client: NodeClient): void;
12
+ export declare function initOpenTelemetry(client: NodeClient, options?: AdditionalOpenTelemetryOptions): void;
8
13
  /** Initialize the ESM loader. */
9
14
  export declare function maybeInitializeEsmLoader(esmHookConfig?: EsmLoaderHookOptions): void;
10
15
  interface NodePreloadOptions {
@@ -19,7 +24,7 @@ interface NodePreloadOptions {
19
24
  */
20
25
  export declare function preloadOpenTelemetry(options?: NodePreloadOptions): void;
21
26
  /** Just exported for tests. */
22
- export declare function setupOtel(client: NodeClient): BasicTracerProvider;
27
+ export declare function setupOtel(client: NodeClient, options?: AdditionalOpenTelemetryOptions): BasicTracerProvider;
23
28
  /** Just exported for tests. */
24
29
  export declare function _clampSpanProcessorTimeout(maxSpanWaitDuration: number | undefined): number | undefined;
25
30
  export {};
@@ -1,6 +1,6 @@
1
1
  import { Span as WriteableSpan } from '@opentelemetry/api';
2
2
  import { Instrumentation } from '@opentelemetry/instrumentation';
3
- import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
3
+ import { ReadableSpan, SpanProcessor } from '@opentelemetry/sdk-trace-base';
4
4
  import { ClientOptions, Options, SamplingContext, Scope, Span, TracePropagationTargets } from '@sentry/core';
5
5
  import { NodeTransportOptions } from './transports';
6
6
  /**
@@ -107,6 +107,10 @@ export interface BaseNodeOptions {
107
107
  * Use this option if you want to register OpenTelemetry instrumentation that the Sentry SDK does not yet have support for.
108
108
  */
109
109
  openTelemetryInstrumentations?: Instrumentation[];
110
+ /**
111
+ * Provide an array of additional OpenTelemetry SpanProcessors that should be registered.
112
+ */
113
+ openTelemetrySpanProcessors?: SpanProcessor[];
110
114
  /**
111
115
  * The max. duration in seconds that the SDK will wait for parent spans to be finished before discarding a span.
112
116
  * The SDK will automatically clean up spans that have no finished parent after this duration.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/node",
3
- "version": "8.46.0",
3
+ "version": "8.48.0",
4
4
  "description": "Sentry Node SDK using OpenTelemetry for performance instrumentation",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
@@ -96,9 +96,9 @@
96
96
  "@opentelemetry/resources": "^1.29.0",
97
97
  "@opentelemetry/sdk-trace-base": "^1.29.0",
98
98
  "@opentelemetry/semantic-conventions": "^1.28.0",
99
- "@prisma/instrumentation": "5.19.1",
100
- "@sentry/core": "8.46.0",
101
- "@sentry/opentelemetry": "8.46.0",
99
+ "@prisma/instrumentation": "5.22.0",
100
+ "@sentry/core": "8.48.0",
101
+ "@sentry/opentelemetry": "8.48.0",
102
102
  "import-in-the-middle": "^1.11.2"
103
103
  },
104
104
  "devDependencies": {