@depup/sentry__node 10.47.0-depup.1 → 10.48.0-depup.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 (31) hide show
  1. package/README.md +5 -3
  2. package/build/cjs/index.js +5 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/integrations/tracing/express.js +50 -141
  5. package/build/cjs/integrations/tracing/express.js.map +1 -1
  6. package/build/cjs/integrations/tracing/langchain/index.js +4 -3
  7. package/build/cjs/integrations/tracing/langchain/index.js.map +1 -1
  8. package/build/cjs/integrations/tracing/langchain/instrumentation.js +37 -3
  9. package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +1 -1
  10. package/build/esm/index.js +3 -3
  11. package/build/esm/integrations/tracing/express.js +51 -142
  12. package/build/esm/integrations/tracing/express.js.map +1 -1
  13. package/build/esm/integrations/tracing/langchain/index.js +4 -3
  14. package/build/esm/integrations/tracing/langchain/index.js.map +1 -1
  15. package/build/esm/integrations/tracing/langchain/instrumentation.js +38 -4
  16. package/build/esm/integrations/tracing/langchain/instrumentation.js.map +1 -1
  17. package/build/esm/package.json +1 -1
  18. package/build/types/index.d.ts +2 -2
  19. package/build/types/index.d.ts.map +1 -1
  20. package/build/types/integrations/tracing/express.d.ts +13 -68
  21. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  22. package/build/types/integrations/tracing/langchain/index.d.ts +4 -3
  23. package/build/types/integrations/tracing/langchain/index.d.ts.map +1 -1
  24. package/build/types/integrations/tracing/langchain/instrumentation.d.ts +10 -1
  25. package/build/types/integrations/tracing/langchain/instrumentation.d.ts.map +1 -1
  26. package/build/types-ts3.8/index.d.ts +2 -2
  27. package/build/types-ts3.8/integrations/tracing/express.d.ts +13 -68
  28. package/build/types-ts3.8/integrations/tracing/langchain/index.d.ts +4 -3
  29. package/build/types-ts3.8/integrations/tracing/langchain/instrumentation.d.ts +10 -1
  30. package/changes.json +10 -2
  31. package/package.json +17 -10
@@ -15,7 +15,7 @@ export declare class SentryLangChainInstrumentation extends InstrumentationBase<
15
15
  */
16
16
  init(): InstrumentationModuleDefinition | InstrumentationModuleDefinition[];
17
17
  /**
18
- * Core patch logic - patches chat model methods to inject Sentry callbacks
18
+ * Core patch logic - patches chat model and embedding methods
19
19
  * This is called when a LangChain provider package is loaded
20
20
  */
21
21
  private _patch;
@@ -24,6 +24,15 @@ export declare class SentryLangChainInstrumentation extends InstrumentationBase<
24
24
  * Finds a chat model class from the provider package exports and patches its prototype methods
25
25
  */
26
26
  private _patchRunnableMethods;
27
+ /**
28
+ * Patches embedding class methods (embedQuery, embedDocuments) to create Sentry spans.
29
+ *
30
+ * Unlike chat models which use LangChain's callback system, the Embeddings base class
31
+ * has no callback support. We wrap the methods directly on the prototype.
32
+ *
33
+ * Instruments any exported class whose prototype has both embedQuery and embedDocuments as functions.
34
+ */
35
+ private _patchEmbeddingsMethods;
27
36
  }
28
37
  export {};
29
38
  //# sourceMappingURL=instrumentation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/langchain/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,EAGrC,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAYrD,KAAK,+BAA+B,GAAG,qBAAqB,GAAG,gBAAgB,CAAC;AA0EhF;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,mBAAmB,CAAC,+BAA+B,CAAC;gBACnF,MAAM,GAAE,+BAAoC;IAI/D;;;;;;OAMG;IACI,IAAI,IAAI,+BAA+B,GAAG,+BAA+B,EAAE;IA0DlF;;;OAGG;IACH,OAAO,CAAC,MAAM;IAmBd;;;OAGG;IACH,OAAO,CAAC,qBAAqB;CA8C9B"}
1
+ {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/langchain/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,EAGrC,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAarD,KAAK,+BAA+B,GAAG,qBAAqB,GAAG,gBAAgB,CAAC;AA0EhF;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,mBAAmB,CAAC,+BAA+B,CAAC;gBACnF,MAAM,GAAE,+BAAoC;IAI/D;;;;;;OAMG;IACI,IAAI,IAAI,+BAA+B,GAAG,+BAA+B,EAAE;IA0DlF;;;OAGG;IACH,OAAO,CAAC,MAAM;IAyBd;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IA+C7B;;;;;;;OAOG;IACH,OAAO,CAAC,uBAAuB;CAmBhC"}
@@ -36,7 +36,7 @@ export { initOpenTelemetry, preloadOpenTelemetry } from './sdk/initOtel';
36
36
  export { getAutoPerformanceIntegrations } from './integrations/tracing';
37
37
  export { NodeOptions } from './types';
38
38
  export { setOpenTelemetryContextAsyncContextStrategy as setNodeAsyncContextStrategy, } from '@sentry/opentelemetry';
39
- export { addBreadcrumb, isInitialized, isEnabled, getGlobalScope, lastEventId, close, createTransport, flush, SDK_VERSION, getSpanStatusFromHttpCode, setHttpStatus, captureCheckIn, withMonitor, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, eventFiltersIntegration, linkedErrorsIntegration, addEventProcessor, setContext, setExtra, setExtras, setTag, setTags, setUser, setConversationId, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, setCurrentClient, Scope, setMeasurement, getSpanDescendants, parameterize, getClient, getCurrentScope, getIsolationScope, getTraceData, getTraceMetaTags, httpHeadersToSpanAttributes, winterCGHeadersToDict, continueTrace, withScope, withIsolationScope, captureException, captureEvent, captureMessage, captureFeedback, captureConsoleIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, startSession, captureSession, endSession, addIntegration, startSpan, startSpanManual, startInactiveSpan, startNewTrace, suppressTracing, getActiveSpan, withActiveSpan, getRootSpan, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, supabaseIntegration, instrumentSupabaseClient, instrumentOpenAiClient, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, zodErrorsIntegration, profiler, consoleLoggingIntegration, createConsolaReporter, consoleIntegration, wrapMcpServerWithSentry, featureFlagsIntegration, createLangChainCallbackHandler, instrumentLangGraph, instrumentStateGraphCompile, } from '@sentry/core';
39
+ export { addBreadcrumb, isInitialized, isEnabled, getGlobalScope, lastEventId, close, createTransport, flush, SDK_VERSION, getSpanStatusFromHttpCode, setHttpStatus, captureCheckIn, withMonitor, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, eventFiltersIntegration, linkedErrorsIntegration, addEventProcessor, setContext, setExtra, setExtras, setTag, setTags, setUser, setConversationId, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, setCurrentClient, Scope, setMeasurement, getSpanDescendants, parameterize, getClient, getCurrentScope, getIsolationScope, getTraceData, getTraceMetaTags, httpHeadersToSpanAttributes, winterCGHeadersToDict, continueTrace, withScope, withIsolationScope, captureException, captureEvent, captureMessage, captureFeedback, captureConsoleIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, startSession, captureSession, endSession, addIntegration, startSpan, startSpanManual, startInactiveSpan, startNewTrace, suppressTracing, getActiveSpan, withActiveSpan, getRootSpan, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, supabaseIntegration, instrumentSupabaseClient, instrumentOpenAiClient, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, zodErrorsIntegration, profiler, consoleLoggingIntegration, createConsolaReporter, consoleIntegration, wrapMcpServerWithSentry, featureFlagsIntegration, spanStreamingIntegration, createLangChainCallbackHandler, instrumentLangChainEmbeddings, instrumentLangGraph, instrumentStateGraphCompile, } from '@sentry/core';
40
40
  export { Breadcrumb, BreadcrumbHint, PolymorphicRequest, RequestEventData, SdkInfo, Event, EventHint, ErrorEvent, Exception, Session, SeverityLevel, StackFrame, Stacktrace, Thread, User, Span, Metric, Log, LogSeverityLevel, FeatureFlagsIntegration, ExclusiveEventHintOrCaptureContext, CaptureContext, } from '@sentry/core';
41
- export { logger, metrics, httpServerIntegration, httpServerSpansIntegration, nodeContextIntegration, contextLinesIntegration, localVariablesIntegration, modulesIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, anrIntegration, disableAnrDetectionForCallback, spotlightIntegration, childProcessIntegration, processSessionIntegration, nodeRuntimeMetricsIntegration, NodeRuntimeMetricsOptions, pinoIntegration, createSentryWinstonTransport, SentryContextManager, systemErrorIntegration, generateInstrumentOnce, getSentryRelease, defaultStackParser, createGetModuleFromFilename, makeNodeTransport, NodeClient, cron, NODE_VERSION, validateOpenTelemetrySetup } from '@sentry/node-core';
41
+ export { logger, metrics, httpServerIntegration, httpServerSpansIntegration, nodeContextIntegration, contextLinesIntegration, localVariablesIntegration, modulesIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, anrIntegration, disableAnrDetectionForCallback, spotlightIntegration, childProcessIntegration, processSessionIntegration, nodeRuntimeMetricsIntegration, NodeRuntimeMetricsOptions, pinoIntegration, createSentryWinstonTransport, SentryContextManager, systemErrorIntegration, generateInstrumentOnce, getSentryRelease, defaultStackParser, createGetModuleFromFilename, makeNodeTransport, NodeClient, cron, NODE_VERSION, validateOpenTelemetrySetup, withStreamedSpan, _INTERNAL_normalizeCollectionInterval } from '@sentry/node-core';
42
42
  //# sourceMappingURL=index.d.ts.map
@@ -1,72 +1,17 @@
1
- import * as http from 'node:http';
2
- import { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';
3
- export declare const instrumentExpress: ((options?: unknown) => ExpressInstrumentation) & {
1
+ import { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
3
+ import { ExpressIntegrationOptions, ExpressHandlerOptions } from '@sentry/core';
4
+ export { expressErrorHandler } from '@sentry/core';
5
+ export declare function setupExpressErrorHandler(app: {
6
+ use: (middleware: any) => unknown;
7
+ }, options?: ExpressHandlerOptions): void;
8
+ export type ExpressInstrumentationConfig = InstrumentationConfig & Pick<ExpressIntegrationOptions, Exclude<keyof ExpressIntegrationOptions, 'express' | 'onRouteResolved'>>;
9
+ export declare const instrumentExpress: ((options?: ExpressInstrumentationConfig | undefined) => ExpressInstrumentation) & {
4
10
  id: string;
5
11
  };
6
- /**
7
- * Adds Sentry tracing instrumentation for [Express](https://expressjs.com/).
8
- *
9
- * If you also want to capture errors, you need to call `setupExpressErrorHandler(app)` after you set up your Express server.
10
- *
11
- * For more information, see the [express documentation](https://docs.sentry.io/platforms/javascript/guides/express/).
12
- *
13
- * @example
14
- * ```javascript
15
- * const Sentry = require('@sentry/node');
16
- *
17
- * Sentry.init({
18
- * integrations: [Sentry.expressIntegration()],
19
- * })
20
- * ```
21
- */
22
- export declare const expressIntegration: () => import("@sentry/core").Integration;
23
- interface MiddlewareError extends Error {
24
- status?: number | string;
25
- statusCode?: number | string;
26
- status_code?: number | string;
27
- output?: {
28
- statusCode?: number | string;
29
- };
30
- }
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;
33
- interface ExpressHandlerOptions {
34
- /**
35
- * Callback method deciding whether error should be captured and sent to Sentry
36
- * @param error Captured middleware error
37
- */
38
- shouldHandleError?(this: void, error: MiddlewareError): boolean;
12
+ export declare class ExpressInstrumentation extends InstrumentationBase<ExpressInstrumentationConfig> {
13
+ constructor(config?: ExpressInstrumentationConfig);
14
+ init(): InstrumentationNodeModuleDefinition;
39
15
  }
40
- /**
41
- * An Express-compatible error handler.
42
- */
43
- export declare function expressErrorHandler(options?: ExpressHandlerOptions): ExpressErrorMiddleware;
44
- /**
45
- * Add an Express error handler to capture errors to Sentry.
46
- *
47
- * The error handler must be before any other middleware and after all controllers.
48
- *
49
- * @param app The Express instances
50
- * @param options {ExpressHandlerOptions} Configuration options for the handler
51
- *
52
- * @example
53
- * ```javascript
54
- * const Sentry = require('@sentry/node');
55
- * const express = require("express");
56
- *
57
- * const app = express();
58
- *
59
- * // Add your routes, etc.
60
- *
61
- * // Add this after all routes,
62
- * // but before any and other error-handling middlewares are defined
63
- * Sentry.setupExpressErrorHandler(app);
64
- *
65
- * app.listen(3000);
66
- * ```
67
- */
68
- export declare function setupExpressErrorHandler(app: {
69
- use: (middleware: ExpressMiddleware | ExpressErrorMiddleware) => unknown;
70
- }, options?: ExpressHandlerOptions): void;
71
- export {};
16
+ export declare const expressIntegration: (options?: ExpressInstrumentationConfig | undefined) => import("@sentry/core").Integration;
72
17
  //# sourceMappingURL=express.d.ts.map
@@ -88,9 +88,10 @@ export declare const instrumentLangChain: ((options?: LangChainOptions | undefin
88
88
  * ## Supported Events
89
89
  *
90
90
  * The integration captures the following LangChain lifecycle events:
91
- * - LLM/Chat Model: start, end, error
92
- * - Chain: start, end, error
93
- * - Tool: start, end, error
91
+ * - LLM/Chat Model: start, end, error (via callbacks)
92
+ * - Chain: start, end, error (via callbacks)
93
+ * - Tool: start, end, error (via callbacks)
94
+ * - Embeddings: embedQuery, embedDocuments (via direct method wrapping)
94
95
  *
95
96
  */
96
97
  export declare const langChainIntegration: (options?: LangChainOptions | undefined) => import("@sentry/core").Integration;
@@ -15,7 +15,7 @@ export declare class SentryLangChainInstrumentation extends InstrumentationBase<
15
15
  */
16
16
  init(): InstrumentationModuleDefinition | InstrumentationModuleDefinition[];
17
17
  /**
18
- * Core patch logic - patches chat model methods to inject Sentry callbacks
18
+ * Core patch logic - patches chat model and embedding methods
19
19
  * This is called when a LangChain provider package is loaded
20
20
  */
21
21
  private _patch;
@@ -24,6 +24,15 @@ export declare class SentryLangChainInstrumentation extends InstrumentationBase<
24
24
  * Finds a chat model class from the provider package exports and patches its prototype methods
25
25
  */
26
26
  private _patchRunnableMethods;
27
+ /**
28
+ * Patches embedding class methods (embedQuery, embedDocuments) to create Sentry spans.
29
+ *
30
+ * Unlike chat models which use LangChain's callback system, the Embeddings base class
31
+ * has no callback support. We wrap the methods directly on the prototype.
32
+ *
33
+ * Instruments any exported class whose prototype has both embedQuery and embedDocuments as functions.
34
+ */
35
+ private _patchEmbeddingsMethods;
27
36
  }
28
37
  export {};
29
38
  //# sourceMappingURL=instrumentation.d.ts.map
package/changes.json CHANGED
@@ -3,8 +3,16 @@
3
3
  "@prisma/instrumentation": {
4
4
  "from": "7.6.0",
5
5
  "to": "^7.7.0"
6
+ },
7
+ "@fastify/otel": {
8
+ "from": "0.18.0",
9
+ "to": "^0.18.1"
10
+ },
11
+ "import-in-the-middle": {
12
+ "from": "^3.0.0",
13
+ "to": "^3.0.1"
6
14
  }
7
15
  },
8
- "timestamp": "2026-04-07T16:31:11.810Z",
9
- "totalUpdated": 1
16
+ "timestamp": "2026-04-09T16:37:22.209Z",
17
+ "totalUpdated": 3
10
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/sentry__node",
3
- "version": "10.47.0-depup.1",
3
+ "version": "10.48.0-depup.0",
4
4
  "description": "Sentry Node SDK using OpenTelemetry for performance instrumentation (with updated dependencies)",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
@@ -71,7 +71,6 @@
71
71
  "@opentelemetry/instrumentation-amqplib": "0.61.0",
72
72
  "@opentelemetry/instrumentation-connect": "0.57.0",
73
73
  "@opentelemetry/instrumentation-dataloader": "0.31.0",
74
- "@opentelemetry/instrumentation-express": "0.62.0",
75
74
  "@opentelemetry/instrumentation-fs": "0.33.0",
76
75
  "@opentelemetry/instrumentation-generic-pool": "0.57.0",
77
76
  "@opentelemetry/instrumentation-graphql": "0.62.0",
@@ -94,11 +93,11 @@
94
93
  "@opentelemetry/sdk-trace-base": "^2.6.1",
95
94
  "@opentelemetry/semantic-conventions": "^1.40.0",
96
95
  "@prisma/instrumentation": "^7.7.0",
97
- "@fastify/otel": "0.18.0",
98
- "@sentry/core": "10.47.0",
99
- "@sentry/node-core": "10.47.0",
100
- "@sentry/opentelemetry": "10.47.0",
101
- "import-in-the-middle": "^3.0.0"
96
+ "@fastify/otel": "^0.18.1",
97
+ "@sentry/core": "10.48.0",
98
+ "@sentry/node-core": "10.48.0",
99
+ "@sentry/opentelemetry": "10.48.0",
100
+ "import-in-the-middle": "^3.0.1"
102
101
  },
103
102
  "devDependencies": {
104
103
  "@types/node": "^18.19.1"
@@ -141,12 +140,20 @@
141
140
  "@prisma/instrumentation": {
142
141
  "from": "7.6.0",
143
142
  "to": "^7.7.0"
143
+ },
144
+ "@fastify/otel": {
145
+ "from": "0.18.0",
146
+ "to": "^0.18.1"
147
+ },
148
+ "import-in-the-middle": {
149
+ "from": "^3.0.0",
150
+ "to": "^3.0.1"
144
151
  }
145
152
  },
146
- "depsUpdated": 1,
153
+ "depsUpdated": 3,
147
154
  "originalPackage": "@sentry/node",
148
- "originalVersion": "10.47.0",
149
- "processedAt": "2026-04-07T16:31:20.191Z",
155
+ "originalVersion": "10.48.0",
156
+ "processedAt": "2026-04-09T16:37:27.851Z",
150
157
  "smokeTest": "passed"
151
158
  }
152
159
  }