@sentry/node 9.39.0 → 9.40.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.
- package/build/cjs/index.js +9 -7
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/tracing/express-v5/utils.js +1 -1
- package/build/cjs/integrations/tracing/express-v5/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/express.js +1 -1
- package/build/cjs/integrations/tracing/express.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/index.js +2 -2
- package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
- package/build/cjs/integrations/tracing/hapi/index.js +1 -1
- package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
- package/build/cjs/integrations/tracing/index.js +3 -0
- package/build/cjs/integrations/tracing/index.js.map +1 -1
- package/build/cjs/integrations/tracing/koa.js +1 -1
- package/build/cjs/integrations/tracing/koa.js.map +1 -1
- package/build/cjs/integrations/tracing/openai/index.js +79 -0
- package/build/cjs/integrations/tracing/openai/index.js.map +1 -0
- package/build/cjs/integrations/tracing/openai/instrumentation.js +81 -0
- package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/postgresjs.js +1 -1
- package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
- package/build/cjs/sdk/initOtel.js +5 -5
- package/build/cjs/sdk/initOtel.js.map +1 -1
- package/build/cjs/utils/redisCache.js +2 -2
- package/build/cjs/utils/redisCache.js.map +1 -1
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/integrations/tracing/express-v5/utils.js +1 -1
- package/build/esm/integrations/tracing/express-v5/utils.js.map +1 -1
- package/build/esm/integrations/tracing/express.js +2 -2
- package/build/esm/integrations/tracing/express.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/index.js +3 -3
- package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
- package/build/esm/integrations/tracing/hapi/index.js +2 -2
- package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
- package/build/esm/integrations/tracing/index.js +3 -0
- package/build/esm/integrations/tracing/index.js.map +1 -1
- package/build/esm/integrations/tracing/koa.js +2 -2
- package/build/esm/integrations/tracing/koa.js.map +1 -1
- package/build/esm/integrations/tracing/openai/index.js +76 -0
- package/build/esm/integrations/tracing/openai/index.js.map +1 -0
- package/build/esm/integrations/tracing/openai/instrumentation.js +79 -0
- package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/postgresjs.js +2 -2
- package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/sdk/initOtel.js +9 -9
- package/build/esm/sdk/initOtel.js.map +1 -1
- package/build/esm/utils/redisCache.js +2 -2
- package/build/esm/utils/redisCache.js.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/openai/index.d.ts +60 -0
- package/build/types/integrations/tracing/openai/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/openai/instrumentation.d.ts +20 -0
- package/build/types/integrations/tracing/openai/instrumentation.d.ts.map +1 -0
- package/build/types-ts3.8/index.d.ts +1 -0
- package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +60 -0
- package/build/types-ts3.8/integrations/tracing/openai/instrumentation.d.ts +20 -0
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/openai/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,+BAA+B,EACpC,mBAAmB,EAEpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAgB,aAAa,EAAE,MAAM,cAAc,CAAC;AAK7E,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IACpD,OAAO,EAAE,aAAa,CAAC;CACxB;AAsBD;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,mBAAmB,CAAC,qBAAqB,CAAC;gBACtE,MAAM,GAAE,qBAA0B;IAIrD;;OAEG;IACI,IAAI,IAAI,+BAA+B;IAK9C;;OAEG;IACH,OAAO,CAAC,MAAM;CAuCf"}
|
|
@@ -23,6 +23,7 @@ export { genericPoolIntegration } from './integrations/tracing/genericPool';
|
|
|
23
23
|
export { dataloaderIntegration } from './integrations/tracing/dataloader';
|
|
24
24
|
export { amqplibIntegration } from './integrations/tracing/amqplib';
|
|
25
25
|
export { vercelAIIntegration } from './integrations/tracing/vercelai';
|
|
26
|
+
export { openAIIntegration } from './integrations/tracing/openai';
|
|
26
27
|
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler, openFeatureIntegration, OpenFeatureIntegrationHook, statsigIntegration, unleashIntegration, } from './integrations/featureFlagShims';
|
|
27
28
|
export { init, getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, initWithoutDefaultIntegrations, } from './sdk';
|
|
28
29
|
export { initOpenTelemetry, preloadOpenTelemetry } from './sdk/initOtel';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { OpenAiOptions } from '@sentry/core';
|
|
2
|
+
import { SentryOpenAiInstrumentation } from './instrumentation';
|
|
3
|
+
export declare const instrumentOpenAi: ((options?: unknown) => SentryOpenAiInstrumentation) & {
|
|
4
|
+
id: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Adds Sentry tracing instrumentation for the OpenAI SDK.
|
|
8
|
+
*
|
|
9
|
+
* This integration is enabled by default.
|
|
10
|
+
*
|
|
11
|
+
* When configured, this integration automatically instruments OpenAI SDK client instances
|
|
12
|
+
* to capture telemetry data following OpenTelemetry Semantic Conventions for Generative AI.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```javascript
|
|
16
|
+
* import * as Sentry from '@sentry/node';
|
|
17
|
+
*
|
|
18
|
+
* Sentry.init({
|
|
19
|
+
* integrations: [Sentry.openAIIntegration()],
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* ## Options
|
|
24
|
+
*
|
|
25
|
+
* - `recordInputs`: Whether to record prompt messages (default: respects `sendDefaultPii` client option)
|
|
26
|
+
* - `recordOutputs`: Whether to record response text (default: respects `sendDefaultPii` client option)
|
|
27
|
+
*
|
|
28
|
+
* ### Default Behavior
|
|
29
|
+
*
|
|
30
|
+
* By default, the integration will:
|
|
31
|
+
* - Record inputs and outputs ONLY if `sendDefaultPii` is set to `true` in your Sentry client options
|
|
32
|
+
* - Otherwise, inputs and outputs are NOT recorded unless explicitly enabled
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```javascript
|
|
36
|
+
* // Record inputs and outputs when sendDefaultPii is false
|
|
37
|
+
* Sentry.init({
|
|
38
|
+
* integrations: [
|
|
39
|
+
* Sentry.openAIIntegration({
|
|
40
|
+
* recordInputs: true,
|
|
41
|
+
* recordOutputs: true
|
|
42
|
+
* })
|
|
43
|
+
* ],
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Never record inputs/outputs regardless of sendDefaultPii
|
|
47
|
+
* Sentry.init({
|
|
48
|
+
* sendDefaultPii: true,
|
|
49
|
+
* integrations: [
|
|
50
|
+
* Sentry.openAIIntegration({
|
|
51
|
+
* recordInputs: false,
|
|
52
|
+
* recordOutputs: false
|
|
53
|
+
* })
|
|
54
|
+
* ],
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
export declare const openAIIntegration: (options?: OpenAiOptions | undefined) => import("@sentry/core").Integration;
|
|
60
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { InstrumentationConfig, InstrumentationModuleDefinition, InstrumentationBase } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { Integration, OpenAiOptions } from '@sentry/core';
|
|
3
|
+
export interface OpenAiIntegration extends Integration {
|
|
4
|
+
options: OpenAiOptions;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Sentry OpenAI instrumentation using OpenTelemetry.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SentryOpenAiInstrumentation extends InstrumentationBase<InstrumentationConfig> {
|
|
10
|
+
constructor(config?: InstrumentationConfig);
|
|
11
|
+
/**
|
|
12
|
+
* Initializes the instrumentation by defining the modules to be patched.
|
|
13
|
+
*/
|
|
14
|
+
init(): InstrumentationModuleDefinition;
|
|
15
|
+
/**
|
|
16
|
+
* Core patch logic applying instrumentation to the OpenAI client constructor.
|
|
17
|
+
*/
|
|
18
|
+
private _patch;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=instrumentation.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/node",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.40.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",
|
|
@@ -95,9 +95,9 @@
|
|
|
95
95
|
"@opentelemetry/sdk-trace-base": "^1.30.1",
|
|
96
96
|
"@opentelemetry/semantic-conventions": "^1.34.0",
|
|
97
97
|
"@prisma/instrumentation": "6.11.1",
|
|
98
|
-
"@sentry/core": "9.
|
|
99
|
-
"@sentry/node-core": "9.
|
|
100
|
-
"@sentry/opentelemetry": "9.
|
|
98
|
+
"@sentry/core": "9.40.0",
|
|
99
|
+
"@sentry/node-core": "9.40.0",
|
|
100
|
+
"@sentry/opentelemetry": "9.40.0",
|
|
101
101
|
"import-in-the-middle": "^1.14.2",
|
|
102
102
|
"minimatch": "^9.0.0"
|
|
103
103
|
},
|