@mastra/observability 1.21.1-alpha.0 → 1.21.1-alpha.2
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/dist/exporters/test.d.ts.map +1 -1
- package/dist/index.cjs +144 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +143 -108
- package/dist/index.js.map +1 -1
- package/dist/instances/base.d.ts.map +1 -1
- package/dist/metrics/pricing-data.json +1070 -559
- package/dist/spans/base.d.ts +33 -1
- package/dist/spans/base.d.ts.map +1 -1
- package/dist/usage.d.ts +3 -0
- package/dist/usage.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/exporters/test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAwBH,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,UAAU,EACV,aAAa,EACb,WAAW,EACX,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACT,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD;;GAEG;AACH,UAAU,SAAS;IACjB,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAC;IAClB,sCAAsC;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,wCAAwC;IACxC,SAAS,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,kBAAkB,EAAE,MAAM,CAAC;IAC3B,6BAA6B;IAC7B,UAAU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AY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA4FvG;IAiMD;;OAEG;IACH,OAAO,IAAI,MAAM,EAAE,CAElB;IAED;;OAEG;IACH,QAAQ,IAAI,IAAI,CAMf;IAED;;;;OAIG;IACH,kBAAkB,IAAI;QACpB,KAAK,EAAE,OAAO,CAAC;QACf,aAAa,EAAE,OAAO,CAAC;QACvB,gBAAgB,EAAE,OAAO,CAAC;QAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,eAAe,EAAE,kBAAkB,EAAE,CAAC;KACvC,CAcA;IAMD;;OAEG;IACH,WAAW,IAAI,IAAI,CAUlB;IAED;;OAEG;IACH,KAAK,IAAI,IAAI,CAEZ;IAED;;OAEG;IACH,kBAAkB,IAAI,2BAA2B,CAUhD;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAgB3B;IAEK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAG9B;CAsBF;AAMD;;GAEG;AACH,eAAO,MAAM,YAAY,qBAAe,CAAC;AACzC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,2BAA2B,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -20,7 +20,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
20
|
value: mod,
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
|
-
//#endregion
|
|
24
23
|
let _mastra_core_base = require("@mastra/core/base");
|
|
25
24
|
let _mastra_core_error = require("@mastra/core/error");
|
|
26
25
|
let _mastra_core_logger = require("@mastra/core/logger");
|
|
@@ -38,7 +37,7 @@ let stream_web = require("stream/web");
|
|
|
38
37
|
let _mastra_core_features = require("@mastra/core/features");
|
|
39
38
|
let _mastra_core_storage = require("@mastra/core/storage");
|
|
40
39
|
let crypto$1 = require("crypto");
|
|
41
|
-
|
|
40
|
+
// src/bus/route-event.ts
|
|
42
41
|
/**
|
|
43
42
|
* Route a single event to the appropriate method on a handler.
|
|
44
43
|
*
|
|
@@ -105,8 +104,7 @@ function catchAsyncResult(result, handlerName, signal, logger) {
|
|
|
105
104
|
logger.error(`[Observability] ${signal} handler error [handler=${handlerName}]:`, err);
|
|
106
105
|
});
|
|
107
106
|
}
|
|
108
|
-
|
|
109
|
-
//#region src/bus/base.ts
|
|
107
|
+
// src/bus/base.ts
|
|
110
108
|
/**
|
|
111
109
|
* BaseObservabilityEventBus - Generic event bus for observability events.
|
|
112
110
|
*
|
|
@@ -181,8 +179,7 @@ var BaseObservabilityEventBus = class BaseObservabilityEventBus extends _mastra_
|
|
|
181
179
|
this.subscribers.clear();
|
|
182
180
|
}
|
|
183
181
|
};
|
|
184
|
-
|
|
185
|
-
//#region src/spans/serialization.ts
|
|
182
|
+
// src/spans/serialization.ts
|
|
186
183
|
/**
|
|
187
184
|
* Bounded serialization utilities for AI tracing.
|
|
188
185
|
*
|
|
@@ -548,8 +545,7 @@ function deepClean(value, options = DEFAULT_DEEP_CLEAN_OPTIONS) {
|
|
|
548
545
|
}
|
|
549
546
|
return helper(value, 0);
|
|
550
547
|
}
|
|
551
|
-
|
|
552
|
-
//#region src/bus/observability-bus.ts
|
|
548
|
+
// src/bus/observability-bus.ts
|
|
553
549
|
/**
|
|
554
550
|
* Apply deepClean() to non-tracing observability events. Tracing events are
|
|
555
551
|
* already deep-cleaned at span construction time (see spans/base.ts and
|
|
@@ -758,8 +754,7 @@ var ObservabilityBus = class extends BaseObservabilityEventBus {
|
|
|
758
754
|
await super.shutdown();
|
|
759
755
|
}
|
|
760
756
|
};
|
|
761
|
-
|
|
762
|
-
//#region src/config.ts
|
|
757
|
+
// src/config.ts
|
|
763
758
|
/**
|
|
764
759
|
* Sampling strategy types
|
|
765
760
|
*/
|
|
@@ -886,8 +881,7 @@ const observabilityRegistryConfigSchema = zod_v4.z.object({
|
|
|
886
881
|
}
|
|
887
882
|
return true;
|
|
888
883
|
}, { message: "A \"configSelector\" requires at least one config or default observability to be configured." });
|
|
889
|
-
|
|
890
|
-
//#region src/ids.ts
|
|
884
|
+
// src/ids.ts
|
|
891
885
|
/**
|
|
892
886
|
* Signal and span id helpers.
|
|
893
887
|
*
|
|
@@ -955,8 +949,7 @@ function resolveExportedSpanId(span) {
|
|
|
955
949
|
if (!span) return void 0;
|
|
956
950
|
return typeof span.getExportedSpanId === "function" ? span.getExportedSpanId() : span.id;
|
|
957
951
|
}
|
|
958
|
-
|
|
959
|
-
//#region src/context/logger.ts
|
|
952
|
+
// src/context/logger.ts
|
|
960
953
|
/** Numeric priority used to compare log levels against the configured minimum. */
|
|
961
954
|
const LOG_LEVEL_PRIORITY = {
|
|
962
955
|
debug: 0,
|
|
@@ -1024,8 +1017,7 @@ var LoggerContextImpl = class {
|
|
|
1024
1017
|
this.config.observabilityBus.emit(event);
|
|
1025
1018
|
}
|
|
1026
1019
|
};
|
|
1027
|
-
|
|
1028
|
-
//#region src/context/metrics.ts
|
|
1020
|
+
// src/context/metrics.ts
|
|
1029
1021
|
/**
|
|
1030
1022
|
* User-facing metric emission API. All metrics are routed through
|
|
1031
1023
|
* ObservabilityBus.emit() after validation and cardinality filtering.
|
|
@@ -1100,14 +1092,12 @@ function cloneCostContext(costContext) {
|
|
|
1100
1092
|
costMetadata: costContext.costMetadata ? structuredClone(costContext.costMetadata) : void 0
|
|
1101
1093
|
};
|
|
1102
1094
|
}
|
|
1103
|
-
|
|
1104
|
-
//#region src/model-id.ts
|
|
1095
|
+
// src/model-id.ts
|
|
1105
1096
|
/** Return the first model id that contains non-whitespace characters. */
|
|
1106
1097
|
function resolveModelId(...candidates) {
|
|
1107
1098
|
return candidates.find((candidate) => candidate?.trim());
|
|
1108
1099
|
}
|
|
1109
|
-
|
|
1110
|
-
//#region src/metrics/pricing-model.ts
|
|
1100
|
+
// src/metrics/pricing-model.ts
|
|
1111
1101
|
var PricingTier = class {
|
|
1112
1102
|
index;
|
|
1113
1103
|
when;
|
|
@@ -1165,8 +1155,7 @@ var PricingModel = class {
|
|
|
1165
1155
|
return this.tiers[0] ?? null;
|
|
1166
1156
|
}
|
|
1167
1157
|
};
|
|
1168
|
-
|
|
1169
|
-
//#region src/metrics/models-dev.ts
|
|
1158
|
+
// src/metrics/models-dev.ts
|
|
1170
1159
|
/** Same catalog the model router reads in `@mastra/core` (`gateways/models-dev.ts`). */
|
|
1171
1160
|
const MODELS_DEV_API_URL = "https://models.dev/api.json";
|
|
1172
1161
|
/**
|
|
@@ -1297,8 +1286,7 @@ function sortedEntries(value) {
|
|
|
1297
1286
|
function isRecord(value) {
|
|
1298
1287
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1299
1288
|
}
|
|
1300
|
-
|
|
1301
|
-
//#region src/metrics/pricing-registry.ts
|
|
1289
|
+
// src/metrics/pricing-registry.ts
|
|
1302
1290
|
const DATA_FILE_NAME = "pricing-data.json";
|
|
1303
1291
|
const REFRESH_INTERVAL_MS = 864e5;
|
|
1304
1292
|
const MIN_REFRESH_ATTEMPT_INTERVAL_MS = 36e5;
|
|
@@ -1649,8 +1637,7 @@ function stripDateSuffix(model) {
|
|
|
1649
1637
|
stripped = model.replace(/-\d{2}-20\d{2}$/, "");
|
|
1650
1638
|
return stripped;
|
|
1651
1639
|
}
|
|
1652
|
-
|
|
1653
|
-
//#region src/metrics/types.ts
|
|
1640
|
+
// src/metrics/types.ts
|
|
1654
1641
|
const PricingMeter = {
|
|
1655
1642
|
INPUT_TOKENS: "input_tokens",
|
|
1656
1643
|
INPUT_AUDIO_TOKENS: "input_audio_tokens",
|
|
@@ -1686,8 +1673,7 @@ const TokenMetrics = {
|
|
|
1686
1673
|
OUTPUT_AUDIO: "mastra_model_output_audio_tokens",
|
|
1687
1674
|
OUTPUT_IMAGE: "mastra_model_output_image_tokens"
|
|
1688
1675
|
};
|
|
1689
|
-
|
|
1690
|
-
//#region src/metrics/usage-metrics.ts
|
|
1676
|
+
// src/metrics/usage-metrics.ts
|
|
1691
1677
|
function getTokenMetricSamples(usage) {
|
|
1692
1678
|
const samples = [];
|
|
1693
1679
|
const pushIfDefined = (name, value) => {
|
|
@@ -1721,8 +1707,7 @@ function getTokenMetricSamples(usage) {
|
|
|
1721
1707
|
}
|
|
1722
1708
|
return samples;
|
|
1723
1709
|
}
|
|
1724
|
-
|
|
1725
|
-
//#region src/metrics/estimator.ts
|
|
1710
|
+
// src/metrics/estimator.ts
|
|
1726
1711
|
function estimateCosts(args, pricingRegistry = PricingRegistry.getGlobal()) {
|
|
1727
1712
|
const { provider, model, usage } = args;
|
|
1728
1713
|
const results = /* @__PURE__ */ new Map();
|
|
@@ -1954,8 +1939,7 @@ function estimateCostForMeter(args) {
|
|
|
1954
1939
|
}
|
|
1955
1940
|
};
|
|
1956
1941
|
}
|
|
1957
|
-
|
|
1958
|
-
//#region src/metrics/auto-extract.ts
|
|
1942
|
+
// src/metrics/auto-extract.ts
|
|
1959
1943
|
/**
|
|
1960
1944
|
* Emits metrics derived from live spans.
|
|
1961
1945
|
*/
|
|
@@ -2109,8 +2093,7 @@ function getDurationMetricName(span) {
|
|
|
2109
2093
|
default: return null;
|
|
2110
2094
|
}
|
|
2111
2095
|
}
|
|
2112
|
-
|
|
2113
|
-
//#region src/metrics/cardinality.ts
|
|
2096
|
+
// src/metrics/cardinality.ts
|
|
2114
2097
|
/** Matches standard UUID v4 strings (case-insensitive). */
|
|
2115
2098
|
const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
2116
2099
|
var CardinalityFilter = class {
|
|
@@ -2141,8 +2124,7 @@ var CardinalityFilter = class {
|
|
|
2141
2124
|
return filtered;
|
|
2142
2125
|
}
|
|
2143
2126
|
};
|
|
2144
|
-
|
|
2145
|
-
//#region src/usage.ts
|
|
2127
|
+
// src/usage.ts
|
|
2146
2128
|
/**
|
|
2147
2129
|
* For non-BYOK requests, `usage.cost` is the complete OpenRouter charge and
|
|
2148
2130
|
* `usage.costDetails.upstreamInferenceCost` is only its upstream breakdown. For BYOK requests,
|
|
@@ -2219,6 +2201,9 @@ function isDefined(value) {
|
|
|
2219
2201
|
* - Google/Gemini: cachedContentTokenCount, thoughtsTokenCount in providerMetadata.google.usageMetadata
|
|
2220
2202
|
* - OpenRouter: Uses OpenAI-compatible structure (cache tokens in usage)
|
|
2221
2203
|
*
|
|
2204
|
+
* Kept in sync with `packages/core/src/observability/usage.ts` (duplicated so exporters do not need a newer core).
|
|
2205
|
+
* Change both copies together; `usage.parity.test.ts` fails if they drift.
|
|
2206
|
+
*
|
|
2222
2207
|
* @param usage - The LanguageModelV2Usage from AI SDK response
|
|
2223
2208
|
* @param providerMetadata - Optional provider-specific metadata
|
|
2224
2209
|
* @returns UsageStats with inputDetails and outputDetails
|
|
@@ -2324,8 +2309,7 @@ function addUsageStats(a, b) {
|
|
|
2324
2309
|
outputDetails: mergeOutputDetails(a.outputDetails, b.outputDetails)
|
|
2325
2310
|
};
|
|
2326
2311
|
}
|
|
2327
|
-
|
|
2328
|
-
//#region src/model-tracing.ts
|
|
2312
|
+
// src/model-tracing.ts
|
|
2329
2313
|
/**
|
|
2330
2314
|
* Model Span Tracing
|
|
2331
2315
|
*
|
|
@@ -3125,8 +3109,7 @@ var ModelSpanTracker = class {
|
|
|
3125
3109
|
} }));
|
|
3126
3110
|
}
|
|
3127
3111
|
};
|
|
3128
|
-
|
|
3129
|
-
//#region src/spans/metadata.ts
|
|
3112
|
+
// src/spans/metadata.ts
|
|
3130
3113
|
/**
|
|
3131
3114
|
* Shared span-metadata helpers.
|
|
3132
3115
|
*
|
|
@@ -3193,8 +3176,29 @@ function mergeMetadata$1(parentMetadata, metadata) {
|
|
|
3193
3176
|
return metadata;
|
|
3194
3177
|
}
|
|
3195
3178
|
}
|
|
3196
|
-
|
|
3197
|
-
|
|
3179
|
+
// src/spans/base.ts
|
|
3180
|
+
const LINEAGE_KEYS = [
|
|
3181
|
+
"parentEntityType",
|
|
3182
|
+
"parentEntityId",
|
|
3183
|
+
"parentEntityName",
|
|
3184
|
+
"parentEntityVersionId",
|
|
3185
|
+
"rootEntityType",
|
|
3186
|
+
"rootEntityId",
|
|
3187
|
+
"rootEntityName",
|
|
3188
|
+
"rootEntityVersionId"
|
|
3189
|
+
];
|
|
3190
|
+
function ownEntityVersionId(span) {
|
|
3191
|
+
return span instanceof BaseSpan ? span.ownEntityVersionId : void 0;
|
|
3192
|
+
}
|
|
3193
|
+
/** Copy only the lineage fields that have values, so spans don't carry undefined keys */
|
|
3194
|
+
function definedLineage(source) {
|
|
3195
|
+
const lineage = {};
|
|
3196
|
+
for (const key of LINEAGE_KEYS) {
|
|
3197
|
+
const value = source[key];
|
|
3198
|
+
if (value !== void 0 && value !== null) lineage[key] = value;
|
|
3199
|
+
}
|
|
3200
|
+
return lineage;
|
|
3201
|
+
}
|
|
3198
3202
|
/**
|
|
3199
3203
|
* Determines if a span type should be considered internal based on flags.
|
|
3200
3204
|
* Returns false if flags are undefined.
|
|
@@ -3316,6 +3320,17 @@ var BaseSpan = class BaseSpan {
|
|
|
3316
3320
|
isExcluded;
|
|
3317
3321
|
/** Cached canonical correlation context for this live span */
|
|
3318
3322
|
correlationContext;
|
|
3323
|
+
/**
|
|
3324
|
+
* Parent and root entity restored by `rebuildSpan()`. A rebuilt span has no
|
|
3325
|
+
* live `parent`, so its original ancestors are only known from the cached export.
|
|
3326
|
+
*/
|
|
3327
|
+
restoredLineage;
|
|
3328
|
+
/**
|
|
3329
|
+
* Version declared for this span's own entity, or inherited from a parent span
|
|
3330
|
+
* of the same entity. Unlike `metadata.entityVersionId`, never an ancestor's
|
|
3331
|
+
* version for a different entity.
|
|
3332
|
+
*/
|
|
3333
|
+
ownEntityVersionId;
|
|
3319
3334
|
/** Child spans that have started but not yet ended */
|
|
3320
3335
|
#openChildren;
|
|
3321
3336
|
/** The span whose open-child set currently tracks this span: the parent, or a live ancestor after promotion */
|
|
@@ -3353,6 +3368,9 @@ var BaseSpan = class BaseSpan {
|
|
|
3353
3368
|
this.entityType = options.entityType ?? entityParent?.entityType;
|
|
3354
3369
|
this.entityId = options.entityId ?? entityParent?.entityId;
|
|
3355
3370
|
this.entityName = options.entityName ?? entityParent?.entityName;
|
|
3371
|
+
const declaredVersion = options.metadata?.entityVersionId;
|
|
3372
|
+
const sameEntityParent = entityParent instanceof BaseSpan && entityParent.entityType === this.entityType && entityParent.entityId === this.entityId;
|
|
3373
|
+
this.ownEntityVersionId = typeof declaredVersion === "string" ? declaredVersion : sameEntityParent ? entityParent.ownEntityVersionId : void 0;
|
|
3356
3374
|
if (this.isExcluded) {
|
|
3357
3375
|
this.attributes = {};
|
|
3358
3376
|
return;
|
|
@@ -3501,18 +3519,62 @@ var BaseSpan = class BaseSpan {
|
|
|
3501
3519
|
current = current.parent;
|
|
3502
3520
|
}
|
|
3503
3521
|
}
|
|
3504
|
-
/**
|
|
3522
|
+
/**
|
|
3523
|
+
* Restore the parent and root entity a span had before it was exported and
|
|
3524
|
+
* rebuilt (durable execution), so it and its new children keep their lineage.
|
|
3525
|
+
*/
|
|
3526
|
+
restoreEntityLineage(cached) {
|
|
3527
|
+
this.ownEntityVersionId = cached.ownEntityVersionId ?? void 0;
|
|
3528
|
+
const lineage = definedLineage(cached);
|
|
3529
|
+
if (Object.keys(lineage).length > 0) {
|
|
3530
|
+
this.restoredLineage = lineage;
|
|
3531
|
+
this.correlationContext = void 0;
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3534
|
+
/**
|
|
3535
|
+
* Build and cache the canonical correlation context for this live span.
|
|
3536
|
+
*
|
|
3537
|
+
* Parent entity: the nearest ancestor that is not internal or excluded, the
|
|
3538
|
+
* same rule used for entity inheritance. Root entity: the top of the
|
|
3539
|
+
* in-process parent chain, which is not necessarily the distributed trace's
|
|
3540
|
+
* root when the trace continues from another service. The root walk does not
|
|
3541
|
+
* skip internal spans, so the root can name an entity whose span is not
|
|
3542
|
+
* exported. Logs, metrics, scores and feedback share these values.
|
|
3543
|
+
*
|
|
3544
|
+
* When the top of the live chain was rebuilt, its original ancestors only
|
|
3545
|
+
* survive in the restored lineage, so it supplies the root and, when no live
|
|
3546
|
+
* ancestor qualifies, the parent.
|
|
3547
|
+
*/
|
|
3505
3548
|
getCorrelationContext() {
|
|
3506
3549
|
if (this.correlationContext) return this.correlationContext;
|
|
3507
3550
|
const metadata = this.metadata ?? {};
|
|
3508
3551
|
const getMetadataString = (key) => typeof metadata[key] === "string" ? metadata[key] : void 0;
|
|
3509
|
-
const getSpanMetadataString = (span, key) => {
|
|
3510
|
-
const m = span?.metadata;
|
|
3511
|
-
return m && typeof m[key] === "string" ? m[key] : void 0;
|
|
3512
|
-
};
|
|
3513
3552
|
const parentSpan = this.getParentSpan(false);
|
|
3514
3553
|
let rootSpan = this;
|
|
3515
3554
|
while (rootSpan.parent) rootSpan = rootSpan.parent;
|
|
3555
|
+
const restored = rootSpan instanceof BaseSpan ? rootSpan.restoredLineage : void 0;
|
|
3556
|
+
const parentLineage = parentSpan ? {
|
|
3557
|
+
parentEntityType: parentSpan.entityType,
|
|
3558
|
+
parentEntityId: parentSpan.entityId,
|
|
3559
|
+
parentEntityName: parentSpan.entityName,
|
|
3560
|
+
parentEntityVersionId: ownEntityVersionId(parentSpan)
|
|
3561
|
+
} : {
|
|
3562
|
+
parentEntityType: restored?.parentEntityType,
|
|
3563
|
+
parentEntityId: restored?.parentEntityId,
|
|
3564
|
+
parentEntityName: restored?.parentEntityName,
|
|
3565
|
+
parentEntityVersionId: restored?.parentEntityVersionId
|
|
3566
|
+
};
|
|
3567
|
+
const rootLineage = restored ? {
|
|
3568
|
+
rootEntityType: restored.rootEntityType,
|
|
3569
|
+
rootEntityId: restored.rootEntityId,
|
|
3570
|
+
rootEntityName: restored.rootEntityName,
|
|
3571
|
+
rootEntityVersionId: restored.rootEntityVersionId
|
|
3572
|
+
} : {
|
|
3573
|
+
rootEntityType: rootSpan.entityType,
|
|
3574
|
+
rootEntityId: rootSpan.entityId,
|
|
3575
|
+
rootEntityName: rootSpan.entityName,
|
|
3576
|
+
rootEntityVersionId: ownEntityVersionId(rootSpan)
|
|
3577
|
+
};
|
|
3516
3578
|
const rootTags = rootSpan.tags?.length ? [...rootSpan.tags] : void 0;
|
|
3517
3579
|
this.correlationContext = {
|
|
3518
3580
|
traceId: this.traceId,
|
|
@@ -3521,15 +3583,9 @@ var BaseSpan = class BaseSpan {
|
|
|
3521
3583
|
entityType: this.entityType,
|
|
3522
3584
|
entityId: this.entityId,
|
|
3523
3585
|
entityName: this.entityName,
|
|
3524
|
-
entityVersionId:
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
parentEntityName: parentSpan?.entityName,
|
|
3528
|
-
parentEntityVersionId: getSpanMetadataString(parentSpan, "entityVersionId"),
|
|
3529
|
-
rootEntityType: rootSpan.entityType,
|
|
3530
|
-
rootEntityId: rootSpan.entityId,
|
|
3531
|
-
rootEntityName: rootSpan.entityName,
|
|
3532
|
-
rootEntityVersionId: getSpanMetadataString(rootSpan, "entityVersionId"),
|
|
3586
|
+
entityVersionId: this.ownEntityVersionId,
|
|
3587
|
+
...parentLineage,
|
|
3588
|
+
...rootLineage,
|
|
3533
3589
|
userId: getMetadataString("userId"),
|
|
3534
3590
|
organizationId: getMetadataString("organizationId"),
|
|
3535
3591
|
resourceId: getMetadataString("resourceId"),
|
|
@@ -3550,6 +3606,7 @@ var BaseSpan = class BaseSpan {
|
|
|
3550
3606
|
const hideOutput = this.traceState?.hideOutput ?? false;
|
|
3551
3607
|
const nestedUnderParent = this.traceState?.nestedUnderParent ?? false;
|
|
3552
3608
|
const links = validLinks(this.links);
|
|
3609
|
+
const correlation = this.getCorrelationContext();
|
|
3553
3610
|
return {
|
|
3554
3611
|
id: this.id,
|
|
3555
3612
|
traceId: this.traceId,
|
|
@@ -3569,6 +3626,8 @@ var BaseSpan = class BaseSpan {
|
|
|
3569
3626
|
isEvent: this.isEvent,
|
|
3570
3627
|
isRootSpan: this.isRootSpan,
|
|
3571
3628
|
...this.isInternal ? { isInternal: true } : {},
|
|
3629
|
+
...correlation.entityVersionId ? { entityVersionId: correlation.entityVersionId } : {},
|
|
3630
|
+
...definedLineage(correlation),
|
|
3572
3631
|
parentSpanId: this.getParentSpanId(includeInternalSpans),
|
|
3573
3632
|
externalParentSpanId: this.getExportedExternalParentSpanId(includeInternalSpans),
|
|
3574
3633
|
...nestedUnderParent ? { nestedUnderParent: true } : {},
|
|
@@ -3580,6 +3639,7 @@ var BaseSpan = class BaseSpan {
|
|
|
3580
3639
|
snapshot() {
|
|
3581
3640
|
return {
|
|
3582
3641
|
...this.exportSpan(),
|
|
3642
|
+
ownEntityVersionId: this.ownEntityVersionId ?? null,
|
|
3583
3643
|
...this.traceState ? { traceState: this.traceState } : {}
|
|
3584
3644
|
};
|
|
3585
3645
|
}
|
|
@@ -3611,8 +3671,7 @@ var BaseSpan = class BaseSpan {
|
|
|
3611
3671
|
return fn();
|
|
3612
3672
|
}
|
|
3613
3673
|
};
|
|
3614
|
-
|
|
3615
|
-
//#region src/spans/default.ts
|
|
3674
|
+
// src/spans/default.ts
|
|
3616
3675
|
/** Every AI SDK `APICallError` (v4, v5 and v6) carries this shared marker symbol. */
|
|
3617
3676
|
const API_CALL_ERROR_MARKER = Symbol.for("vercel.ai.error.AI_APICallError");
|
|
3618
3677
|
function isApiCallError(value) {
|
|
@@ -3803,8 +3862,7 @@ function getOrCreateTraceId(options) {
|
|
|
3803
3862
|
}
|
|
3804
3863
|
return generateTraceId();
|
|
3805
3864
|
}
|
|
3806
|
-
|
|
3807
|
-
//#region src/spans/no-op.ts
|
|
3865
|
+
// src/spans/no-op.ts
|
|
3808
3866
|
var NoOpSpan = class extends BaseSpan {
|
|
3809
3867
|
id;
|
|
3810
3868
|
traceId;
|
|
@@ -3823,8 +3881,7 @@ var NoOpSpan = class extends BaseSpan {
|
|
|
3823
3881
|
return true;
|
|
3824
3882
|
}
|
|
3825
3883
|
};
|
|
3826
|
-
|
|
3827
|
-
//#region src/exporters/base.ts
|
|
3884
|
+
// src/exporters/base.ts
|
|
3828
3885
|
/**
|
|
3829
3886
|
* Base Exporter for Observability
|
|
3830
3887
|
*
|
|
@@ -3986,8 +4043,7 @@ var BaseExporter = class {
|
|
|
3986
4043
|
this.logger.info(`${this.name} shutdown complete`);
|
|
3987
4044
|
}
|
|
3988
4045
|
};
|
|
3989
|
-
|
|
3990
|
-
//#region src/exporters/event-buffer.ts
|
|
4046
|
+
// src/exporters/event-buffer.ts
|
|
3991
4047
|
/**
|
|
3992
4048
|
* Buffers observability events (creates and updates) for batch flushing.
|
|
3993
4049
|
* Handles strategy-aware routing of tracing events and tracks created spans
|
|
@@ -4138,8 +4194,7 @@ var EventBuffer = class {
|
|
|
4138
4194
|
});
|
|
4139
4195
|
}
|
|
4140
4196
|
};
|
|
4141
|
-
|
|
4142
|
-
//#region src/exporters/default.ts
|
|
4197
|
+
// src/exporters/default.ts
|
|
4143
4198
|
/**
|
|
4144
4199
|
* Resolves the final tracing storage strategy based on config and observability store hints
|
|
4145
4200
|
*/
|
|
@@ -4577,8 +4632,7 @@ var DefaultExporter = class extends BaseExporter {
|
|
|
4577
4632
|
this.logger.info("DefaultExporter shutdown complete");
|
|
4578
4633
|
}
|
|
4579
4634
|
};
|
|
4580
|
-
|
|
4581
|
-
//#region src/exporters/mastra-storage.ts
|
|
4635
|
+
// src/exporters/mastra-storage.ts
|
|
4582
4636
|
/**
|
|
4583
4637
|
* Resolves the final tracing storage strategy based on config and observability store hints
|
|
4584
4638
|
*/
|
|
@@ -5015,8 +5069,7 @@ var MastraStorageExporter = class extends BaseExporter {
|
|
|
5015
5069
|
this.logger.info("MastraStorageExporter shutdown complete");
|
|
5016
5070
|
}
|
|
5017
5071
|
};
|
|
5018
|
-
|
|
5019
|
-
//#region src/instances/platform-policy.ts
|
|
5072
|
+
// src/instances/platform-policy.ts
|
|
5020
5073
|
const MASTRA_BUILT_IN_STORAGE_EXPORTER_NAMES = /* @__PURE__ */ new Set(["mastra-storage-exporter", "mastra-default-observability-exporter"]);
|
|
5021
5074
|
function isMastraPlatformDeployment() {
|
|
5022
5075
|
return Boolean(process.env.MASTRA_DEPLOYMENT_ID);
|
|
@@ -5024,8 +5077,7 @@ function isMastraPlatformDeployment() {
|
|
|
5024
5077
|
function isMastraBuiltInStorageExporter(exporter) {
|
|
5025
5078
|
return exporter instanceof MastraStorageExporter || exporter instanceof DefaultExporter || MASTRA_BUILT_IN_STORAGE_EXPORTER_NAMES.has(exporter.name);
|
|
5026
5079
|
}
|
|
5027
|
-
|
|
5028
|
-
//#region src/instances/base.ts
|
|
5080
|
+
// src/instances/base.ts
|
|
5029
5081
|
/**
|
|
5030
5082
|
* BaseObservability - Abstract base class for Observability implementations
|
|
5031
5083
|
*/
|
|
@@ -5211,6 +5263,7 @@ var BaseObservabilityInstance = class extends _mastra_core_base.MastraBase {
|
|
|
5211
5263
|
tracingPolicy: cached.isInternal ? { internal: _mastra_core_observability.InternalSpans.ALL } : void 0,
|
|
5212
5264
|
traceState: this.rebuildTraceState(cached)
|
|
5213
5265
|
});
|
|
5266
|
+
if (span instanceof BaseSpan) span.restoreEntityLineage(cached);
|
|
5214
5267
|
this.wireSpanLifecycle(span);
|
|
5215
5268
|
return span;
|
|
5216
5269
|
}
|
|
@@ -5737,13 +5790,11 @@ var BaseObservabilityInstance = class extends _mastra_core_base.MastraBase {
|
|
|
5737
5790
|
this.logger.info(`[Observability] Shutdown completed [name=${this.name}]`);
|
|
5738
5791
|
}
|
|
5739
5792
|
};
|
|
5740
|
-
|
|
5741
|
-
//#region src/client/id.ts
|
|
5793
|
+
// src/client/id.ts
|
|
5742
5794
|
function generateClientSignalId() {
|
|
5743
5795
|
return globalThis.crypto.randomUUID();
|
|
5744
5796
|
}
|
|
5745
|
-
|
|
5746
|
-
//#region src/client/otlp.ts
|
|
5797
|
+
// src/client/otlp.ts
|
|
5747
5798
|
/**
|
|
5748
5799
|
* Hand-rolled OTLP/JSON decoder for the subset we need to ingest from
|
|
5749
5800
|
* client-side tool execution.
|
|
@@ -5931,8 +5982,7 @@ function buildExportedLog(decoded) {
|
|
|
5931
5982
|
data: decoded.attributes
|
|
5932
5983
|
};
|
|
5933
5984
|
}
|
|
5934
|
-
|
|
5935
|
-
//#region src/client/w3c.ts
|
|
5985
|
+
// src/client/w3c.ts
|
|
5936
5986
|
/**
|
|
5937
5987
|
* Hand-rolled W3C Trace Context and Baggage propagation.
|
|
5938
5988
|
*
|
|
@@ -6003,8 +6053,7 @@ function formatBaggage(entries) {
|
|
|
6003
6053
|
}
|
|
6004
6054
|
return parts.join(",");
|
|
6005
6055
|
}
|
|
6006
|
-
|
|
6007
|
-
//#region src/client/proxy.ts
|
|
6056
|
+
// src/client/proxy.ts
|
|
6008
6057
|
const DEFAULT_LIMITS = {
|
|
6009
6058
|
maxSpans: 10,
|
|
6010
6059
|
maxLogs: 10,
|
|
@@ -6142,8 +6191,7 @@ function validateParentLinks(spans, rootParent) {
|
|
|
6142
6191
|
function createClientObservabilityProxy(options) {
|
|
6143
6192
|
return new ClientObservabilityProxyImpl(options);
|
|
6144
6193
|
}
|
|
6145
|
-
|
|
6146
|
-
//#region src/exporters/tracking.ts
|
|
6194
|
+
// src/exporters/tracking.ts
|
|
6147
6195
|
/**
|
|
6148
6196
|
* TrackingExporter base class for vendor-specific observability exporters.
|
|
6149
6197
|
*
|
|
@@ -7224,8 +7272,7 @@ var TrackingExporter = class extends BaseExporter {
|
|
|
7224
7272
|
await super.shutdown();
|
|
7225
7273
|
}
|
|
7226
7274
|
};
|
|
7227
|
-
|
|
7228
|
-
//#region src/exporters/span-formatters.ts
|
|
7275
|
+
// src/exporters/span-formatters.ts
|
|
7229
7276
|
/**
|
|
7230
7277
|
* Chains multiple span formatters into a single formatter.
|
|
7231
7278
|
*
|
|
@@ -7262,8 +7309,7 @@ function chainFormatters(formatters) {
|
|
|
7262
7309
|
return currentSpan;
|
|
7263
7310
|
};
|
|
7264
7311
|
}
|
|
7265
|
-
|
|
7266
|
-
//#region src/exporters/auth-failure-cooldown.ts
|
|
7312
|
+
// src/exporters/auth-failure-cooldown.ts
|
|
7267
7313
|
const AUTH_FAILURE_STATUSES = /* @__PURE__ */ new Set([401, 403]);
|
|
7268
7314
|
const AUTH_COOLDOWN_BASE_MS = 6e4;
|
|
7269
7315
|
const AUTH_COOLDOWN_MAX_MS = 9e5;
|
|
@@ -7344,8 +7390,7 @@ var AuthFailureCooldown = class {
|
|
|
7344
7390
|
});
|
|
7345
7391
|
}
|
|
7346
7392
|
};
|
|
7347
|
-
|
|
7348
|
-
//#region src/exporters/cloud.ts
|
|
7393
|
+
// src/exporters/cloud.ts
|
|
7349
7394
|
const SIGNAL_PUBLISH_SUFFIXES$1 = {
|
|
7350
7395
|
traces: "/spans/publish",
|
|
7351
7396
|
logs: "/logs/publish",
|
|
@@ -7765,8 +7810,7 @@ var CloudExporter = class extends BaseExporter {
|
|
|
7765
7810
|
this.logger.info("CloudExporter shutdown complete");
|
|
7766
7811
|
}
|
|
7767
7812
|
};
|
|
7768
|
-
|
|
7769
|
-
//#region src/exporters/console.ts
|
|
7813
|
+
// src/exporters/console.ts
|
|
7770
7814
|
var ConsoleExporter = class extends BaseExporter {
|
|
7771
7815
|
name = "tracing-console-exporter";
|
|
7772
7816
|
constructor(config = {}) {
|
|
@@ -7829,8 +7873,7 @@ var ConsoleExporter = class extends BaseExporter {
|
|
|
7829
7873
|
this.logger.info("ConsoleExporter shutdown");
|
|
7830
7874
|
}
|
|
7831
7875
|
};
|
|
7832
|
-
|
|
7833
|
-
//#region src/exporters/mastra-platform.ts
|
|
7876
|
+
// src/exporters/mastra-platform.ts
|
|
7834
7877
|
const SIGNAL_PUBLISH_SUFFIXES = {
|
|
7835
7878
|
traces: "/spans/publish",
|
|
7836
7879
|
logs: "/logs/publish",
|
|
@@ -8361,8 +8404,7 @@ var MastraPlatformExporter = class extends BaseExporter {
|
|
|
8361
8404
|
this.logger.info("MastraPlatformExporter shutdown complete");
|
|
8362
8405
|
}
|
|
8363
8406
|
};
|
|
8364
|
-
|
|
8365
|
-
//#region src/exporters/test.ts
|
|
8407
|
+
// src/exporters/test.ts
|
|
8366
8408
|
/**
|
|
8367
8409
|
* Test Exporter for Observability
|
|
8368
8410
|
*
|
|
@@ -9408,8 +9450,7 @@ var TestExporter = class extends BaseExporter {
|
|
|
9408
9450
|
* @deprecated Use `TestExporter` instead. This alias will be removed in a future version.
|
|
9409
9451
|
*/
|
|
9410
9452
|
const JsonExporter = TestExporter;
|
|
9411
|
-
|
|
9412
|
-
//#region src/instances/default.ts
|
|
9453
|
+
// src/instances/default.ts
|
|
9413
9454
|
var DefaultObservabilityInstance = class extends BaseObservabilityInstance {
|
|
9414
9455
|
constructor(config) {
|
|
9415
9456
|
super(config);
|
|
@@ -9418,8 +9459,7 @@ var DefaultObservabilityInstance = class extends BaseObservabilityInstance {
|
|
|
9418
9459
|
return new DefaultSpan(options, this);
|
|
9419
9460
|
}
|
|
9420
9461
|
};
|
|
9421
|
-
|
|
9422
|
-
//#region src/recorded.ts
|
|
9462
|
+
// src/recorded.ts
|
|
9423
9463
|
function nullToUndefined(value) {
|
|
9424
9464
|
return value ?? void 0;
|
|
9425
9465
|
}
|
|
@@ -9723,8 +9763,7 @@ function hydrateRecordedTrace(args) {
|
|
|
9723
9763
|
debugRecordedAnnotationUnavailable
|
|
9724
9764
|
});
|
|
9725
9765
|
}
|
|
9726
|
-
|
|
9727
|
-
//#region src/registry.ts
|
|
9766
|
+
// src/registry.ts
|
|
9728
9767
|
/**
|
|
9729
9768
|
* Registry for Observability instances.
|
|
9730
9769
|
*/
|
|
@@ -9813,8 +9852,7 @@ var ObservabilityRegistry = class {
|
|
|
9813
9852
|
return new Map(this.#instances);
|
|
9814
9853
|
}
|
|
9815
9854
|
};
|
|
9816
|
-
|
|
9817
|
-
//#region src/span_processors/sensitive-data-filter.ts
|
|
9855
|
+
// src/span_processors/sensitive-data-filter.ts
|
|
9818
9856
|
/**
|
|
9819
9857
|
* Maximum number of traces to keep indexed-redaction state for.
|
|
9820
9858
|
* Spans never signal trace completion, so state is evicted least-recently-used.
|
|
@@ -10024,8 +10062,7 @@ var SensitiveDataFilter = class {
|
|
|
10024
10062
|
this.traceStates.clear();
|
|
10025
10063
|
}
|
|
10026
10064
|
};
|
|
10027
|
-
|
|
10028
|
-
//#region src/default.ts
|
|
10065
|
+
// src/default.ts
|
|
10029
10066
|
/**
|
|
10030
10067
|
* Type guard to check if an object is a BaseObservability instance
|
|
10031
10068
|
*/
|
|
@@ -10360,8 +10397,7 @@ var Observability = class extends _mastra_core_base.MastraBase {
|
|
|
10360
10397
|
if (handlerResults.length > 0) await Promise.allSettled(handlerResults);
|
|
10361
10398
|
}
|
|
10362
10399
|
};
|
|
10363
|
-
|
|
10364
|
-
//#region src/features.ts
|
|
10400
|
+
// src/features.ts
|
|
10365
10401
|
/**
|
|
10366
10402
|
* Feature flags for @mastra/observability
|
|
10367
10403
|
*
|
|
@@ -10400,8 +10436,7 @@ var Observability = class extends _mastra_core_base.MastraBase {
|
|
|
10400
10436
|
* ```
|
|
10401
10437
|
*/
|
|
10402
10438
|
const observabilityFeatures = /* @__PURE__ */ new Set(["model-inference-span", "internal-usage-rollup"]);
|
|
10403
|
-
|
|
10404
|
-
//#region src/tracing-options.ts
|
|
10439
|
+
// src/tracing-options.ts
|
|
10405
10440
|
/**
|
|
10406
10441
|
* Builds TracingOptions by composing one or more updater functions.
|
|
10407
10442
|
*
|
|
@@ -10422,7 +10457,6 @@ const observabilityFeatures = /* @__PURE__ */ new Set(["model-inference-span", "
|
|
|
10422
10457
|
function buildTracingOptions(...updaters) {
|
|
10423
10458
|
return updaters.reduce((opts, updater) => updater(opts), {});
|
|
10424
10459
|
}
|
|
10425
|
-
//#endregion
|
|
10426
10460
|
exports.BaseExporter = BaseExporter;
|
|
10427
10461
|
exports.BaseObservabilityEventBus = BaseObservabilityEventBus;
|
|
10428
10462
|
exports.BaseObservabilityInstance = BaseObservabilityInstance;
|