@brizz/sdk 0.1.46 → 0.1.47

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/README.md CHANGED
@@ -106,7 +106,7 @@ Pass the libraries you use to `instrumentModules` and the SDK traces them:
106
106
  - **OpenAI** - `openai` package
107
107
  - **Anthropic** - `@anthropic-ai/sdk` package
108
108
  - **Vercel AI SDK** - `ai` package (generateText, streamText, etc.)
109
- - Captured through `experimental_telemetry: { isEnabled: true }` on each call, not `instrumentModules`
109
+ - Captured through the AI SDK's own telemetry, not `instrumentModules` — on by default on `ai@7` (with `@ai-sdk/otel` installed); on `ai@6` and earlier, pass `experimental_telemetry: { isEnabled: true }` on each call
110
110
  - **LangChain** - `langchain` and `@langchain/*` packages
111
111
  - **LlamaIndex** - `llamaindex` package
112
112
  - **AWS Bedrock** - `@aws-sdk/client-bedrock-runtime`
@@ -135,7 +135,7 @@ On `ai@7` and newer, also install `@ai-sdk/otel` — v7 moved AI SDK span collec
135
135
  into that package, so without it your `generateText` / `streamText` calls produce no
136
136
  spans. It isn't needed on `ai@6`.
137
137
 
138
- For Vercel AI SDK instrumentation, you need to enable telemetry in your function calls:
138
+ On `ai@6` and earlier, telemetry is off by default, so enable it on each call. On `ai@7` it is on by default and the flag is optional:
139
139
 
140
140
  ```typescript
141
141
  import { generateText, streamText } from 'ai';
@@ -145,14 +145,14 @@ import { openai } from '@ai-sdk/openai';
145
145
  const result = await generateText({
146
146
  model: openai('gpt-4'),
147
147
  prompt: 'Hello, world!',
148
- experimental_telemetry: { isEnabled: true }, // Required for instrumentation
148
+ experimental_telemetry: { isEnabled: true }, // Required on ai@6 and earlier
149
149
  });
150
150
 
151
151
  // For streamText
152
152
  const stream = streamText({
153
153
  model: openai('gpt-4'),
154
154
  messages: [{ role: 'user', content: 'Hello!' }],
155
- experimental_telemetry: { isEnabled: true }, // Required for instrumentation
155
+ experimental_telemetry: { isEnabled: true }, // Required on ai@6 and earlier
156
156
  });
157
157
  ```
158
158
 
@@ -870,7 +870,7 @@ Check out the [examples](./examples/) directory for complete working examples:
870
870
  - Ensure `Brizz.initialize()` runs before any AI calls
871
871
  - Pass the libraries you want to trace via `instrumentModules`
872
872
  - Check that `BRIZZ_API_KEY` is set
873
- - For Vercel AI SDK: Add `experimental_telemetry: { isEnabled: true }` to function calls
873
+ - For Vercel AI SDK: on `ai@7`, install `@ai-sdk/otel`; on `ai@6` and earlier, add `experimental_telemetry: { isEnabled: true }` to function calls
874
874
 
875
875
  **CJS/ESM compatibility issues**
876
876
 
@@ -9,7 +9,7 @@ var _chunk5WBPX342cjs = require('./chunk-5WBPX342.cjs');
9
9
 
10
10
  // src/internal/version.ts
11
11
  function getSDKVersion() {
12
- return "0.1.46";
12
+ return "0.1.47";
13
13
  }
14
14
 
15
15
  // src/internal/instrumentation/mcp/session.ts
@@ -9,7 +9,7 @@ import {
9
9
 
10
10
  // src/internal/version.ts
11
11
  function getSDKVersion() {
12
- return "0.1.46";
12
+ return "0.1.47";
13
13
  }
14
14
 
15
15
  // src/internal/instrumentation/mcp/session.ts
package/dist/index.cjs CHANGED
@@ -5,7 +5,7 @@ var _chunkUNLNNKZ7cjs = require('./chunk-UNLNNKZ7.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunkVFWTFL7Ecjs = require('./chunk-VFWTFL7E.cjs');
8
+ var _chunkEWT4TUB7cjs = require('./chunk-EWT4TUB7.cjs');
9
9
 
10
10
 
11
11
 
@@ -99,7 +99,7 @@ var _api = require('@opentelemetry/api');
99
99
 
100
100
  // src/internal/instrumentation/langgraph/attributes.ts
101
101
  var INSTRUMENTATION_NAME = "@brizz/sdk/langgraph";
102
- var INSTRUMENTATION_VERSION = _chunkVFWTFL7Ecjs.getSDKVersion.call(void 0, );
102
+ var INSTRUMENTATION_VERSION = _chunkEWT4TUB7cjs.getSDKVersion.call(void 0, );
103
103
  var MODULE_NAME = "@langchain/langgraph";
104
104
  var SUPPORTED_VERSIONS = [">=0.2.0 <2"];
105
105
  var CHECKPOINT_SPAN_NAME = "brizz.langgraph.checkpoint";
@@ -418,7 +418,7 @@ function loadGenAIInstrumentations() {
418
418
  function loadMCPInstrumentation() {
419
419
  void (async () => {
420
420
  try {
421
- const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-M3WRCR7G.cjs")));
421
+ const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-3FOEDOF2.cjs")));
422
422
  const mcp = new MCPInstrumentation({ exceptionLogger });
423
423
  _instrumentation.registerInstrumentations.call(void 0, { instrumentations: [mcp] });
424
424
  _chunkWC573FCIcjs.logger.debug("Auto-loaded MCP instrumentation");
@@ -693,6 +693,7 @@ var SDK_LANGUAGE = "typescript";
693
693
 
694
694
 
695
695
  // src/internal/instrumentation/langchain.ts
696
+ var _module = require('module');
696
697
 
697
698
  var SCOPE_NAME = "@arizeai/openinference-instrumentation-langchain";
698
699
  var PATCHED_MARKER = /* @__PURE__ */ Symbol.for("brizz.langchain.callbackManagerPatched");
@@ -751,6 +752,12 @@ function patchInstalledCallbackManager() {
751
752
  } catch (error) {
752
753
  _chunkWC573FCIcjs.logger.debug(`LangChain callback manager not patched: ${String(error)}`);
753
754
  }
755
+ try {
756
+ const requireFromSdk = _module.createRequire.call(void 0, __filename);
757
+ patchCallbackManagerModule(requireFromSdk("@langchain/core/callbacks/manager"));
758
+ } catch (error) {
759
+ _chunkWC573FCIcjs.logger.debug(`LangChain CJS callback manager not patched: ${String(error)}`);
760
+ }
754
761
  })();
755
762
  }
756
763
  function restampLangChainSpan(span) {
@@ -907,7 +914,7 @@ var InstrumentationRegistry = (_class = class _InstrumentationRegistry {construc
907
914
  const mcpModules = this.manualModules.mcp;
908
915
  void (async () => {
909
916
  try {
910
- const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-M3WRCR7G.cjs")));
917
+ const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-3FOEDOF2.cjs")));
911
918
  const instrumentation = new MCPInstrumentation({ exceptionLogger: exceptionLogger2 });
912
919
  instrumentation.manuallyInstrument(mcpModules);
913
920
  _chunkWC573FCIcjs.logger.debug("Manual instrumentation enabled for MCP");
@@ -2176,7 +2183,7 @@ var LoggingModule = (_class3 = class _LoggingModule {constructor() { _class3.pro
2176
2183
  const resourceAttributes = {
2177
2184
  ...config.resourceAttributes,
2178
2185
  "service.name": serviceName,
2179
- [BRIZZ_SDK_VERSION]: _chunkVFWTFL7Ecjs.getSDKVersion.call(void 0, ),
2186
+ [BRIZZ_SDK_VERSION]: _chunkEWT4TUB7cjs.getSDKVersion.call(void 0, ),
2180
2187
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
2181
2188
  };
2182
2189
  if (config.environment) {
@@ -2425,7 +2432,7 @@ var BrizzSpanExporter = (_class5 = class {
2425
2432
  const resourceAttrs = {
2426
2433
  ...config.resourceAttributes,
2427
2434
  "service.name": config.appName,
2428
- [BRIZZ_SDK_VERSION]: _chunkVFWTFL7Ecjs.getSDKVersion.call(void 0, ),
2435
+ [BRIZZ_SDK_VERSION]: _chunkEWT4TUB7cjs.getSDKVersion.call(void 0, ),
2429
2436
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
2430
2437
  };
2431
2438
  if (config.environment) {
@@ -2916,7 +2923,7 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
2916
2923
  */
2917
2924
  setupInstrumentation(options) {
2918
2925
  const registry = InstrumentationRegistry.getInstance();
2919
- _chunkVFWTFL7Ecjs.configure.call(void 0, resolveMcpSessionTracking(options.mcpSessionTracking));
2926
+ _chunkEWT4TUB7cjs.configure.call(void 0, resolveMcpSessionTracking(options.mcpSessionTracking));
2920
2927
  patchInstalledCallbackManager();
2921
2928
  if (options.instrumentModules && Object.keys(options.instrumentModules).length > 0) {
2922
2929
  registry.setManualModules(options.instrumentModules);
@@ -2940,7 +2947,7 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
2940
2947
  const resourceAttributes = {
2941
2948
  ...resolvedConfig.resourceAttributes,
2942
2949
  "service.name": resolvedConfig.appName,
2943
- [BRIZZ_SDK_VERSION]: _chunkVFWTFL7Ecjs.getSDKVersion.call(void 0, ),
2950
+ [BRIZZ_SDK_VERSION]: _chunkEWT4TUB7cjs.getSDKVersion.call(void 0, ),
2944
2951
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
2945
2952
  };
2946
2953
  if (resolvedConfig.environment) {
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  configure,
7
7
  getSDKVersion
8
- } from "./chunk-USYGGHMA.js";
8
+ } from "./chunk-V727EJE5.js";
9
9
  import {
10
10
  DEFAULT_LOG_LEVEL,
11
11
  LogLevel,
@@ -418,7 +418,7 @@ function loadGenAIInstrumentations() {
418
418
  function loadMCPInstrumentation() {
419
419
  void (async () => {
420
420
  try {
421
- const { MCPInstrumentation } = await import("./mcp-YHBVF7QU.js");
421
+ const { MCPInstrumentation } = await import("./mcp-GANFYW4J.js");
422
422
  const mcp = new MCPInstrumentation({ exceptionLogger });
423
423
  registerInstrumentations({ instrumentations: [mcp] });
424
424
  logger.debug("Auto-loaded MCP instrumentation");
@@ -693,6 +693,7 @@ import { QdrantInstrumentation as QdrantInstrumentation2 } from "@traceloop/inst
693
693
  import { TogetherInstrumentation as TogetherInstrumentation2 } from "@traceloop/instrumentation-together";
694
694
 
695
695
  // src/internal/instrumentation/langchain.ts
696
+ import { createRequire } from "module";
696
697
  import { context as context2 } from "@opentelemetry/api";
697
698
  var SCOPE_NAME = "@arizeai/openinference-instrumentation-langchain";
698
699
  var PATCHED_MARKER = /* @__PURE__ */ Symbol.for("brizz.langchain.callbackManagerPatched");
@@ -751,6 +752,12 @@ function patchInstalledCallbackManager() {
751
752
  } catch (error) {
752
753
  logger.debug(`LangChain callback manager not patched: ${String(error)}`);
753
754
  }
755
+ try {
756
+ const requireFromSdk = createRequire(import.meta.url);
757
+ patchCallbackManagerModule(requireFromSdk("@langchain/core/callbacks/manager"));
758
+ } catch (error) {
759
+ logger.debug(`LangChain CJS callback manager not patched: ${String(error)}`);
760
+ }
754
761
  })();
755
762
  }
756
763
  function restampLangChainSpan(span) {
@@ -907,7 +914,7 @@ var InstrumentationRegistry = class _InstrumentationRegistry {
907
914
  const mcpModules = this.manualModules.mcp;
908
915
  void (async () => {
909
916
  try {
910
- const { MCPInstrumentation } = await import("./mcp-YHBVF7QU.js");
917
+ const { MCPInstrumentation } = await import("./mcp-GANFYW4J.js");
911
918
  const instrumentation = new MCPInstrumentation({ exceptionLogger: exceptionLogger2 });
912
919
  instrumentation.manuallyInstrument(mcpModules);
913
920
  logger.debug("Manual instrumentation enabled for MCP");
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkVFWTFL7Ecjs = require('./chunk-VFWTFL7E.cjs');
11
+ var _chunkEWT4TUB7cjs = require('./chunk-EWT4TUB7.cjs');
12
12
 
13
13
 
14
14
  var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
@@ -387,14 +387,14 @@ function wrapOnRequest(original, tracer) {
387
387
  return original.apply(this, args);
388
388
  }
389
389
  const method = request.method;
390
- if (method === METHOD_TOOLS_CALL && _chunkVFWTFL7Ecjs.isSessionToolCall.call(void 0, request)) {
390
+ if (method === METHOD_TOOLS_CALL && _chunkEWT4TUB7cjs.isSessionToolCall.call(void 0, request)) {
391
391
  return answerSessionToolCall(this, request, tracer, args, original);
392
392
  }
393
393
  const handler = _nullishCoalesce(handlers.get(method), () => ( this.fallbackRequestHandler));
394
394
  if (!handler) {
395
395
  return original.apply(this, args);
396
396
  }
397
- const tracking = _chunkVFWTFL7Ecjs.isEnabled.call(void 0, ) && method === METHOD_TOOLS_CALL ? _chunkVFWTFL7Ecjs.popTrackingArguments.call(void 0, request) : {};
397
+ const tracking = _chunkEWT4TUB7cjs.isEnabled.call(void 0, ) && method === METHOD_TOOLS_CALL ? _chunkEWT4TUB7cjs.popTrackingArguments.call(void 0, request) : {};
398
398
  const started = safeStartServerSpan(tracer, request, this, tracking);
399
399
  if (!started) {
400
400
  return original.apply(this, args);
@@ -404,9 +404,9 @@ function wrapOnRequest(original, tracer) {
404
404
  if (method === METHOD_TOOLS_LIST) {
405
405
  hooks.onResult = (result) => {
406
406
  let advertised = result;
407
- if (_chunkVFWTFL7Ecjs.isEnabled.call(void 0, )) {
407
+ if (_chunkEWT4TUB7cjs.isEnabled.call(void 0, )) {
408
408
  try {
409
- advertised = _chunkVFWTFL7Ecjs.patchListToolsResult.call(void 0, result);
409
+ advertised = _chunkEWT4TUB7cjs.patchListToolsResult.call(void 0, result);
410
410
  } catch (error) {
411
411
  _chunkWC573FCIcjs.logger.warn(
412
412
  `Brizz MCP: failed to patch tools/list schemas: ${String(error)}`
@@ -417,7 +417,7 @@ function wrapOnRequest(original, tracer) {
417
417
  try {
418
418
  emitSchemaSpansFromListResponse(
419
419
  advertised,
420
- _chunkVFWTFL7Ecjs.resolveTransportSessionId.call(void 0, this),
420
+ _chunkEWT4TUB7cjs.resolveTransportSessionId.call(void 0, this),
421
421
  tracer
422
422
  );
423
423
  } catch (error) {
@@ -430,7 +430,7 @@ function wrapOnRequest(original, tracer) {
430
430
  }
431
431
  if (method !== METHOD_TOOLS_CALL) {
432
432
  hooks.onError = () => {
433
- _chunkVFWTFL7Ecjs.stampAndPropagateSession.call(void 0, span, _chunkVFWTFL7Ecjs.resolveSessionId.call(void 0, this, spanCtx), spanCtx);
433
+ _chunkEWT4TUB7cjs.stampAndPropagateSession.call(void 0, span, _chunkEWT4TUB7cjs.resolveSessionId.call(void 0, this, spanCtx), spanCtx);
434
434
  };
435
435
  }
436
436
  const wrappedHandler = (req, extra) => _api.context.with(
@@ -464,7 +464,7 @@ function answerSessionToolCall(protocol, request, tracer, args, original) {
464
464
  if (!handlers) {
465
465
  return original.apply(protocol, args);
466
466
  }
467
- const { id, result } = _chunkVFWTFL7Ecjs.sessionToolResult.call(void 0, );
467
+ const { id, result } = _chunkEWT4TUB7cjs.sessionToolResult.call(void 0, );
468
468
  const started = safeStartServerSpan(tracer, request, protocol, { sessionId: id });
469
469
  const handler = () => started ? _api.context.with(started.spanCtx, () => result) : result;
470
470
  const hadEntry = handlers.has(METHOD_TOOLS_CALL);
@@ -554,8 +554,8 @@ function safeStartServerSpan(tracer, request, protocol, tracking = {}) {
554
554
  parentCtx
555
555
  );
556
556
  applyServerRequestAttributes(span, request, protocol);
557
- const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => ( _chunkVFWTFL7Ecjs.resolveSessionId.call(void 0, protocol, parentCtx))) : void 0;
558
- const { context: sessCtx } = _chunkVFWTFL7Ecjs.stampAndPropagateSession.call(void 0,
557
+ const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => ( _chunkEWT4TUB7cjs.resolveSessionId.call(void 0, protocol, parentCtx))) : void 0;
558
+ const { context: sessCtx } = _chunkEWT4TUB7cjs.stampAndPropagateSession.call(void 0,
559
559
  span,
560
560
  resolved,
561
561
  parentCtx,
@@ -611,7 +611,7 @@ function safeEnd(span) {
611
611
 
612
612
  // src/internal/instrumentation/mcp/version.ts
613
613
  var INSTRUMENTATION_NAME = "@brizz/sdk/mcp";
614
- var INSTRUMENTATION_VERSION = _chunkVFWTFL7Ecjs.getSDKVersion.call(void 0, );
614
+ var INSTRUMENTATION_VERSION = _chunkEWT4TUB7cjs.getSDKVersion.call(void 0, );
615
615
 
616
616
  // src/internal/instrumentation/mcp/instrumentation.ts
617
617
  var PROTOCOL_MODULE_NAME = "@modelcontextprotocol/sdk/shared/protocol.js";
@@ -8,7 +8,7 @@ import {
8
8
  resolveTransportSessionId,
9
9
  sessionToolResult,
10
10
  stampAndPropagateSession
11
- } from "./chunk-USYGGHMA.js";
11
+ } from "./chunk-V727EJE5.js";
12
12
  import {
13
13
  logger
14
14
  } from "./chunk-Y4HNUX3Q.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brizz/sdk",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "type": "module",
5
5
  "description": "OpenTelemetry-based observability SDK for AI applications",
6
6
  "keywords": [
@@ -102,35 +102,36 @@
102
102
  "registry": "https://registry.npmjs.org/"
103
103
  },
104
104
  "devDependencies": {
105
- "@ai-sdk/anthropic": "^4.0.49",
106
- "@ai-sdk/openai": "^4.0.60",
107
- "@ai-sdk/otel": "^1.0.93",
105
+ "@ai-sdk/anthropic": "^4.0.58",
106
+ "@ai-sdk/openai": "^4.0.71",
107
+ "@ai-sdk/otel": "^1.0.107",
108
108
  "@arethetypeswrong/cli": "^0.18.5",
109
- "@arizeai/openinference-instrumentation-mcp": "^0.2.30",
110
- "@babel/core": "^8.0.1",
111
- "@babel/preset-env": "^8.0.2",
109
+ "@arizeai/openinference-instrumentation-mcp": "^0.2.33",
110
+ "@babel/core": "^8.0.6",
111
+ "@babel/preset-env": "^8.0.6",
112
112
  "@babel/preset-typescript": "^8.0.1",
113
113
  "@changesets/changelog-github": "^1.0.1",
114
- "@changesets/cli": "^3.0.2",
115
- "@google/genai": "^2.21.0",
114
+ "@changesets/cli": "^3.0.3",
115
+ "@google/genai": "^2.23.0",
116
116
  "@langchain/core": "^1.2.11",
117
117
  "@langchain/langgraph": "^1.4.15",
118
118
  "@modelcontextprotocol/sdk": "^1.30.0",
119
119
  "@traceloop/instrumentation-google-generativeai": "^0.27.0",
120
120
  "@traceloop/instrumentation-vertexai": "^0.27.0",
121
121
  "@types/jest": "^30.0.0",
122
- "@types/node": "^26.4.1",
123
- "ai": "^7.0.93",
124
- "babel-jest": "^30.5.1",
125
- "jest": "^30.5.1",
126
- "jest-environment-jsdom": "^30.5.1",
127
- "openai": "^7.10.0",
128
- "oxlint": "^1.81.0",
129
- "prettier": "^3.9.6",
122
+ "@types/node": "^26.6.2",
123
+ "ai": "^7.0.107",
124
+ "babel-jest": "^30.5.2",
125
+ "babel-plugin-transform-import-meta": "^3.0.0",
126
+ "jest": "^30.5.2",
127
+ "jest-environment-jsdom": "^30.5.2",
128
+ "openai": "^7.20.0",
129
+ "oxlint": "^1.83.0",
130
+ "prettier": "^3.9.8",
130
131
  "tsup": "^8.5.1",
131
132
  "typescript": "^7.0.2",
132
- "vitest": "^5.0.0",
133
- "zod": "^4.5.4"
133
+ "vitest": "^5.0.1",
134
+ "zod": "^4.6.5"
134
135
  },
135
136
  "peerDependencies": {
136
137
  "@ai-sdk/otel": "^1",
@@ -173,7 +174,7 @@
173
174
  }
174
175
  },
175
176
  "dependencies": {
176
- "@arizeai/openinference-instrumentation-langchain": "^4.0.23",
177
+ "@arizeai/openinference-instrumentation-langchain": "^4.1.1",
177
178
  "@arizeai/openinference-instrumentation-openai": "^2.3.1",
178
179
  "@opentelemetry/api": "^1.9.0",
179
180
  "@opentelemetry/api-logs": "^0.222.0",