@mastra/otel-exporter 1.0.0-beta.2 → 1.0.0-beta.3
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/CHANGELOG.md +38 -0
- package/README.md +47 -3
- package/dist/gen-ai-messages.d.ts +26 -0
- package/dist/gen-ai-messages.d.ts.map +1 -0
- package/dist/gen-ai-semantics.d.ts +22 -0
- package/dist/gen-ai-semantics.d.ts.map +1 -0
- package/dist/index.cjs +430 -361
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +432 -362
- package/dist/index.js.map +1 -1
- package/dist/span-converter.d.ts +26 -35
- package/dist/span-converter.d.ts.map +1 -1
- package/dist/tracing.d.ts +2 -2
- package/dist/tracing.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/mastra-span.d.ts +0 -38
- package/dist/mastra-span.d.ts.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
var observability = require('@mastra/core/observability');
|
|
4
4
|
var observability$1 = require('@mastra/observability');
|
|
5
5
|
var api = require('@opentelemetry/api');
|
|
6
|
-
var resources = require('@opentelemetry/resources');
|
|
7
6
|
var sdkTraceBase = require('@opentelemetry/sdk-trace-base');
|
|
7
|
+
var fs = require('fs');
|
|
8
|
+
var url = require('url');
|
|
9
|
+
var resources = require('@opentelemetry/resources');
|
|
8
10
|
var semanticConventions = require('@opentelemetry/semantic-conventions');
|
|
11
|
+
var incubating = require('@opentelemetry/semantic-conventions/incubating');
|
|
9
12
|
|
|
10
13
|
// src/tracing.ts
|
|
11
14
|
|
|
@@ -205,396 +208,473 @@ function resolveCustomConfig(config) {
|
|
|
205
208
|
protocol: config.protocol || "http/json"
|
|
206
209
|
};
|
|
207
210
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
ended;
|
|
222
|
-
resource;
|
|
223
|
-
instrumentationLibrary;
|
|
224
|
-
instrumentationScope;
|
|
225
|
-
droppedAttributesCount = 0;
|
|
226
|
-
droppedEventsCount = 0;
|
|
227
|
-
droppedLinksCount = 0;
|
|
228
|
-
constructor(span, attributes, kind, parentSpanId, resource, instrumentationLibrary) {
|
|
229
|
-
this.name = span.name;
|
|
230
|
-
this.kind = kind;
|
|
231
|
-
this.attributes = attributes;
|
|
232
|
-
this.parentSpanId = parentSpanId;
|
|
233
|
-
this.links = [];
|
|
234
|
-
this.events = [];
|
|
235
|
-
this.startTime = this.dateToHrTime(span.startTime);
|
|
236
|
-
this.endTime = span.endTime ? this.dateToHrTime(span.endTime) : this.startTime;
|
|
237
|
-
this.ended = !!span.endTime;
|
|
238
|
-
if (span.endTime) {
|
|
239
|
-
const durationMs = span.endTime.getTime() - span.startTime.getTime();
|
|
240
|
-
this.duration = [Math.floor(durationMs / 1e3), durationMs % 1e3 * 1e6];
|
|
241
|
-
} else {
|
|
242
|
-
this.duration = [0, 0];
|
|
211
|
+
|
|
212
|
+
// src/gen-ai-messages.ts
|
|
213
|
+
var isMastraMessagePart = (p) => {
|
|
214
|
+
return typeof p === "object" && p != null && "type" in p && (p.type === "text" || p.type === "tool-call" || p.type === "tool-result") && (p.type === "text" && "text" in p || p.type === "tool-call" && "toolCallId" in p && "toolName" in p && "input" in p || p.type === "tool-result" && "toolCallId" in p && "toolName" in p && "output" in p);
|
|
215
|
+
};
|
|
216
|
+
var isMastraMessage = (m) => {
|
|
217
|
+
return typeof m === "object" && m != null && "role" in m && "content" in m && (typeof m.content === "string" || Array.isArray(m.content) && m.content.every(isMastraMessagePart));
|
|
218
|
+
};
|
|
219
|
+
var convertMastraMessagesToGenAIMessages = (inputOutputString) => {
|
|
220
|
+
try {
|
|
221
|
+
const parsedIO = JSON.parse(inputOutputString);
|
|
222
|
+
if (typeof parsedIO !== "object" || parsedIO == null || !("messages" in parsedIO) && !("text" in parsedIO)) {
|
|
223
|
+
return inputOutputString;
|
|
243
224
|
}
|
|
244
|
-
if (
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
attributes: {
|
|
252
|
-
"exception.message": span.errorInfo.message,
|
|
253
|
-
"exception.type": "Error",
|
|
254
|
-
...span.errorInfo.details?.stack && {
|
|
255
|
-
"exception.stacktrace": span.errorInfo.details.stack
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
time: this.startTime,
|
|
259
|
-
droppedAttributesCount: 0
|
|
260
|
-
});
|
|
261
|
-
} else if (span.endTime) {
|
|
262
|
-
this.status = { code: api.SpanStatusCode.OK };
|
|
263
|
-
} else {
|
|
264
|
-
this.status = { code: api.SpanStatusCode.UNSET };
|
|
265
|
-
}
|
|
266
|
-
if (span.isEvent) {
|
|
267
|
-
this.events.push({
|
|
268
|
-
name: "instant_event",
|
|
269
|
-
attributes: {},
|
|
270
|
-
time: this.startTime,
|
|
271
|
-
droppedAttributesCount: 0
|
|
272
|
-
});
|
|
225
|
+
if ("text" in parsedIO) {
|
|
226
|
+
return JSON.stringify([
|
|
227
|
+
{
|
|
228
|
+
role: "assistant",
|
|
229
|
+
parts: [{ type: "text", content: parsedIO.text }]
|
|
230
|
+
}
|
|
231
|
+
]);
|
|
273
232
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
233
|
+
if (Array.isArray(parsedIO.messages)) {
|
|
234
|
+
return JSON.stringify(
|
|
235
|
+
parsedIO.messages.map((m) => {
|
|
236
|
+
if (!isMastraMessage(m)) {
|
|
237
|
+
return m;
|
|
238
|
+
}
|
|
239
|
+
const role = m.role;
|
|
240
|
+
let parts = [];
|
|
241
|
+
if (Array.isArray(m.content)) {
|
|
242
|
+
parts = m.content.map((c) => {
|
|
243
|
+
switch (c.type) {
|
|
244
|
+
case "text":
|
|
245
|
+
return {
|
|
246
|
+
type: "text",
|
|
247
|
+
content: c.text
|
|
248
|
+
};
|
|
249
|
+
case "tool-call":
|
|
250
|
+
return {
|
|
251
|
+
type: "tool_call",
|
|
252
|
+
id: c.toolCallId,
|
|
253
|
+
name: c.toolName,
|
|
254
|
+
arguments: JSON.stringify(c.input)
|
|
255
|
+
};
|
|
256
|
+
case "tool-result":
|
|
257
|
+
return {
|
|
258
|
+
type: "tool_call_response",
|
|
259
|
+
id: c.toolCallId,
|
|
260
|
+
name: c.toolName,
|
|
261
|
+
response: JSON.stringify(c.output.value)
|
|
262
|
+
};
|
|
263
|
+
default:
|
|
264
|
+
return c;
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
} else {
|
|
268
|
+
parts = [
|
|
269
|
+
{
|
|
270
|
+
type: "text",
|
|
271
|
+
content: m.content
|
|
272
|
+
}
|
|
273
|
+
];
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
role,
|
|
277
|
+
parts
|
|
278
|
+
};
|
|
279
|
+
})
|
|
280
|
+
);
|
|
287
281
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
version: "1.0.0"
|
|
292
|
-
};
|
|
293
|
-
this.instrumentationScope = this.instrumentationLibrary;
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* Convert JavaScript Date to hrtime format
|
|
297
|
-
*/
|
|
298
|
-
dateToHrTime(date) {
|
|
299
|
-
const ms = date.getTime();
|
|
300
|
-
const seconds = Math.floor(ms / 1e3);
|
|
301
|
-
const nanoseconds = ms % 1e3 * 1e6;
|
|
302
|
-
return [seconds, nanoseconds];
|
|
282
|
+
return inputOutputString;
|
|
283
|
+
} catch {
|
|
284
|
+
return inputOutputString;
|
|
303
285
|
}
|
|
304
286
|
};
|
|
305
287
|
|
|
306
|
-
// src/
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
288
|
+
// src/gen-ai-semantics.ts
|
|
289
|
+
function getOperationName(span) {
|
|
290
|
+
switch (span.type) {
|
|
291
|
+
case observability.SpanType.MODEL_GENERATION:
|
|
292
|
+
return "chat";
|
|
293
|
+
case observability.SpanType.TOOL_CALL:
|
|
294
|
+
case observability.SpanType.MCP_TOOL_CALL:
|
|
295
|
+
return "execute_tool";
|
|
296
|
+
case observability.SpanType.AGENT_RUN:
|
|
297
|
+
return "invoke_agent";
|
|
298
|
+
case observability.SpanType.WORKFLOW_RUN:
|
|
299
|
+
return "invoke_workflow";
|
|
300
|
+
default:
|
|
301
|
+
return span.type.toLowerCase();
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
function sanitizeSpanName(name) {
|
|
305
|
+
return name.replace(/[^\p{L}\p{N}._ -]/gu, "");
|
|
306
|
+
}
|
|
307
|
+
function getSpanIdentifier(span) {
|
|
308
|
+
switch (span.type) {
|
|
309
|
+
case observability.SpanType.MODEL_GENERATION: {
|
|
310
|
+
const attrs = span.attributes;
|
|
311
|
+
return attrs?.model ?? "unknown";
|
|
321
312
|
}
|
|
313
|
+
case observability.SpanType.TOOL_CALL:
|
|
314
|
+
case observability.SpanType.MCP_TOOL_CALL: {
|
|
315
|
+
const attrs = span.attributes;
|
|
316
|
+
return attrs?.toolId ?? "unknown";
|
|
317
|
+
}
|
|
318
|
+
case observability.SpanType.AGENT_RUN: {
|
|
319
|
+
const attrs = span.attributes;
|
|
320
|
+
return attrs?.agentName ?? attrs?.agentId ?? "unknown";
|
|
321
|
+
}
|
|
322
|
+
case observability.SpanType.WORKFLOW_RUN: {
|
|
323
|
+
const attrs = span.attributes;
|
|
324
|
+
return attrs?.workflowId ?? "unknown";
|
|
325
|
+
}
|
|
326
|
+
default:
|
|
327
|
+
return null;
|
|
322
328
|
}
|
|
323
|
-
return SPAN_KIND_MAPPING[type] || api.SpanKind.INTERNAL;
|
|
324
329
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
this.instrumentationLibrary = {
|
|
331
|
-
name: "@mastra/otel-exporter",
|
|
332
|
-
version: "1.0.0"
|
|
333
|
-
};
|
|
330
|
+
function getSpanName(span) {
|
|
331
|
+
const identifier = getSpanIdentifier(span);
|
|
332
|
+
if (identifier) {
|
|
333
|
+
const operation = getOperationName(span);
|
|
334
|
+
return `${operation} ${identifier}`;
|
|
334
335
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
this.instrumentationLibrary
|
|
352
|
-
);
|
|
336
|
+
return sanitizeSpanName(span.name);
|
|
337
|
+
}
|
|
338
|
+
function getAttributes(span) {
|
|
339
|
+
const attributes = {};
|
|
340
|
+
const spanType = span.type.toLowerCase();
|
|
341
|
+
attributes[incubating.ATTR_GEN_AI_OPERATION_NAME] = getOperationName(span);
|
|
342
|
+
attributes["mastra.span.type"] = span.type;
|
|
343
|
+
if (span.input !== void 0) {
|
|
344
|
+
const inputStr = typeof span.input === "string" ? span.input : JSON.stringify(span.input);
|
|
345
|
+
if (span.type === observability.SpanType.MODEL_GENERATION) {
|
|
346
|
+
attributes[incubating.ATTR_GEN_AI_INPUT_MESSAGES] = convertMastraMessagesToGenAIMessages(inputStr);
|
|
347
|
+
} else if (span.type === observability.SpanType.TOOL_CALL || span.type === observability.SpanType.MCP_TOOL_CALL) {
|
|
348
|
+
attributes["gen_ai.tool.call.arguments"] = inputStr;
|
|
349
|
+
} else {
|
|
350
|
+
attributes[`mastra.${spanType}.input`] = inputStr;
|
|
351
|
+
}
|
|
353
352
|
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
const model = attrs?.model || "unknown";
|
|
363
|
-
return `${operation} ${model}`;
|
|
364
|
-
}
|
|
365
|
-
case observability.SpanType.TOOL_CALL:
|
|
366
|
-
case observability.SpanType.MCP_TOOL_CALL: {
|
|
367
|
-
const toolAttrs = Span.attributes;
|
|
368
|
-
const toolName = toolAttrs?.toolId || "unknown";
|
|
369
|
-
return `tool.execute ${toolName}`;
|
|
370
|
-
}
|
|
371
|
-
case observability.SpanType.AGENT_RUN: {
|
|
372
|
-
const agentAttrs = Span.attributes;
|
|
373
|
-
const agentId = agentAttrs?.agentId || "unknown";
|
|
374
|
-
return `agent.${agentId}`;
|
|
375
|
-
}
|
|
376
|
-
case observability.SpanType.WORKFLOW_RUN: {
|
|
377
|
-
const workflowAttrs = Span.attributes;
|
|
378
|
-
const workflowId = workflowAttrs?.workflowId || "unknown";
|
|
379
|
-
return `workflow.${workflowId}`;
|
|
380
|
-
}
|
|
381
|
-
case observability.SpanType.WORKFLOW_STEP:
|
|
382
|
-
return Span.name;
|
|
383
|
-
default:
|
|
384
|
-
return Span.name;
|
|
353
|
+
if (span.output !== void 0) {
|
|
354
|
+
const outputStr = typeof span.output === "string" ? span.output : JSON.stringify(span.output);
|
|
355
|
+
if (span.type === observability.SpanType.MODEL_GENERATION) {
|
|
356
|
+
attributes[incubating.ATTR_GEN_AI_OUTPUT_MESSAGES] = convertMastraMessagesToGenAIMessages(outputStr);
|
|
357
|
+
} else if (span.type === observability.SpanType.TOOL_CALL || span.type === observability.SpanType.MCP_TOOL_CALL) {
|
|
358
|
+
attributes["gen_ai.tool.call.result"] = outputStr;
|
|
359
|
+
} else {
|
|
360
|
+
attributes[`mastra.${spanType}.output`] = outputStr;
|
|
385
361
|
}
|
|
386
362
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
buildAttributes(Span) {
|
|
392
|
-
const attributes = {};
|
|
393
|
-
attributes["gen_ai.operation.name"] = this.getOperationName(Span);
|
|
394
|
-
attributes["span.kind"] = this.getSpanKindString(Span);
|
|
395
|
-
attributes["mastra.span.type"] = Span.type;
|
|
396
|
-
attributes["mastra.trace_id"] = Span.traceId;
|
|
397
|
-
attributes["mastra.span_id"] = Span.id;
|
|
398
|
-
if (Span.parentSpanId) {
|
|
399
|
-
attributes["mastra.parent_span_id"] = Span.parentSpanId;
|
|
400
|
-
}
|
|
401
|
-
if (Span.input !== void 0) {
|
|
402
|
-
const inputStr = typeof Span.input === "string" ? Span.input : JSON.stringify(Span.input);
|
|
403
|
-
attributes["input"] = inputStr;
|
|
404
|
-
if (Span.type === observability.SpanType.MODEL_GENERATION) {
|
|
405
|
-
attributes["gen_ai.prompt"] = inputStr;
|
|
406
|
-
} else if (Span.type === observability.SpanType.TOOL_CALL || Span.type === observability.SpanType.MCP_TOOL_CALL) {
|
|
407
|
-
attributes["gen_ai.tool.input"] = inputStr;
|
|
408
|
-
}
|
|
363
|
+
if (span.type === observability.SpanType.MODEL_GENERATION && span.attributes) {
|
|
364
|
+
const modelAttrs = span.attributes;
|
|
365
|
+
if (modelAttrs.model) {
|
|
366
|
+
attributes[incubating.ATTR_GEN_AI_REQUEST_MODEL] = modelAttrs.model;
|
|
409
367
|
}
|
|
410
|
-
if (
|
|
411
|
-
|
|
412
|
-
attributes["output"] = outputStr;
|
|
413
|
-
if (Span.type === observability.SpanType.MODEL_GENERATION) {
|
|
414
|
-
attributes["gen_ai.completion"] = outputStr;
|
|
415
|
-
} else if (Span.type === observability.SpanType.TOOL_CALL || Span.type === observability.SpanType.MCP_TOOL_CALL) {
|
|
416
|
-
attributes["gen_ai.tool.output"] = outputStr;
|
|
417
|
-
}
|
|
368
|
+
if (modelAttrs.provider) {
|
|
369
|
+
attributes[incubating.ATTR_GEN_AI_PROVIDER_NAME] = normalizeProvider(modelAttrs.provider);
|
|
418
370
|
}
|
|
419
|
-
if (
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
if (modelAttrs.provider) {
|
|
425
|
-
attributes["gen_ai.system"] = modelAttrs.provider;
|
|
371
|
+
if (modelAttrs.usage) {
|
|
372
|
+
const inputTokens = modelAttrs.usage.inputTokens ?? modelAttrs.usage.promptTokens;
|
|
373
|
+
const outputTokens = modelAttrs.usage.outputTokens ?? modelAttrs.usage.completionTokens;
|
|
374
|
+
if (inputTokens !== void 0) {
|
|
375
|
+
attributes[incubating.ATTR_GEN_AI_USAGE_INPUT_TOKENS] = inputTokens;
|
|
426
376
|
}
|
|
427
|
-
if (
|
|
428
|
-
|
|
429
|
-
const outputTokens = modelAttrs.usage.outputTokens ?? modelAttrs.usage.completionTokens;
|
|
430
|
-
if (inputTokens !== void 0) {
|
|
431
|
-
attributes["gen_ai.usage.input_tokens"] = inputTokens;
|
|
432
|
-
}
|
|
433
|
-
if (outputTokens !== void 0) {
|
|
434
|
-
attributes["gen_ai.usage.output_tokens"] = outputTokens;
|
|
435
|
-
}
|
|
436
|
-
if (modelAttrs.usage.totalTokens !== void 0) {
|
|
437
|
-
attributes["gen_ai.usage.total_tokens"] = modelAttrs.usage.totalTokens;
|
|
438
|
-
}
|
|
439
|
-
if (modelAttrs.usage.reasoningTokens !== void 0) {
|
|
440
|
-
attributes["gen_ai.usage.reasoning_tokens"] = modelAttrs.usage.reasoningTokens;
|
|
441
|
-
}
|
|
442
|
-
if (modelAttrs.usage.cachedInputTokens !== void 0) {
|
|
443
|
-
attributes["gen_ai.usage.cached_input_tokens"] = modelAttrs.usage.cachedInputTokens;
|
|
444
|
-
}
|
|
377
|
+
if (outputTokens !== void 0) {
|
|
378
|
+
attributes[incubating.ATTR_GEN_AI_USAGE_OUTPUT_TOKENS] = outputTokens;
|
|
445
379
|
}
|
|
446
|
-
if (modelAttrs.
|
|
447
|
-
|
|
448
|
-
attributes["gen_ai.request.temperature"] = modelAttrs.parameters.temperature;
|
|
449
|
-
}
|
|
450
|
-
if (modelAttrs.parameters.maxOutputTokens !== void 0) {
|
|
451
|
-
attributes["gen_ai.request.max_tokens"] = modelAttrs.parameters.maxOutputTokens;
|
|
452
|
-
}
|
|
453
|
-
if (modelAttrs.parameters.topP !== void 0) {
|
|
454
|
-
attributes["gen_ai.request.top_p"] = modelAttrs.parameters.topP;
|
|
455
|
-
}
|
|
456
|
-
if (modelAttrs.parameters.topK !== void 0) {
|
|
457
|
-
attributes["gen_ai.request.top_k"] = modelAttrs.parameters.topK;
|
|
458
|
-
}
|
|
459
|
-
if (modelAttrs.parameters.presencePenalty !== void 0) {
|
|
460
|
-
attributes["gen_ai.request.presence_penalty"] = modelAttrs.parameters.presencePenalty;
|
|
461
|
-
}
|
|
462
|
-
if (modelAttrs.parameters.frequencyPenalty !== void 0) {
|
|
463
|
-
attributes["gen_ai.request.frequency_penalty"] = modelAttrs.parameters.frequencyPenalty;
|
|
464
|
-
}
|
|
465
|
-
if (modelAttrs.parameters.stopSequences) {
|
|
466
|
-
attributes["gen_ai.request.stop_sequences"] = JSON.stringify(modelAttrs.parameters.stopSequences);
|
|
467
|
-
}
|
|
380
|
+
if (modelAttrs.usage.reasoningTokens !== void 0) {
|
|
381
|
+
attributes["gen_ai.usage.reasoning_tokens"] = modelAttrs.usage.reasoningTokens;
|
|
468
382
|
}
|
|
469
|
-
if (modelAttrs.
|
|
470
|
-
attributes["gen_ai.
|
|
383
|
+
if (modelAttrs.usage.cachedInputTokens !== void 0) {
|
|
384
|
+
attributes["gen_ai.usage.cached_input_tokens"] = modelAttrs.usage.cachedInputTokens;
|
|
471
385
|
}
|
|
472
386
|
}
|
|
473
|
-
if (
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
attributes["gen_ai.tool.name"] = toolAttrs.toolId;
|
|
387
|
+
if (modelAttrs.parameters) {
|
|
388
|
+
if (modelAttrs.parameters.temperature !== void 0) {
|
|
389
|
+
attributes[incubating.ATTR_GEN_AI_REQUEST_TEMPERATURE] = modelAttrs.parameters.temperature;
|
|
477
390
|
}
|
|
478
|
-
if (
|
|
479
|
-
|
|
480
|
-
if (mcpAttrs.mcpServer) {
|
|
481
|
-
attributes["mcp.server"] = mcpAttrs.mcpServer;
|
|
482
|
-
}
|
|
483
|
-
if (mcpAttrs.serverVersion) {
|
|
484
|
-
attributes["mcp.server.version"] = mcpAttrs.serverVersion;
|
|
485
|
-
}
|
|
486
|
-
} else {
|
|
487
|
-
if (toolAttrs.toolDescription) {
|
|
488
|
-
attributes["gen_ai.tool.description"] = toolAttrs.toolDescription;
|
|
489
|
-
}
|
|
391
|
+
if (modelAttrs.parameters.maxOutputTokens !== void 0) {
|
|
392
|
+
attributes[incubating.ATTR_GEN_AI_REQUEST_MAX_TOKENS] = modelAttrs.parameters.maxOutputTokens;
|
|
490
393
|
}
|
|
491
|
-
if (
|
|
492
|
-
attributes[
|
|
394
|
+
if (modelAttrs.parameters.topP !== void 0) {
|
|
395
|
+
attributes[incubating.ATTR_GEN_AI_REQUEST_TOP_P] = modelAttrs.parameters.topP;
|
|
493
396
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
const agentAttrs = Span.attributes;
|
|
497
|
-
if (agentAttrs.agentId) {
|
|
498
|
-
attributes["agent.id"] = agentAttrs.agentId;
|
|
499
|
-
attributes["gen_ai.agent.id"] = agentAttrs.agentId;
|
|
397
|
+
if (modelAttrs.parameters.topK !== void 0) {
|
|
398
|
+
attributes[incubating.ATTR_GEN_AI_REQUEST_TOP_K] = modelAttrs.parameters.topK;
|
|
500
399
|
}
|
|
501
|
-
if (
|
|
502
|
-
attributes[
|
|
400
|
+
if (modelAttrs.parameters.presencePenalty !== void 0) {
|
|
401
|
+
attributes[incubating.ATTR_GEN_AI_REQUEST_PRESENCE_PENALTY] = modelAttrs.parameters.presencePenalty;
|
|
503
402
|
}
|
|
504
|
-
if (
|
|
505
|
-
attributes[
|
|
403
|
+
if (modelAttrs.parameters.frequencyPenalty !== void 0) {
|
|
404
|
+
attributes[incubating.ATTR_GEN_AI_REQUEST_FREQUENCY_PENALTY] = modelAttrs.parameters.frequencyPenalty;
|
|
506
405
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
const workflowAttrs = Span.attributes;
|
|
510
|
-
if (workflowAttrs.workflowId) {
|
|
511
|
-
attributes["workflow.id"] = workflowAttrs.workflowId;
|
|
406
|
+
if (modelAttrs.parameters.stopSequences) {
|
|
407
|
+
attributes[incubating.ATTR_GEN_AI_REQUEST_STOP_SEQUENCES] = JSON.stringify(modelAttrs.parameters.stopSequences);
|
|
512
408
|
}
|
|
513
|
-
if (
|
|
514
|
-
attributes[
|
|
409
|
+
if (modelAttrs.parameters.seed) {
|
|
410
|
+
attributes[incubating.ATTR_GEN_AI_REQUEST_SEED] = modelAttrs.parameters.seed;
|
|
515
411
|
}
|
|
516
412
|
}
|
|
517
|
-
if (
|
|
518
|
-
attributes[
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
413
|
+
if (modelAttrs.finishReason) {
|
|
414
|
+
attributes[incubating.ATTR_GEN_AI_RESPONSE_FINISH_REASONS] = JSON.stringify([modelAttrs.finishReason]);
|
|
415
|
+
}
|
|
416
|
+
if (modelAttrs.responseModel) {
|
|
417
|
+
attributes[incubating.ATTR_GEN_AI_RESPONSE_MODEL] = modelAttrs.responseModel;
|
|
418
|
+
}
|
|
419
|
+
if (modelAttrs.responseId) {
|
|
420
|
+
attributes[incubating.ATTR_GEN_AI_RESPONSE_ID] = modelAttrs.responseId;
|
|
421
|
+
}
|
|
422
|
+
if (modelAttrs.serverAddress) {
|
|
423
|
+
attributes[incubating.ATTR_SERVER_ADDRESS] = modelAttrs.serverAddress;
|
|
424
|
+
}
|
|
425
|
+
if (modelAttrs.serverPort !== void 0) {
|
|
426
|
+
attributes[incubating.ATTR_SERVER_PORT] = modelAttrs.serverPort;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
if ((span.type === observability.SpanType.TOOL_CALL || span.type === observability.SpanType.MCP_TOOL_CALL) && span.attributes) {
|
|
430
|
+
const toolAttrs = span.attributes;
|
|
431
|
+
if (toolAttrs.toolId) {
|
|
432
|
+
attributes[incubating.ATTR_GEN_AI_TOOL_NAME] = toolAttrs.toolId;
|
|
433
|
+
}
|
|
434
|
+
if (span.type === observability.SpanType.MCP_TOOL_CALL) {
|
|
435
|
+
const mcpAttrs = toolAttrs;
|
|
436
|
+
if (mcpAttrs.mcpServer) {
|
|
437
|
+
attributes[incubating.ATTR_SERVER_ADDRESS] = mcpAttrs.mcpServer;
|
|
523
438
|
}
|
|
524
|
-
|
|
525
|
-
|
|
439
|
+
} else {
|
|
440
|
+
if (toolAttrs.toolDescription) {
|
|
441
|
+
attributes[incubating.ATTR_GEN_AI_TOOL_DESCRIPTION] = toolAttrs.toolDescription;
|
|
526
442
|
}
|
|
527
443
|
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
}
|
|
534
|
-
if (typeof value === "object") {
|
|
535
|
-
attributes[key] = JSON.stringify(value);
|
|
536
|
-
} else {
|
|
537
|
-
attributes[key] = value;
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
});
|
|
444
|
+
}
|
|
445
|
+
if (span.type === observability.SpanType.AGENT_RUN && span.attributes) {
|
|
446
|
+
const agentAttrs = span.attributes;
|
|
447
|
+
if (agentAttrs.agentId) {
|
|
448
|
+
attributes[incubating.ATTR_GEN_AI_AGENT_ID] = agentAttrs.agentId;
|
|
541
449
|
}
|
|
542
|
-
if (
|
|
543
|
-
attributes[
|
|
450
|
+
if (agentAttrs.agentName) {
|
|
451
|
+
attributes[incubating.ATTR_GEN_AI_AGENT_NAME] = agentAttrs.agentName;
|
|
544
452
|
}
|
|
545
|
-
if (
|
|
546
|
-
attributes[
|
|
547
|
-
|
|
548
|
-
|
|
453
|
+
if (agentAttrs.conversationId) {
|
|
454
|
+
attributes[incubating.ATTR_GEN_AI_CONVERSATION_ID] = agentAttrs.conversationId;
|
|
455
|
+
}
|
|
456
|
+
if (agentAttrs.maxSteps) {
|
|
457
|
+
attributes[`mastra.${spanType}.max_steps`] = agentAttrs.maxSteps;
|
|
458
|
+
}
|
|
459
|
+
if (agentAttrs.availableTools) {
|
|
460
|
+
attributes[`gen_ai.tool.definitions`] = JSON.stringify(agentAttrs.availableTools);
|
|
461
|
+
}
|
|
462
|
+
attributes[incubating.ATTR_GEN_AI_SYSTEM_INSTRUCTIONS] = agentAttrs.instructions;
|
|
463
|
+
}
|
|
464
|
+
if (span.errorInfo) {
|
|
465
|
+
attributes[incubating.ATTR_ERROR_TYPE] = span.errorInfo.id || "unknown";
|
|
466
|
+
attributes[incubating.ATTR_ERROR_MESSAGE] = span.errorInfo.message;
|
|
467
|
+
if (span.errorInfo.domain) {
|
|
468
|
+
attributes["error.domain"] = span.errorInfo.domain;
|
|
469
|
+
}
|
|
470
|
+
if (span.errorInfo.category) {
|
|
471
|
+
attributes["error.category"] = span.errorInfo.category;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
return attributes;
|
|
475
|
+
}
|
|
476
|
+
var PROVIDER_ALIASES = {
|
|
477
|
+
anthropic: ["anthropic", "claude"],
|
|
478
|
+
"aws.bedrock": ["awsbedrock", "bedrock", "amazonbedrock"],
|
|
479
|
+
"azure.ai.inference": ["azureaiinference", "azureinference"],
|
|
480
|
+
"azure.ai.openai": ["azureaiopenai", "azureopenai", "msopenai", "microsoftopenai"],
|
|
481
|
+
cohere: ["cohere"],
|
|
482
|
+
deepseek: ["deepseek"],
|
|
483
|
+
"gcp.gemini": ["gcpgemini", "gemini"],
|
|
484
|
+
"gcp.gen_ai": ["gcpgenai", "googlegenai", "googleai"],
|
|
485
|
+
"gcp.vertex_ai": ["gcpvertexai", "vertexai"],
|
|
486
|
+
groq: ["groq"],
|
|
487
|
+
"ibm.watsonx.ai": ["ibmwatsonxai", "watsonx", "watsonxai"],
|
|
488
|
+
mistral_ai: ["mistral", "mistralai"],
|
|
489
|
+
openai: ["openai", "oai"],
|
|
490
|
+
perplexity: ["perplexity", "pplx"],
|
|
491
|
+
x_ai: ["xai", "x-ai", "x_ai", "x.com ai"]
|
|
492
|
+
};
|
|
493
|
+
function normalizeProviderString(input) {
|
|
494
|
+
return input.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
495
|
+
}
|
|
496
|
+
function normalizeProvider(providerName) {
|
|
497
|
+
const normalized = normalizeProviderString(providerName);
|
|
498
|
+
for (const [canonical, aliases] of Object.entries(PROVIDER_ALIASES)) {
|
|
499
|
+
for (const alias of aliases) {
|
|
500
|
+
if (normalized === alias) {
|
|
501
|
+
return canonical;
|
|
502
|
+
}
|
|
549
503
|
}
|
|
550
|
-
return attributes;
|
|
551
504
|
}
|
|
505
|
+
return providerName.toLowerCase();
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
// src/span-converter.ts
|
|
509
|
+
var SpanConverter = class {
|
|
510
|
+
constructor(params) {
|
|
511
|
+
this.params = params;
|
|
512
|
+
this.format = params.format;
|
|
513
|
+
}
|
|
514
|
+
resource;
|
|
515
|
+
scope;
|
|
516
|
+
initPromise;
|
|
517
|
+
format;
|
|
552
518
|
/**
|
|
553
|
-
*
|
|
519
|
+
* Lazily initialize resource & scope on first use.
|
|
520
|
+
* Subsequent calls reuse the same promise (no races).
|
|
554
521
|
*/
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
const attrs = Span.attributes;
|
|
559
|
-
return attrs?.resultType === "tool_selection" ? "tool_selection" : "chat";
|
|
560
|
-
}
|
|
561
|
-
case observability.SpanType.TOOL_CALL:
|
|
562
|
-
case observability.SpanType.MCP_TOOL_CALL:
|
|
563
|
-
return "tool.execute";
|
|
564
|
-
case observability.SpanType.AGENT_RUN:
|
|
565
|
-
return "agent.run";
|
|
566
|
-
case observability.SpanType.WORKFLOW_RUN:
|
|
567
|
-
return "workflow.run";
|
|
568
|
-
default:
|
|
569
|
-
return Span.type.replace(/_/g, ".");
|
|
522
|
+
async initIfNeeded() {
|
|
523
|
+
if (this.initPromise) {
|
|
524
|
+
return this.initPromise;
|
|
570
525
|
}
|
|
526
|
+
this.initPromise = (async () => {
|
|
527
|
+
const packageVersion = await getPackageVersion(this.params.packageName) ?? "unknown";
|
|
528
|
+
const serviceVersion = await getPackageVersion("@mastra/core") ?? "unknown";
|
|
529
|
+
let resource = resources.resourceFromAttributes({
|
|
530
|
+
[semanticConventions.ATTR_SERVICE_NAME]: this.params.serviceName || "mastra-service",
|
|
531
|
+
[semanticConventions.ATTR_SERVICE_VERSION]: serviceVersion,
|
|
532
|
+
[semanticConventions.ATTR_TELEMETRY_SDK_NAME]: this.params.packageName,
|
|
533
|
+
[semanticConventions.ATTR_TELEMETRY_SDK_VERSION]: packageVersion,
|
|
534
|
+
[semanticConventions.ATTR_TELEMETRY_SDK_LANGUAGE]: "nodejs"
|
|
535
|
+
});
|
|
536
|
+
if (this.params.config?.resourceAttributes) {
|
|
537
|
+
resource = resource.merge(
|
|
538
|
+
// Duplicate attributes from config will override defaults above
|
|
539
|
+
resources.resourceFromAttributes(this.params.config.resourceAttributes)
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
this.resource = resource;
|
|
543
|
+
this.scope = {
|
|
544
|
+
name: this.params.packageName,
|
|
545
|
+
version: packageVersion
|
|
546
|
+
};
|
|
547
|
+
})();
|
|
548
|
+
return this.initPromise;
|
|
571
549
|
}
|
|
572
550
|
/**
|
|
573
|
-
*
|
|
551
|
+
* Convert a Mastra Span to an OpenTelemetry ReadableSpan
|
|
574
552
|
*/
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
return "server";
|
|
580
|
-
case api.SpanKind.CLIENT:
|
|
581
|
-
return "client";
|
|
582
|
-
case api.SpanKind.INTERNAL:
|
|
583
|
-
return "internal";
|
|
584
|
-
case api.SpanKind.PRODUCER:
|
|
585
|
-
return "producer";
|
|
586
|
-
case api.SpanKind.CONSUMER:
|
|
587
|
-
return "consumer";
|
|
588
|
-
default:
|
|
589
|
-
return "internal";
|
|
553
|
+
async convertSpan(span) {
|
|
554
|
+
await this.initIfNeeded();
|
|
555
|
+
if (!this.resource || !this.scope) {
|
|
556
|
+
throw new Error("SpanConverter not initialized correctly");
|
|
590
557
|
}
|
|
558
|
+
const name = getSpanName(span);
|
|
559
|
+
const kind = getSpanKind(span.type);
|
|
560
|
+
const attributes = getAttributes(span);
|
|
561
|
+
if (span.metadata) {
|
|
562
|
+
for (const [k, v] of Object.entries(span.metadata)) {
|
|
563
|
+
if (v === null || v === void 0) {
|
|
564
|
+
continue;
|
|
565
|
+
}
|
|
566
|
+
attributes[`mastra.metadata.${k}`] = typeof v === "object" ? JSON.stringify(v) : v;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
if (span.isRootSpan && span.tags?.length) {
|
|
570
|
+
attributes["mastra.tags"] = JSON.stringify(span.tags);
|
|
571
|
+
}
|
|
572
|
+
const startTime = dateToHrTime(span.startTime);
|
|
573
|
+
const endTime = span.endTime ? dateToHrTime(span.endTime) : startTime;
|
|
574
|
+
const duration = computeDuration(span.startTime, span.endTime);
|
|
575
|
+
const { status, events } = buildStatusAndEvents(span, startTime);
|
|
576
|
+
const spanContext = {
|
|
577
|
+
traceId: span.traceId,
|
|
578
|
+
spanId: span.id,
|
|
579
|
+
traceFlags: api.TraceFlags.SAMPLED,
|
|
580
|
+
isRemote: false
|
|
581
|
+
};
|
|
582
|
+
const parentSpanContext = span.parentSpanId ? {
|
|
583
|
+
traceId: span.traceId,
|
|
584
|
+
spanId: span.parentSpanId,
|
|
585
|
+
traceFlags: api.TraceFlags.SAMPLED,
|
|
586
|
+
isRemote: false
|
|
587
|
+
} : void 0;
|
|
588
|
+
const links = [];
|
|
589
|
+
const readable = {
|
|
590
|
+
name,
|
|
591
|
+
kind,
|
|
592
|
+
spanContext: () => spanContext,
|
|
593
|
+
parentSpanContext,
|
|
594
|
+
startTime,
|
|
595
|
+
endTime,
|
|
596
|
+
status,
|
|
597
|
+
attributes,
|
|
598
|
+
links,
|
|
599
|
+
events,
|
|
600
|
+
duration,
|
|
601
|
+
ended: !!span.endTime,
|
|
602
|
+
resource: this.resource,
|
|
603
|
+
instrumentationScope: this.scope,
|
|
604
|
+
droppedAttributesCount: 0,
|
|
605
|
+
droppedEventsCount: 0,
|
|
606
|
+
droppedLinksCount: 0
|
|
607
|
+
};
|
|
608
|
+
return readable;
|
|
591
609
|
}
|
|
592
610
|
};
|
|
611
|
+
async function getPackageVersion(pkgName) {
|
|
612
|
+
try {
|
|
613
|
+
const manifestUrl = new URL(await undefined(`${pkgName}/package.json`));
|
|
614
|
+
const path = url.fileURLToPath(manifestUrl);
|
|
615
|
+
const pkgJson = JSON.parse(fs.readFileSync(path, "utf8"));
|
|
616
|
+
return pkgJson.version;
|
|
617
|
+
} catch {
|
|
618
|
+
return void 0;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
function getSpanKind(type) {
|
|
622
|
+
switch (type) {
|
|
623
|
+
case observability.SpanType.MODEL_GENERATION:
|
|
624
|
+
case observability.SpanType.MCP_TOOL_CALL:
|
|
625
|
+
return api.SpanKind.CLIENT;
|
|
626
|
+
default:
|
|
627
|
+
return api.SpanKind.INTERNAL;
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
function dateToHrTime(date) {
|
|
631
|
+
const ms = date.getTime();
|
|
632
|
+
const seconds = Math.floor(ms / 1e3);
|
|
633
|
+
const nanoseconds = ms % 1e3 * 1e6;
|
|
634
|
+
return [seconds, nanoseconds];
|
|
635
|
+
}
|
|
636
|
+
function computeDuration(start, end) {
|
|
637
|
+
if (!end) return [0, 0];
|
|
638
|
+
const diffMs = end.getTime() - start.getTime();
|
|
639
|
+
return [Math.floor(diffMs / 1e3), diffMs % 1e3 * 1e6];
|
|
640
|
+
}
|
|
641
|
+
function buildStatusAndEvents(span, defaultTime) {
|
|
642
|
+
const events = [];
|
|
643
|
+
if (span.errorInfo) {
|
|
644
|
+
const status = {
|
|
645
|
+
code: api.SpanStatusCode.ERROR,
|
|
646
|
+
message: span.errorInfo.message
|
|
647
|
+
};
|
|
648
|
+
events.push({
|
|
649
|
+
name: "exception",
|
|
650
|
+
attributes: {
|
|
651
|
+
"exception.message": span.errorInfo.message,
|
|
652
|
+
"exception.type": "Error",
|
|
653
|
+
...span.errorInfo.details?.stack && {
|
|
654
|
+
"exception.stacktrace": span.errorInfo.details.stack
|
|
655
|
+
}
|
|
656
|
+
},
|
|
657
|
+
time: defaultTime,
|
|
658
|
+
droppedAttributesCount: 0
|
|
659
|
+
});
|
|
660
|
+
return { status, events };
|
|
661
|
+
}
|
|
662
|
+
if (span.endTime) {
|
|
663
|
+
return {
|
|
664
|
+
status: { code: api.SpanStatusCode.OK },
|
|
665
|
+
events
|
|
666
|
+
};
|
|
667
|
+
}
|
|
668
|
+
return {
|
|
669
|
+
status: { code: api.SpanStatusCode.UNSET },
|
|
670
|
+
events
|
|
671
|
+
};
|
|
672
|
+
}
|
|
593
673
|
|
|
594
674
|
// src/tracing.ts
|
|
595
675
|
var OtelExporter = class extends observability$1.BaseExporter {
|
|
596
676
|
config;
|
|
597
|
-
|
|
677
|
+
observabilityConfig;
|
|
598
678
|
spanConverter;
|
|
599
679
|
processor;
|
|
600
680
|
exporter;
|
|
@@ -603,7 +683,6 @@ var OtelExporter = class extends observability$1.BaseExporter {
|
|
|
603
683
|
constructor(config) {
|
|
604
684
|
super(config);
|
|
605
685
|
this.config = config;
|
|
606
|
-
this.spanConverter = new SpanConverter();
|
|
607
686
|
if (config.logLevel === "debug") {
|
|
608
687
|
api.diag.setLogger(new api.DiagConsoleLogger(), api.DiagLogLevel.DEBUG);
|
|
609
688
|
}
|
|
@@ -612,7 +691,7 @@ var OtelExporter = class extends observability$1.BaseExporter {
|
|
|
612
691
|
* Initialize with tracing configuration
|
|
613
692
|
*/
|
|
614
693
|
init(options) {
|
|
615
|
-
this.
|
|
694
|
+
this.observabilityConfig = options.config;
|
|
616
695
|
}
|
|
617
696
|
async setupExporter() {
|
|
618
697
|
if (this.isSetup || this.exporter) return;
|
|
@@ -690,21 +769,12 @@ var OtelExporter = class extends observability$1.BaseExporter {
|
|
|
690
769
|
}
|
|
691
770
|
async setupProcessor() {
|
|
692
771
|
if (this.processor || this.isSetup) return;
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
[semanticConventions.ATTR_TELEMETRY_SDK_VERSION]: "1.0.0",
|
|
699
|
-
[semanticConventions.ATTR_TELEMETRY_SDK_LANGUAGE]: "nodejs"
|
|
772
|
+
this.spanConverter = new SpanConverter({
|
|
773
|
+
packageName: "@mastra/otel-exporter",
|
|
774
|
+
serviceName: this.observabilityConfig?.serviceName,
|
|
775
|
+
config: this.config,
|
|
776
|
+
format: "GenAI_v1_38_0"
|
|
700
777
|
});
|
|
701
|
-
if (this.config.resourceAttributes) {
|
|
702
|
-
resource = resource.merge(
|
|
703
|
-
// Duplicate attributes from config will override defaults above
|
|
704
|
-
resources.resourceFromAttributes(this.config.resourceAttributes)
|
|
705
|
-
);
|
|
706
|
-
}
|
|
707
|
-
this.spanConverter = new SpanConverter(resource);
|
|
708
778
|
this.processor = new sdkTraceBase.BatchSpanProcessor(this.exporter, {
|
|
709
779
|
maxExportBatchSize: this.config.batchSize || 512,
|
|
710
780
|
// Default batch size
|
|
@@ -740,9 +810,9 @@ var OtelExporter = class extends observability$1.BaseExporter {
|
|
|
740
810
|
return;
|
|
741
811
|
}
|
|
742
812
|
try {
|
|
743
|
-
const
|
|
813
|
+
const otelSpan = await this.spanConverter.convertSpan(span);
|
|
744
814
|
await new Promise((resolve) => {
|
|
745
|
-
this.processor.onEnd(
|
|
815
|
+
this.processor.onEnd(otelSpan);
|
|
746
816
|
resolve();
|
|
747
817
|
});
|
|
748
818
|
this.logger.debug(
|
|
@@ -759,7 +829,6 @@ var OtelExporter = class extends observability$1.BaseExporter {
|
|
|
759
829
|
}
|
|
760
830
|
};
|
|
761
831
|
|
|
762
|
-
exports.MastraReadableSpan = MastraReadableSpan;
|
|
763
832
|
exports.OtelExporter = OtelExporter;
|
|
764
833
|
exports.SpanConverter = SpanConverter;
|
|
765
834
|
exports.getSpanKind = getSpanKind;
|