@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.
Files changed (60) hide show
  1. package/build/cjs/index.js +9 -7
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/tracing/express-v5/utils.js +1 -1
  4. package/build/cjs/integrations/tracing/express-v5/utils.js.map +1 -1
  5. package/build/cjs/integrations/tracing/express.js +1 -1
  6. package/build/cjs/integrations/tracing/express.js.map +1 -1
  7. package/build/cjs/integrations/tracing/fastify/index.js +2 -2
  8. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  9. package/build/cjs/integrations/tracing/hapi/index.js +1 -1
  10. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  11. package/build/cjs/integrations/tracing/index.js +3 -0
  12. package/build/cjs/integrations/tracing/index.js.map +1 -1
  13. package/build/cjs/integrations/tracing/koa.js +1 -1
  14. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  15. package/build/cjs/integrations/tracing/openai/index.js +79 -0
  16. package/build/cjs/integrations/tracing/openai/index.js.map +1 -0
  17. package/build/cjs/integrations/tracing/openai/instrumentation.js +81 -0
  18. package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -0
  19. package/build/cjs/integrations/tracing/postgresjs.js +1 -1
  20. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  21. package/build/cjs/sdk/initOtel.js +5 -5
  22. package/build/cjs/sdk/initOtel.js.map +1 -1
  23. package/build/cjs/utils/redisCache.js +2 -2
  24. package/build/cjs/utils/redisCache.js.map +1 -1
  25. package/build/esm/index.js +1 -0
  26. package/build/esm/index.js.map +1 -1
  27. package/build/esm/integrations/tracing/express-v5/utils.js +1 -1
  28. package/build/esm/integrations/tracing/express-v5/utils.js.map +1 -1
  29. package/build/esm/integrations/tracing/express.js +2 -2
  30. package/build/esm/integrations/tracing/express.js.map +1 -1
  31. package/build/esm/integrations/tracing/fastify/index.js +3 -3
  32. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  33. package/build/esm/integrations/tracing/hapi/index.js +2 -2
  34. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  35. package/build/esm/integrations/tracing/index.js +3 -0
  36. package/build/esm/integrations/tracing/index.js.map +1 -1
  37. package/build/esm/integrations/tracing/koa.js +2 -2
  38. package/build/esm/integrations/tracing/koa.js.map +1 -1
  39. package/build/esm/integrations/tracing/openai/index.js +76 -0
  40. package/build/esm/integrations/tracing/openai/index.js.map +1 -0
  41. package/build/esm/integrations/tracing/openai/instrumentation.js +79 -0
  42. package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -0
  43. package/build/esm/integrations/tracing/postgresjs.js +2 -2
  44. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  45. package/build/esm/package.json +1 -1
  46. package/build/esm/sdk/initOtel.js +9 -9
  47. package/build/esm/sdk/initOtel.js.map +1 -1
  48. package/build/esm/utils/redisCache.js +2 -2
  49. package/build/esm/utils/redisCache.js.map +1 -1
  50. package/build/types/index.d.ts +1 -0
  51. package/build/types/index.d.ts.map +1 -1
  52. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  53. package/build/types/integrations/tracing/openai/index.d.ts +60 -0
  54. package/build/types/integrations/tracing/openai/index.d.ts.map +1 -0
  55. package/build/types/integrations/tracing/openai/instrumentation.d.ts +20 -0
  56. package/build/types/integrations/tracing/openai/instrumentation.d.ts.map +1 -0
  57. package/build/types-ts3.8/index.d.ts +1 -0
  58. package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +60 -0
  59. package/build/types-ts3.8/integrations/tracing/openai/instrumentation.d.ts +20 -0
  60. 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.39.0",
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.39.0",
99
- "@sentry/node-core": "9.39.0",
100
- "@sentry/opentelemetry": "9.39.0",
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
  },