@brizz/sdk 0.1.41 → 0.1.42

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.
@@ -2,7 +2,7 @@ import './internal/instrumentation/auto-init.js';
2
2
  export { Brizz, type IBrizzInitializeOptions } from './internal/sdk.js';
3
3
  export { type IInstrumentModules, type IMCPManualModules, } from './internal/instrumentation/index.js';
4
4
  export { emitEvent, emitEventWithSessionId } from './internal/log/index.js';
5
- export { getSpanExporter, getSpanProcessor, withSessionId, callWithSessionId, withProperties, callWithProperties, withMute, callWithMute, setCurrentSpanCustomProperties, setUser, setOrganization, setMessageId, setSessionId, withUser, callWithUser, withOrganization, callWithOrganization, withMessageId, callWithMessageId, Session, SessionTitle, startSession, startSessionTitle, getActiveSession, addExternalLink, recordFeedback, recordMetric, } from './internal/trace/index.js';
5
+ export { getSpanExporter, getSpanProcessor, withSessionId, callWithSessionId, withProperties, callWithProperties, withMute, callWithMute, setCurrentSpanCustomProperties, setUser, setOrganization, setMessageId, setSessionId, setServiceName, withServiceName, callWithServiceName, withUser, callWithUser, withOrganization, callWithOrganization, withMessageId, callWithMessageId, Session, SessionTitle, startSession, startSessionTitle, getActiveSession, addExternalLink, recordFeedback, recordMetric, } from './internal/trace/index.js';
6
6
  export type { IMuteOptions } from './internal/trace/index.js';
7
7
  export { getMetricsExporter, getMetricsReader } from './internal/metric/index.js';
8
8
  export type { IMaskingConfig, ISpanMaskingConfig, ILogMaskingConfig, IEventMaskingConfig, IEventMaskingRule, MaskingMode, IAttributesMaskingRule, } from './internal/masking/index.js';
@@ -5,12 +5,12 @@ import type { IResolvedBrizzConfig } from '../config.js';
5
5
  export declare class LoggingModule {
6
6
  private static instance;
7
7
  static getInstance(): LoggingModule;
8
- private logExporter;
9
- private logProcessor;
8
+ private config;
10
9
  private loggerProvider;
11
- private initLogExporter;
12
- private initLogProcessor;
13
- private initLoggerProvider;
10
+ private readonly scopedProviders;
11
+ private createLogExporter;
12
+ private createLoggerProvider;
13
+ private activeLoggerProvider;
14
14
  setup(config: IResolvedBrizzConfig): void;
15
15
  emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?: LogBody, severityNumber?: SeverityNumber): void;
16
16
  isInitialized(): boolean;
@@ -21,6 +21,8 @@ export declare const ORGANIZATION_NAME = "organization.name";
21
21
  export declare const ORGANIZATION_PLAN = "organization.plan";
22
22
  export declare const ORGANIZATION_DOMAIN = "organization.domain";
23
23
  export declare const MESSAGE_ID = "message.id";
24
+ export declare const SERVICE_NAME = "service.name";
25
+ export declare const SERVICE_NAME_ATTRIBUTE = "brizz.service.name";
24
26
  export declare const SESSION_TITLE_SPAN_NAME = "brizz.session_title";
25
27
  export declare const SESSION_TITLE_GENERATION = "session.title_generation";
26
28
  export declare const SESSION_TITLE = "brizz.session.title";
@@ -1,12 +1,21 @@
1
1
  import type { ExportResult } from '@opentelemetry/core';
2
2
  import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
3
3
  import type { IResolvedBrizzConfig } from '../../config.js';
4
+ export type SpanExporterFactory = (serviceName: string) => SpanExporter;
4
5
  export declare class BrizzSpanExporter implements SpanExporter {
5
6
  private readonly _delegate;
6
- private readonly _brizzResource;
7
+ private readonly _delegateFactory?;
8
+ private readonly _defaultServiceName;
9
+ private readonly _resourceAttrs;
10
+ private readonly _resources;
11
+ private readonly _delegates;
7
12
  private readonly _beforeSendSpan?;
8
- constructor(delegate: SpanExporter, config: IResolvedBrizzConfig);
13
+ constructor(delegate: SpanExporter, config: IResolvedBrizzConfig, factory?: SpanExporterFactory);
14
+ private _serviceNameOf;
15
+ private _resourceFor;
16
+ private _delegateFor;
9
17
  export(spans: ReadableSpan[], resultCallback: (result: ExportResult) => void): void;
18
+ private _exportGroups;
10
19
  shutdown(): Promise<void>;
11
20
  forceFlush(): Promise<void>;
12
21
  }
@@ -1,4 +1,4 @@
1
1
  export { TracingModule, getSpanExporter, getSpanProcessor } from './tracing.js';
2
2
  export { BrizzBatchSpanProcessor, BrizzSimpleSpanProcessor } from './processors/span-processor.js';
3
- export { withSessionId, callWithSessionId, withProperties, callWithProperties, withMute, callWithMute, setCurrentSpanCustomProperties, setUser, setOrganization, setMessageId, setSessionId, withUser, callWithUser, withOrganization, callWithOrganization, withMessageId, callWithMessageId, Session, SessionTitle, startSession, startSessionTitle, getActiveSession, addExternalLink, recordFeedback, recordMetric, } from './session.js';
3
+ export { withSessionId, callWithSessionId, withProperties, callWithProperties, withMute, callWithMute, setCurrentSpanCustomProperties, setUser, setOrganization, setMessageId, setSessionId, setServiceName, withServiceName, callWithServiceName, withUser, callWithUser, withOrganization, callWithOrganization, withMessageId, callWithMessageId, Session, SessionTitle, startSession, startSessionTitle, getActiveSession, addExternalLink, recordFeedback, recordMetric, } from './session.js';
4
4
  export type { IMuteOptions } from './session.js';
@@ -23,6 +23,10 @@ export declare function setOrganization(org: {
23
23
  }): void;
24
24
  export declare function setMessageId(id: string): void;
25
25
  export declare function setSessionId(id: string): void;
26
+ export declare function setServiceName(name: string): void;
27
+ export declare function callWithServiceName<A extends unknown[], F extends (...args: A) => ReturnType<F>>(name: string, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
28
+ export declare function withServiceName<F extends (this: any, ...args: any[]) => any>(name: string, fn: F, thisArg?: ThisParameterType<F>): F;
29
+ export declare function resolveServiceNameFromContext(): string | undefined;
26
30
  export declare function callWithUser<A extends unknown[], F extends (...args: A) => ReturnType<F>>(user: {
27
31
  id: string;
28
32
  email?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brizz/sdk",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "type": "module",
5
5
  "description": "OpenTelemetry-based observability SDK for AI applications",
6
6
  "keywords": [
@@ -101,28 +101,28 @@
101
101
  "registry": "https://registry.npmjs.org/"
102
102
  },
103
103
  "devDependencies": {
104
- "@ai-sdk/anthropic": "^4.0.27",
105
- "@ai-sdk/openai": "^4.0.27",
106
- "@ai-sdk/otel": "^1.0.48",
104
+ "@ai-sdk/anthropic": "^4.0.39",
105
+ "@ai-sdk/openai": "^4.0.42",
106
+ "@ai-sdk/otel": "^1.0.66",
107
107
  "@arethetypeswrong/cli": "^0.18.5",
108
- "@arizeai/openinference-instrumentation-mcp": "^0.2.21",
108
+ "@arizeai/openinference-instrumentation-mcp": "^0.2.24",
109
109
  "@babel/core": "^8.0.1",
110
110
  "@babel/preset-env": "^8.0.2",
111
111
  "@babel/preset-typescript": "^8.0.1",
112
- "@changesets/changelog-github": "^0.7.0",
113
- "@changesets/cli": "^2.31.1",
114
- "@google/genai": "^2.15.0",
112
+ "@changesets/changelog-github": "^1.0.0",
113
+ "@changesets/cli": "^3.0.0",
114
+ "@google/genai": "^2.17.1",
115
115
  "@modelcontextprotocol/sdk": "^1.30.0",
116
116
  "@traceloop/instrumentation-google-generativeai": "^0.27.0",
117
117
  "@traceloop/instrumentation-vertexai": "^0.27.0",
118
118
  "@types/jest": "^30.0.0",
119
- "@types/node": "^26.1.2",
120
- "ai": "^7.0.48",
119
+ "@types/node": "^26.2.0",
120
+ "ai": "^7.0.66",
121
121
  "babel-jest": "^30.4.1",
122
122
  "jest": "^30.4.2",
123
123
  "jest-environment-jsdom": "^30.4.1",
124
- "openai": "^7.3.0",
125
- "oxlint": "^1.76.0",
124
+ "openai": "^7.4.0",
125
+ "oxlint": "^1.78.0",
126
126
  "prettier": "^3.9.6",
127
127
  "tsup": "^8.5.1",
128
128
  "typescript": "^7.0.2",
@@ -166,7 +166,7 @@
166
166
  }
167
167
  },
168
168
  "dependencies": {
169
- "@arizeai/openinference-instrumentation-langchain": "^4.0.15",
169
+ "@arizeai/openinference-instrumentation-langchain": "^4.0.18",
170
170
  "@arizeai/openinference-instrumentation-openai": "^2.3.1",
171
171
  "@opentelemetry/api": "^1.9.0",
172
172
  "@opentelemetry/api-logs": "^0.221.0",
@@ -1,12 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
- var _chunkEVRCHF74cjs = require('./chunk-EVRCHF74.cjs');
6
- require('./chunk-77UGZGMP.cjs');
7
- require('./chunk-OBGZSXTJ.cjs');
8
-
9
-
10
-
11
-
12
- exports.InterruptPropagator = _chunkEVRCHF74cjs.InterruptPropagator; exports._resetInterruptState = _chunkEVRCHF74cjs._resetInterruptState; exports.createInterruptIntegration = _chunkEVRCHF74cjs.createInterruptIntegration;