@brizz/sdk 0.1.54 → 0.1.56
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 +1 -1
- package/dist/{chunk-MLMF2O5P.js → chunk-AWYGZM6I.js} +1 -1
- package/dist/{chunk-YGLDHCWC.js → chunk-B5IY6O4N.js} +1 -1
- package/dist/{chunk-VZJNEST4.cjs → chunk-DC2MFO65.cjs} +15 -1
- package/dist/{chunk-FQBVTIBR.cjs → chunk-RD4XCYKT.cjs} +2 -2
- package/dist/{chunk-DBN4NKIG.js → chunk-TDPQDITP.js} +15 -1
- package/dist/{chunk-KGNFUQ6Z.cjs → chunk-VY6GEZSP.cjs} +1 -1
- package/dist/{google-genai-PERR37LR.js → google-genai-3ERJNC7Q.js} +2 -2
- package/dist/google-genai-GVCKSJMR.cjs +11 -0
- package/dist/google-genai.cjs +3 -3
- package/dist/google-genai.js +2 -2
- package/dist/index.cjs +149 -111
- package/dist/index.js +54 -16
- package/dist/{mcp-KU7MFTOB.js → mcp-WIKXDZIJ.js} +2 -2
- package/dist/{mcp-4M4XL46N.cjs → mcp-YFR4MUPD.cjs} +17 -17
- package/dist/types/cjs/index.d.ts +2 -2
- package/dist/types/cjs/internal/config.d.ts +1 -1
- package/dist/types/cjs/internal/instrumentation/langchain.d.ts +1 -1
- package/dist/types/cjs/internal/instrumentation/vercel-ai/interrupt.d.ts +1 -1
- package/dist/types/cjs/internal/log/logging.d.ts +5 -5
- package/dist/types/cjs/internal/log/processors/log-processor.d.ts +4 -4
- package/dist/types/cjs/internal/sdk.d.ts +1 -1
- package/dist/types/cjs/internal/trace/exporters/eve-trace-exporter.d.ts +1 -1
- package/dist/types/cjs/internal/trace/exporters/span-exporter.d.ts +1 -1
- package/dist/types/cjs/internal/trace/processors/eve-session-processor.d.ts +1 -1
- package/dist/types/cjs/internal/trace/processors/span-processor.d.ts +1 -1
- package/dist/types/cjs/internal/trace/provider.d.ts +1 -0
- package/dist/types/cjs/internal/trace/tracing.d.ts +2 -2
- package/dist/types/esm/index.d.ts +2 -2
- package/dist/types/esm/internal/config.d.ts +1 -1
- package/dist/types/esm/internal/instrumentation/langchain.d.ts +1 -1
- package/dist/types/esm/internal/instrumentation/vercel-ai/interrupt.d.ts +1 -1
- package/dist/types/esm/internal/log/logging.d.ts +5 -5
- package/dist/types/esm/internal/log/processors/log-processor.d.ts +4 -4
- package/dist/types/esm/internal/sdk.d.ts +1 -1
- package/dist/types/esm/internal/trace/exporters/eve-trace-exporter.d.ts +1 -1
- package/dist/types/esm/internal/trace/exporters/span-exporter.d.ts +1 -1
- package/dist/types/esm/internal/trace/processors/eve-session-processor.d.ts +1 -1
- package/dist/types/esm/internal/trace/processors/span-processor.d.ts +1 -1
- package/dist/types/esm/internal/trace/provider.d.ts +1 -0
- package/dist/types/esm/internal/trace/tracing.d.ts +2 -2
- package/package.json +29 -31
- package/dist/google-genai-44O4QORJ.cjs +0 -11
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
configure,
|
|
7
7
|
getSDKVersion
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AWYGZM6I.js";
|
|
9
9
|
import {
|
|
10
10
|
bindToBrizz,
|
|
11
11
|
brizzTracerProvider,
|
|
@@ -13,8 +13,9 @@ import {
|
|
|
13
13
|
extractTraceContext,
|
|
14
14
|
getTracerProvider,
|
|
15
15
|
injectTraceContext,
|
|
16
|
+
registerTracerProvider,
|
|
16
17
|
setPrivateTracerProvider
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TDPQDITP.js";
|
|
18
19
|
import {
|
|
19
20
|
DEFAULT_LOG_LEVEL,
|
|
20
21
|
LogLevel,
|
|
@@ -697,7 +698,7 @@ function loadGenAIInstrumentations() {
|
|
|
697
698
|
function loadMCPInstrumentation() {
|
|
698
699
|
void (async () => {
|
|
699
700
|
try {
|
|
700
|
-
const { MCPInstrumentation } = await import("./mcp-
|
|
701
|
+
const { MCPInstrumentation } = await import("./mcp-WIKXDZIJ.js");
|
|
701
702
|
const mcp = new MCPInstrumentation({ exceptionLogger });
|
|
702
703
|
registerInstrumentations({ instrumentations: [mcp], tracerProvider: brizzTracerProvider });
|
|
703
704
|
logger.debug("Auto-loaded MCP instrumentation");
|
|
@@ -750,7 +751,7 @@ function loadVertexAIInstrumentation() {
|
|
|
750
751
|
function loadGoogleGenAIInstrumentation() {
|
|
751
752
|
void (async () => {
|
|
752
753
|
try {
|
|
753
|
-
const { GoogleGenAIInstrumentation } = await import("./google-genai-
|
|
754
|
+
const { GoogleGenAIInstrumentation } = await import("./google-genai-3ERJNC7Q.js");
|
|
754
755
|
const googleGenAI = new GoogleGenAIInstrumentation({ exceptionLogger });
|
|
755
756
|
registerInstrumentations({
|
|
756
757
|
instrumentations: [googleGenAI],
|
|
@@ -843,8 +844,8 @@ import {
|
|
|
843
844
|
resourceFromAttributes as resourceFromAttributes3
|
|
844
845
|
} from "@opentelemetry/resources";
|
|
845
846
|
import { MeterProvider } from "@opentelemetry/sdk-metrics";
|
|
846
|
-
import { AlwaysOnSampler } from "@opentelemetry/sdk-trace
|
|
847
|
-
import {
|
|
847
|
+
import { AlwaysOnSampler } from "@opentelemetry/sdk-trace";
|
|
848
|
+
import { TracerProvider as SdkTracerProvider } from "@opentelemetry/sdk-trace";
|
|
848
849
|
|
|
849
850
|
// src/internal/config.ts
|
|
850
851
|
function parseBoolEnv(name) {
|
|
@@ -1013,6 +1014,8 @@ import { createRequire as createRequire3 } from "module";
|
|
|
1013
1014
|
import { context as context3 } from "@opentelemetry/api";
|
|
1014
1015
|
var SCOPE_NAME = "@arizeai/openinference-instrumentation-langchain";
|
|
1015
1016
|
var PATCHED_MARKER = /* @__PURE__ */ Symbol.for("brizz.langchain.callbackManagerPatched");
|
|
1017
|
+
var TRACER_PATCHED_MARKER = /* @__PURE__ */ Symbol.for("brizz.langchain.tracerPatched");
|
|
1018
|
+
var runContexts = /* @__PURE__ */ new WeakMap();
|
|
1016
1019
|
var OMITTED_KEYS = /* @__PURE__ */ new Set([
|
|
1017
1020
|
USER_EMAIL,
|
|
1018
1021
|
USER_NAME,
|
|
@@ -1059,12 +1062,47 @@ function patchCallbackManagerModule(module2) {
|
|
|
1059
1062
|
}
|
|
1060
1063
|
} catch {
|
|
1061
1064
|
}
|
|
1065
|
+
manager?.handlers?.forEach((handler) => {
|
|
1066
|
+
try {
|
|
1067
|
+
patchTracer(handler);
|
|
1068
|
+
} catch {
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1062
1071
|
return manager;
|
|
1063
1072
|
};
|
|
1064
1073
|
patchToolStart(statics["prototype"]);
|
|
1065
1074
|
statics[PATCHED_MARKER] = true;
|
|
1066
1075
|
return true;
|
|
1067
1076
|
}
|
|
1077
|
+
function patchTracer(handler) {
|
|
1078
|
+
const tracer = handler;
|
|
1079
|
+
if (typeof tracer !== "object" || tracer === null || tracer[TRACER_PATCHED_MARKER] === true) {
|
|
1080
|
+
return;
|
|
1081
|
+
}
|
|
1082
|
+
const addRunToRunMap = tracer["_addRunToRunMap"];
|
|
1083
|
+
const onRunCreate = tracer["onRunCreate"];
|
|
1084
|
+
const endTrace = tracer["_endTrace"];
|
|
1085
|
+
if (typeof addRunToRunMap !== "function" || typeof onRunCreate !== "function" || typeof endTrace !== "function") {
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
tracer[TRACER_PATCHED_MARKER] = true;
|
|
1089
|
+
tracer["onRunCreate"] = inRunContext(onRunCreate);
|
|
1090
|
+
tracer["_endTrace"] = inRunContext(endTrace);
|
|
1091
|
+
const addRun = addRunToRunMap;
|
|
1092
|
+
tracer["_addRunToRunMap"] = function(...args) {
|
|
1093
|
+
const run = addRun.apply(this, args);
|
|
1094
|
+
if (typeof run === "object" && run !== null) {
|
|
1095
|
+
runContexts.set(run, context3.active());
|
|
1096
|
+
}
|
|
1097
|
+
return run;
|
|
1098
|
+
};
|
|
1099
|
+
}
|
|
1100
|
+
function inRunContext(method) {
|
|
1101
|
+
return function(...args) {
|
|
1102
|
+
const runContext = runContexts.get(args[0]);
|
|
1103
|
+
return runContext ? context3.with(runContext, () => method.apply(this, args)) : method.apply(this, args);
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1068
1106
|
function patchToolStart(prototype) {
|
|
1069
1107
|
const proto = prototype;
|
|
1070
1108
|
const original = proto?.["handleToolStart"];
|
|
@@ -1256,7 +1294,7 @@ var InstrumentationRegistry = class _InstrumentationRegistry {
|
|
|
1256
1294
|
const genaiModule = this.manualModules.google_genai;
|
|
1257
1295
|
void (async () => {
|
|
1258
1296
|
try {
|
|
1259
|
-
const { GoogleGenAIInstrumentation } = await import("./google-genai-
|
|
1297
|
+
const { GoogleGenAIInstrumentation } = await import("./google-genai-3ERJNC7Q.js");
|
|
1260
1298
|
const genaiInst = new GoogleGenAIInstrumentation({ exceptionLogger: exceptionLogger2 });
|
|
1261
1299
|
genaiInst.manuallyInstrument(genaiModule);
|
|
1262
1300
|
logger.debug("Manual instrumentation enabled for Google GenAI");
|
|
@@ -1271,7 +1309,7 @@ var InstrumentationRegistry = class _InstrumentationRegistry {
|
|
|
1271
1309
|
const mcpModules = this.manualModules.mcp;
|
|
1272
1310
|
void (async () => {
|
|
1273
1311
|
try {
|
|
1274
|
-
const { MCPInstrumentation } = await import("./mcp-
|
|
1312
|
+
const { MCPInstrumentation } = await import("./mcp-WIKXDZIJ.js");
|
|
1275
1313
|
const instrumentation = new MCPInstrumentation({ exceptionLogger: exceptionLogger2 });
|
|
1276
1314
|
instrumentation.manuallyInstrument(mcpModules);
|
|
1277
1315
|
logger.debug("Manual instrumentation enabled for MCP");
|
|
@@ -1308,7 +1346,7 @@ var InstrumentationRegistry = class _InstrumentationRegistry {
|
|
|
1308
1346
|
};
|
|
1309
1347
|
|
|
1310
1348
|
// src/internal/log/logging.ts
|
|
1311
|
-
import { SeverityNumber } from "@opentelemetry/api
|
|
1349
|
+
import { SeverityNumber } from "@opentelemetry/api";
|
|
1312
1350
|
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
|
|
1313
1351
|
import { resourceFromAttributes } from "@opentelemetry/resources";
|
|
1314
1352
|
import { LoggerProvider } from "@opentelemetry/sdk-logs";
|
|
@@ -2989,7 +3027,7 @@ import { context as context6 } from "@opentelemetry/api";
|
|
|
2989
3027
|
import {
|
|
2990
3028
|
BatchSpanProcessor,
|
|
2991
3029
|
SimpleSpanProcessor
|
|
2992
|
-
} from "@opentelemetry/sdk-trace
|
|
3030
|
+
} from "@opentelemetry/sdk-trace";
|
|
2993
3031
|
function applyContextAttributes(span) {
|
|
2994
3032
|
const sessionProperties = context6.active().getValue(PROPERTIES_CONTEXT_KEY);
|
|
2995
3033
|
if (sessionProperties) {
|
|
@@ -3028,7 +3066,7 @@ var DEFAULT_MASKING_RULES = [
|
|
|
3028
3066
|
var BrizzSimpleSpanProcessor = class extends SimpleSpanProcessor {
|
|
3029
3067
|
config;
|
|
3030
3068
|
constructor(spanExporter, config) {
|
|
3031
|
-
super(spanExporter);
|
|
3069
|
+
super({ exporter: spanExporter });
|
|
3032
3070
|
this.config = config;
|
|
3033
3071
|
}
|
|
3034
3072
|
onStart(span, parentContext) {
|
|
@@ -3047,7 +3085,7 @@ var BrizzSimpleSpanProcessor = class extends SimpleSpanProcessor {
|
|
|
3047
3085
|
var BrizzBatchSpanProcessor = class extends BatchSpanProcessor {
|
|
3048
3086
|
config;
|
|
3049
3087
|
constructor(spanExporter, config) {
|
|
3050
|
-
super(spanExporter);
|
|
3088
|
+
super({ exporter: spanExporter });
|
|
3051
3089
|
this.config = config;
|
|
3052
3090
|
}
|
|
3053
3091
|
onStart(span, parentContext) {
|
|
@@ -3420,10 +3458,10 @@ var _Brizz = class __Brizz {
|
|
|
3420
3458
|
const resource = defaultResource().merge(detectResources({ detectors: [envDetector, hostDetector, processDetector] })).merge(resourceFromAttributes3(resourceAttributes));
|
|
3421
3459
|
const spanProcessors = resolvedConfig.disableSpanExporter ? [] : [new InterruptPropagator(), getSpanProcessor()];
|
|
3422
3460
|
if (resolvedConfig.setGlobalTracerProvider) {
|
|
3423
|
-
this._tracerProvider = new
|
|
3461
|
+
this._tracerProvider = new SdkTracerProvider({ resource, spanProcessors });
|
|
3424
3462
|
this.registerGlobalTracerProvider(this._tracerProvider);
|
|
3425
3463
|
} else {
|
|
3426
|
-
this._tracerProvider = new
|
|
3464
|
+
this._tracerProvider = new SdkTracerProvider({
|
|
3427
3465
|
resource,
|
|
3428
3466
|
spanProcessors,
|
|
3429
3467
|
sampler: new AlwaysOnSampler()
|
|
@@ -3463,7 +3501,7 @@ var _Brizz = class __Brizz {
|
|
|
3463
3501
|
*/
|
|
3464
3502
|
registerGlobalTracerProvider(provider) {
|
|
3465
3503
|
setPrivateTracerProvider(null);
|
|
3466
|
-
provider
|
|
3504
|
+
registerTracerProvider(provider);
|
|
3467
3505
|
const registered = globalTracerDelegate();
|
|
3468
3506
|
if (registered === provider) {
|
|
3469
3507
|
return;
|
|
@@ -3674,7 +3712,7 @@ var _Brizz = class __Brizz {
|
|
|
3674
3712
|
var Brizz = new _Brizz();
|
|
3675
3713
|
|
|
3676
3714
|
// src/index.ts
|
|
3677
|
-
import { SeverityNumber as SeverityNumber2 } from "@opentelemetry/api
|
|
3715
|
+
import { SeverityNumber as SeverityNumber2 } from "@opentelemetry/api";
|
|
3678
3716
|
export {
|
|
3679
3717
|
Brizz,
|
|
3680
3718
|
DEFAULT_PII_PATTERNS,
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
resolveTransportSessionId,
|
|
9
9
|
sessionToolResult,
|
|
10
10
|
stampAndPropagateSession
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AWYGZM6I.js";
|
|
12
12
|
import {
|
|
13
13
|
brizzTracerProvider,
|
|
14
14
|
extractTraceContext,
|
|
15
15
|
injectTraceContext,
|
|
16
16
|
isPrivateTracerProvider
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TDPQDITP.js";
|
|
18
18
|
import {
|
|
19
19
|
logger
|
|
20
20
|
} from "./chunk-Y4HNUX3Q.js";
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkVY6GEZSPcjs = require('./chunk-VY6GEZSP.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkDC2MFO65cjs = require('./chunk-DC2MFO65.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
|
|
@@ -385,14 +385,14 @@ function wrapRequest(original, tracer) {
|
|
|
385
385
|
};
|
|
386
386
|
}
|
|
387
387
|
function injectMetaTraceContext(request, ctx) {
|
|
388
|
-
if (!
|
|
388
|
+
if (!_chunkDC2MFO65cjs.isPrivateTracerProvider.call(void 0, )) {
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
try {
|
|
392
392
|
request.params ??= {};
|
|
393
393
|
request.params._meta ??= {};
|
|
394
394
|
if (request.params._meta["traceparent"] === void 0) {
|
|
395
|
-
|
|
395
|
+
_chunkDC2MFO65cjs.injectTraceContext.call(void 0, ctx, request.params._meta);
|
|
396
396
|
}
|
|
397
397
|
} catch (error) {
|
|
398
398
|
_chunkWC573FCIcjs.logger.debug(`Brizz MCP: failed to inject trace context into _meta: ${String(error)}`);
|
|
@@ -409,14 +409,14 @@ function wrapOnRequest(original, tracer) {
|
|
|
409
409
|
return original.apply(this, args);
|
|
410
410
|
}
|
|
411
411
|
const method = request.method;
|
|
412
|
-
if (method === METHOD_TOOLS_CALL &&
|
|
412
|
+
if (method === METHOD_TOOLS_CALL && _chunkVY6GEZSPcjs.isSessionToolCall.call(void 0, request)) {
|
|
413
413
|
return answerSessionToolCall(this, request, tracer, args, original);
|
|
414
414
|
}
|
|
415
415
|
const handler = _nullishCoalesce(handlers.get(method), () => ( this.fallbackRequestHandler));
|
|
416
416
|
if (!handler) {
|
|
417
417
|
return original.apply(this, args);
|
|
418
418
|
}
|
|
419
|
-
const tracking =
|
|
419
|
+
const tracking = _chunkVY6GEZSPcjs.isEnabled.call(void 0, ) && method === METHOD_TOOLS_CALL ? _chunkVY6GEZSPcjs.popTrackingArguments.call(void 0, request) : {};
|
|
420
420
|
const started = safeStartServerSpan(tracer, request, this, tracking);
|
|
421
421
|
if (!started) {
|
|
422
422
|
return original.apply(this, args);
|
|
@@ -426,9 +426,9 @@ function wrapOnRequest(original, tracer) {
|
|
|
426
426
|
if (method === METHOD_TOOLS_LIST) {
|
|
427
427
|
hooks.onResult = (result) => {
|
|
428
428
|
let advertised = result;
|
|
429
|
-
if (
|
|
429
|
+
if (_chunkVY6GEZSPcjs.isEnabled.call(void 0, )) {
|
|
430
430
|
try {
|
|
431
|
-
advertised =
|
|
431
|
+
advertised = _chunkVY6GEZSPcjs.patchListToolsResult.call(void 0, result);
|
|
432
432
|
} catch (error) {
|
|
433
433
|
_chunkWC573FCIcjs.logger.warn(
|
|
434
434
|
`Brizz MCP: failed to patch tools/list schemas: ${String(error)}`
|
|
@@ -439,7 +439,7 @@ function wrapOnRequest(original, tracer) {
|
|
|
439
439
|
try {
|
|
440
440
|
emitSchemaSpansFromListResponse(
|
|
441
441
|
advertised,
|
|
442
|
-
|
|
442
|
+
_chunkVY6GEZSPcjs.resolveTransportSessionId.call(void 0, this),
|
|
443
443
|
tracer
|
|
444
444
|
);
|
|
445
445
|
} catch (error) {
|
|
@@ -452,7 +452,7 @@ function wrapOnRequest(original, tracer) {
|
|
|
452
452
|
}
|
|
453
453
|
if (method !== METHOD_TOOLS_CALL) {
|
|
454
454
|
hooks.onError = () => {
|
|
455
|
-
|
|
455
|
+
_chunkVY6GEZSPcjs.stampAndPropagateSession.call(void 0, span, _chunkVY6GEZSPcjs.resolveSessionId.call(void 0, this, spanCtx), spanCtx);
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
458
|
const wrappedHandler = (req, extra) => _api.context.with(
|
|
@@ -486,7 +486,7 @@ function answerSessionToolCall(protocol, request, tracer, args, original) {
|
|
|
486
486
|
if (!handlers) {
|
|
487
487
|
return original.apply(protocol, args);
|
|
488
488
|
}
|
|
489
|
-
const { id, result } =
|
|
489
|
+
const { id, result } = _chunkVY6GEZSPcjs.sessionToolResult.call(void 0, );
|
|
490
490
|
const started = safeStartServerSpan(tracer, request, protocol, { sessionId: id });
|
|
491
491
|
const handler = () => started ? _api.context.with(started.spanCtx, () => result) : result;
|
|
492
492
|
const hadEntry = handlers.has(METHOD_TOOLS_CALL);
|
|
@@ -576,8 +576,8 @@ function safeStartServerSpan(tracer, request, protocol, tracking = {}) {
|
|
|
576
576
|
parentCtx
|
|
577
577
|
);
|
|
578
578
|
applyServerRequestAttributes(span, request, protocol);
|
|
579
|
-
const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => (
|
|
580
|
-
const { context: sessCtx } =
|
|
579
|
+
const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => ( _chunkVY6GEZSPcjs.resolveSessionId.call(void 0, protocol, parentCtx))) : void 0;
|
|
580
|
+
const { context: sessCtx } = _chunkVY6GEZSPcjs.stampAndPropagateSession.call(void 0,
|
|
581
581
|
span,
|
|
582
582
|
resolved,
|
|
583
583
|
parentCtx,
|
|
@@ -593,7 +593,7 @@ function extractParentContext(request) {
|
|
|
593
593
|
try {
|
|
594
594
|
const meta = _optionalChain([request, 'access', _24 => _24.params, 'optionalAccess', _25 => _25._meta]);
|
|
595
595
|
if (meta && typeof meta === "object") {
|
|
596
|
-
return
|
|
596
|
+
return _chunkDC2MFO65cjs.extractTraceContext.call(void 0, _api.context.active(), meta);
|
|
597
597
|
}
|
|
598
598
|
} catch (error) {
|
|
599
599
|
_chunkWC573FCIcjs.logger.debug(
|
|
@@ -633,7 +633,7 @@ function safeEnd(span) {
|
|
|
633
633
|
|
|
634
634
|
// src/internal/instrumentation/mcp/version.ts
|
|
635
635
|
var INSTRUMENTATION_NAME = "@brizz/sdk/mcp";
|
|
636
|
-
var INSTRUMENTATION_VERSION =
|
|
636
|
+
var INSTRUMENTATION_VERSION = _chunkVY6GEZSPcjs.getSDKVersion.call(void 0, );
|
|
637
637
|
|
|
638
638
|
// src/internal/instrumentation/mcp/instrumentation.ts
|
|
639
639
|
var PROTOCOL_MODULE_NAME = "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
@@ -652,8 +652,8 @@ var MCPInstrumentation = class extends _openinferenceinstrumentationmcp.MCPInstr
|
|
|
652
652
|
|
|
653
653
|
constructor(_config) {
|
|
654
654
|
super({ instrumentationConfig: _optionalChain([_config, 'optionalAccess', _26 => _26.instrumentationConfig]) });
|
|
655
|
-
this.setTracerProvider(
|
|
656
|
-
this.brizzTracer =
|
|
655
|
+
this.setTracerProvider(_chunkDC2MFO65cjs.brizzTracerProvider);
|
|
656
|
+
this.brizzTracer = _chunkDC2MFO65cjs.brizzTracerProvider.getTracer(INSTRUMENTATION_NAME, INSTRUMENTATION_VERSION);
|
|
657
657
|
}
|
|
658
658
|
/**
|
|
659
659
|
* Apply the SERVER + CLIENT patch to a loaded `protocol.js` module. Shared
|
|
@@ -10,6 +10,6 @@ export { DEFAULT_PII_PATTERNS } from './internal/masking/patterns.js';
|
|
|
10
10
|
export { maskValue, maskAttributes } from './internal/masking/utils.js';
|
|
11
11
|
export { LogLevel, logger, setLogLevel, getLogLevel } from './internal/logger.js';
|
|
12
12
|
export type { ILogger } from './internal/logger.js';
|
|
13
|
-
export { SeverityNumber } from '@opentelemetry/api
|
|
13
|
+
export { SeverityNumber } from '@opentelemetry/api';
|
|
14
14
|
export type { AttributeValue } from '@opentelemetry/api';
|
|
15
|
-
export type { ReadableSpan } from '@opentelemetry/sdk-trace
|
|
15
|
+
export type { ReadableSpan } from '@opentelemetry/sdk-trace';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AttributeValue } from '@opentelemetry/api';
|
|
2
|
-
import type { ReadableSpan } from '@opentelemetry/sdk-trace
|
|
2
|
+
import type { ReadableSpan } from '@opentelemetry/sdk-trace';
|
|
3
3
|
import type { IBrizzInitializeOptions } from '../index.js';
|
|
4
4
|
import type { LogLevel } from './logger.js';
|
|
5
5
|
import type { IMaskingConfig } from './masking/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReadableSpan } from '@opentelemetry/sdk-trace
|
|
1
|
+
import type { ReadableSpan } from '@opentelemetry/sdk-trace';
|
|
2
2
|
export declare function patchCallbackManagerModule(module: unknown): boolean;
|
|
3
3
|
export declare function patchInstalledCallbackManager(): void;
|
|
4
4
|
export declare function restampLangChainSpan(span: ReadableSpan): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Context } from '@opentelemetry/api';
|
|
2
|
-
import type { Span as SdkSpan, SpanProcessor } from '@opentelemetry/sdk-trace
|
|
2
|
+
import type { Span as SdkSpan, SpanProcessor } from '@opentelemetry/sdk-trace';
|
|
3
3
|
import type { Telemetry } from 'ai';
|
|
4
4
|
export declare function createInterruptIntegration(): Telemetry;
|
|
5
5
|
export declare class InterruptPropagator implements SpanProcessor {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { SeverityNumber } from '@opentelemetry/api
|
|
1
|
+
import type { AnyValue } from '@opentelemetry/api';
|
|
2
|
+
import { SeverityNumber } from '@opentelemetry/api';
|
|
3
3
|
import { LoggerProvider } from '@opentelemetry/sdk-logs';
|
|
4
4
|
import type { IResolvedBrizzConfig } from '../config.js';
|
|
5
5
|
export declare class LoggingModule {
|
|
@@ -12,11 +12,11 @@ export declare class LoggingModule {
|
|
|
12
12
|
private createLoggerProvider;
|
|
13
13
|
private activeLoggerProvider;
|
|
14
14
|
setup(config: IResolvedBrizzConfig): void;
|
|
15
|
-
emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?:
|
|
15
|
+
emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
|
|
16
16
|
isInitialized(): boolean;
|
|
17
17
|
getLoggerProvider(): LoggerProvider | null;
|
|
18
18
|
forceFlush(): Promise<void>;
|
|
19
19
|
shutdown(): Promise<void>;
|
|
20
20
|
}
|
|
21
|
-
export declare function emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?:
|
|
22
|
-
export declare function emitEventWithSessionId(sessionId: string, name: string, attributes?: Record<string, string | number | boolean>, body?:
|
|
21
|
+
export declare function emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
|
|
22
|
+
export declare function emitEventWithSessionId(sessionId: string, name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LogRecordExporter,
|
|
1
|
+
import type { LogRecordExporter, ReadWriteLogRecord } from '@opentelemetry/sdk-logs';
|
|
2
2
|
import { BatchLogRecordProcessor, SimpleLogRecordProcessor } from '@opentelemetry/sdk-logs';
|
|
3
3
|
import type { IResolvedBrizzConfig } from '../../config.js';
|
|
4
4
|
import type { IAttributesMaskingRule, ILogMaskingConfig } from '../../masking/types.js';
|
|
@@ -6,11 +6,11 @@ export declare const DEFAULT_LOG_MASKING_RULES: IAttributesMaskingRule[];
|
|
|
6
6
|
export declare class BrizzSimpleLogRecordProcessor extends SimpleLogRecordProcessor {
|
|
7
7
|
readonly config: IResolvedBrizzConfig;
|
|
8
8
|
constructor(exporter: LogRecordExporter, config: IResolvedBrizzConfig);
|
|
9
|
-
onEmit(logRecord:
|
|
9
|
+
onEmit(logRecord: ReadWriteLogRecord): void;
|
|
10
10
|
}
|
|
11
11
|
export declare class BrizzBatchLogRecordProcessor extends BatchLogRecordProcessor {
|
|
12
12
|
readonly config: IResolvedBrizzConfig;
|
|
13
13
|
constructor(exporter: LogRecordExporter, config: IResolvedBrizzConfig);
|
|
14
|
-
onEmit(logRecord:
|
|
14
|
+
onEmit(logRecord: ReadWriteLogRecord): void;
|
|
15
15
|
}
|
|
16
|
-
export declare function maskLog(logRecord:
|
|
16
|
+
export declare function maskLog(logRecord: ReadWriteLogRecord, config: ILogMaskingConfig): ReadWriteLogRecord;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AttributeValue } from '@opentelemetry/api';
|
|
2
2
|
import type { LogRecordExporter } from '@opentelemetry/sdk-logs';
|
|
3
3
|
import type { MetricReader } from '@opentelemetry/sdk-metrics';
|
|
4
|
-
import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace
|
|
4
|
+
import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace';
|
|
5
5
|
import { type IInstrumentModules } from './instrumentation/index.js';
|
|
6
6
|
import { type IMCPSessionTrackingConfig } from './instrumentation/mcp/client-session.js';
|
|
7
7
|
import type { LogLevel } from './logger.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExportResult } from '@opentelemetry/core';
|
|
2
|
-
import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace
|
|
2
|
+
import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace';
|
|
3
3
|
import type { IResolvedBrizzConfig } from '../../config.js';
|
|
4
4
|
export type SpanExporterFactory = (serviceName: string) => SpanExporter;
|
|
5
5
|
export declare class BrizzSpanExporter implements SpanExporter {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { SpanProcessor } from '@opentelemetry/sdk-trace
|
|
1
|
+
import type { SpanProcessor } from '@opentelemetry/sdk-trace';
|
|
2
2
|
export declare function createEveSessionProcessor(): SpanProcessor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Context } from '@opentelemetry/api';
|
|
2
|
-
import { BatchSpanProcessor, type ReadableSpan, SimpleSpanProcessor, type Span, type SpanExporter } from '@opentelemetry/sdk-trace
|
|
2
|
+
import { BatchSpanProcessor, type ReadableSpan, SimpleSpanProcessor, type Span, type SpanExporter } from '@opentelemetry/sdk-trace';
|
|
3
3
|
import type { IResolvedBrizzConfig } from '../../config.js';
|
|
4
4
|
import type { IAttributesMaskingRule, ISpanMaskingConfig } from '../../masking/types.js';
|
|
5
5
|
export declare const DEFAULT_MASKING_RULES: IAttributesMaskingRule[];
|
|
@@ -11,5 +11,6 @@ export declare function bindToBrizz<T extends {
|
|
|
11
11
|
export declare function setPrivateTracerProvider(provider: TracerProvider | null): void;
|
|
12
12
|
export declare function isPrivateTracerProvider(): boolean;
|
|
13
13
|
export declare function ensureContextManager(): 'existing' | 'installed' | 'failed';
|
|
14
|
+
export declare function registerTracerProvider(provider: TracerProvider): void;
|
|
14
15
|
export declare function injectTraceContext(ctx: Context, carrier: Record<string, unknown>): void;
|
|
15
16
|
export declare function extractTraceContext(ctx: Context, carrier: Record<string, unknown>): Context;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SpanExporter } from '@opentelemetry/sdk-trace
|
|
2
|
-
import type { SpanProcessor } from '@opentelemetry/sdk-trace
|
|
1
|
+
import type { SpanExporter } from '@opentelemetry/sdk-trace';
|
|
2
|
+
import type { SpanProcessor } from '@opentelemetry/sdk-trace';
|
|
3
3
|
import type { IResolvedBrizzConfig } from '../config.js';
|
|
4
4
|
export declare class TracingModule {
|
|
5
5
|
private static instance;
|
|
@@ -10,6 +10,6 @@ export { DEFAULT_PII_PATTERNS } from './internal/masking/patterns.js';
|
|
|
10
10
|
export { maskValue, maskAttributes } from './internal/masking/utils.js';
|
|
11
11
|
export { LogLevel, logger, setLogLevel, getLogLevel } from './internal/logger.js';
|
|
12
12
|
export type { ILogger } from './internal/logger.js';
|
|
13
|
-
export { SeverityNumber } from '@opentelemetry/api
|
|
13
|
+
export { SeverityNumber } from '@opentelemetry/api';
|
|
14
14
|
export type { AttributeValue } from '@opentelemetry/api';
|
|
15
|
-
export type { ReadableSpan } from '@opentelemetry/sdk-trace
|
|
15
|
+
export type { ReadableSpan } from '@opentelemetry/sdk-trace';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AttributeValue } from '@opentelemetry/api';
|
|
2
|
-
import type { ReadableSpan } from '@opentelemetry/sdk-trace
|
|
2
|
+
import type { ReadableSpan } from '@opentelemetry/sdk-trace';
|
|
3
3
|
import type { IBrizzInitializeOptions } from '../index.js';
|
|
4
4
|
import type { LogLevel } from './logger.js';
|
|
5
5
|
import type { IMaskingConfig } from './masking/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReadableSpan } from '@opentelemetry/sdk-trace
|
|
1
|
+
import type { ReadableSpan } from '@opentelemetry/sdk-trace';
|
|
2
2
|
export declare function patchCallbackManagerModule(module: unknown): boolean;
|
|
3
3
|
export declare function patchInstalledCallbackManager(): void;
|
|
4
4
|
export declare function restampLangChainSpan(span: ReadableSpan): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Context } from '@opentelemetry/api';
|
|
2
|
-
import type { Span as SdkSpan, SpanProcessor } from '@opentelemetry/sdk-trace
|
|
2
|
+
import type { Span as SdkSpan, SpanProcessor } from '@opentelemetry/sdk-trace';
|
|
3
3
|
import type { Telemetry } from 'ai';
|
|
4
4
|
export declare function createInterruptIntegration(): Telemetry;
|
|
5
5
|
export declare class InterruptPropagator implements SpanProcessor {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { SeverityNumber } from '@opentelemetry/api
|
|
1
|
+
import type { AnyValue } from '@opentelemetry/api';
|
|
2
|
+
import { SeverityNumber } from '@opentelemetry/api';
|
|
3
3
|
import { LoggerProvider } from '@opentelemetry/sdk-logs';
|
|
4
4
|
import type { IResolvedBrizzConfig } from '../config.js';
|
|
5
5
|
export declare class LoggingModule {
|
|
@@ -12,11 +12,11 @@ export declare class LoggingModule {
|
|
|
12
12
|
private createLoggerProvider;
|
|
13
13
|
private activeLoggerProvider;
|
|
14
14
|
setup(config: IResolvedBrizzConfig): void;
|
|
15
|
-
emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?:
|
|
15
|
+
emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
|
|
16
16
|
isInitialized(): boolean;
|
|
17
17
|
getLoggerProvider(): LoggerProvider | null;
|
|
18
18
|
forceFlush(): Promise<void>;
|
|
19
19
|
shutdown(): Promise<void>;
|
|
20
20
|
}
|
|
21
|
-
export declare function emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?:
|
|
22
|
-
export declare function emitEventWithSessionId(sessionId: string, name: string, attributes?: Record<string, string | number | boolean>, body?:
|
|
21
|
+
export declare function emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
|
|
22
|
+
export declare function emitEventWithSessionId(sessionId: string, name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LogRecordExporter,
|
|
1
|
+
import type { LogRecordExporter, ReadWriteLogRecord } from '@opentelemetry/sdk-logs';
|
|
2
2
|
import { BatchLogRecordProcessor, SimpleLogRecordProcessor } from '@opentelemetry/sdk-logs';
|
|
3
3
|
import type { IResolvedBrizzConfig } from '../../config.js';
|
|
4
4
|
import type { IAttributesMaskingRule, ILogMaskingConfig } from '../../masking/types.js';
|
|
@@ -6,11 +6,11 @@ export declare const DEFAULT_LOG_MASKING_RULES: IAttributesMaskingRule[];
|
|
|
6
6
|
export declare class BrizzSimpleLogRecordProcessor extends SimpleLogRecordProcessor {
|
|
7
7
|
readonly config: IResolvedBrizzConfig;
|
|
8
8
|
constructor(exporter: LogRecordExporter, config: IResolvedBrizzConfig);
|
|
9
|
-
onEmit(logRecord:
|
|
9
|
+
onEmit(logRecord: ReadWriteLogRecord): void;
|
|
10
10
|
}
|
|
11
11
|
export declare class BrizzBatchLogRecordProcessor extends BatchLogRecordProcessor {
|
|
12
12
|
readonly config: IResolvedBrizzConfig;
|
|
13
13
|
constructor(exporter: LogRecordExporter, config: IResolvedBrizzConfig);
|
|
14
|
-
onEmit(logRecord:
|
|
14
|
+
onEmit(logRecord: ReadWriteLogRecord): void;
|
|
15
15
|
}
|
|
16
|
-
export declare function maskLog(logRecord:
|
|
16
|
+
export declare function maskLog(logRecord: ReadWriteLogRecord, config: ILogMaskingConfig): ReadWriteLogRecord;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AttributeValue } from '@opentelemetry/api';
|
|
2
2
|
import type { LogRecordExporter } from '@opentelemetry/sdk-logs';
|
|
3
3
|
import type { MetricReader } from '@opentelemetry/sdk-metrics';
|
|
4
|
-
import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace
|
|
4
|
+
import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace';
|
|
5
5
|
import { type IInstrumentModules } from './instrumentation/index.js';
|
|
6
6
|
import { type IMCPSessionTrackingConfig } from './instrumentation/mcp/client-session.js';
|
|
7
7
|
import type { LogLevel } from './logger.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExportResult } from '@opentelemetry/core';
|
|
2
|
-
import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace
|
|
2
|
+
import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace';
|
|
3
3
|
import type { IResolvedBrizzConfig } from '../../config.js';
|
|
4
4
|
export type SpanExporterFactory = (serviceName: string) => SpanExporter;
|
|
5
5
|
export declare class BrizzSpanExporter implements SpanExporter {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { SpanProcessor } from '@opentelemetry/sdk-trace
|
|
1
|
+
import type { SpanProcessor } from '@opentelemetry/sdk-trace';
|
|
2
2
|
export declare function createEveSessionProcessor(): SpanProcessor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Context } from '@opentelemetry/api';
|
|
2
|
-
import { BatchSpanProcessor, type ReadableSpan, SimpleSpanProcessor, type Span, type SpanExporter } from '@opentelemetry/sdk-trace
|
|
2
|
+
import { BatchSpanProcessor, type ReadableSpan, SimpleSpanProcessor, type Span, type SpanExporter } from '@opentelemetry/sdk-trace';
|
|
3
3
|
import type { IResolvedBrizzConfig } from '../../config.js';
|
|
4
4
|
import type { IAttributesMaskingRule, ISpanMaskingConfig } from '../../masking/types.js';
|
|
5
5
|
export declare const DEFAULT_MASKING_RULES: IAttributesMaskingRule[];
|
|
@@ -11,5 +11,6 @@ export declare function bindToBrizz<T extends {
|
|
|
11
11
|
export declare function setPrivateTracerProvider(provider: TracerProvider | null): void;
|
|
12
12
|
export declare function isPrivateTracerProvider(): boolean;
|
|
13
13
|
export declare function ensureContextManager(): 'existing' | 'installed' | 'failed';
|
|
14
|
+
export declare function registerTracerProvider(provider: TracerProvider): void;
|
|
14
15
|
export declare function injectTraceContext(ctx: Context, carrier: Record<string, unknown>): void;
|
|
15
16
|
export declare function extractTraceContext(ctx: Context, carrier: Record<string, unknown>): Context;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SpanExporter } from '@opentelemetry/sdk-trace
|
|
2
|
-
import type { SpanProcessor } from '@opentelemetry/sdk-trace
|
|
1
|
+
import type { SpanExporter } from '@opentelemetry/sdk-trace';
|
|
2
|
+
import type { SpanProcessor } from '@opentelemetry/sdk-trace';
|
|
3
3
|
import type { IResolvedBrizzConfig } from '../config.js';
|
|
4
4
|
export declare class TracingModule {
|
|
5
5
|
private static instance;
|