@mastra/observability 1.2.1 → 1.3.0

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/LICENSE.md +15 -0
  3. package/README.md +62 -1
  4. package/dist/bus/base.d.ts +43 -0
  5. package/dist/bus/base.d.ts.map +1 -0
  6. package/dist/bus/index.d.ts +7 -0
  7. package/dist/bus/index.d.ts.map +1 -0
  8. package/dist/bus/observability-bus.d.ts +97 -0
  9. package/dist/bus/observability-bus.d.ts.map +1 -0
  10. package/dist/bus/route-event.d.ts +31 -0
  11. package/dist/bus/route-event.d.ts.map +1 -0
  12. package/dist/context/index.d.ts +6 -0
  13. package/dist/context/index.d.ts.map +1 -0
  14. package/dist/context/logger.d.ts +45 -0
  15. package/dist/context/logger.d.ts.map +1 -0
  16. package/dist/context/metrics.d.ts +47 -0
  17. package/dist/context/metrics.d.ts.map +1 -0
  18. package/dist/exporters/base.d.ts +11 -0
  19. package/dist/exporters/base.d.ts.map +1 -1
  20. package/dist/exporters/index.d.ts +0 -1
  21. package/dist/exporters/index.d.ts.map +1 -1
  22. package/dist/exporters/test.d.ts +538 -3
  23. package/dist/exporters/test.d.ts.map +1 -1
  24. package/dist/index.cjs +1165 -104
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.ts +3 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +1155 -101
  29. package/dist/index.js.map +1 -1
  30. package/dist/instances/base.d.ts +77 -10
  31. package/dist/instances/base.d.ts.map +1 -1
  32. package/dist/metrics/auto-extract.d.ts +47 -0
  33. package/dist/metrics/auto-extract.d.ts.map +1 -0
  34. package/dist/metrics/cardinality.d.ts +24 -0
  35. package/dist/metrics/cardinality.d.ts.map +1 -0
  36. package/dist/metrics/index.d.ts +6 -0
  37. package/dist/metrics/index.d.ts.map +1 -0
  38. package/package.json +6 -6
  39. package/dist/exporters/json.d.ts +0 -386
  40. package/dist/exporters/json.d.ts.map +0 -1
@@ -4,13 +4,24 @@
4
4
  import { MastraBase } from '@mastra/core/base';
5
5
  import type { RequestContext } from '@mastra/core/di';
6
6
  import type { IMastraLogger } from '@mastra/core/logger';
7
- import type { Span, SpanType, ObservabilityExporter, ObservabilityBridge, SpanOutputProcessor, TracingEvent, AnySpan, StartSpanOptions, CreateSpanOptions, ObservabilityInstance, CustomSamplerOptions, ExportedSpan, AnyExportedSpan, TraceState, TracingOptions } from '@mastra/core/observability';
7
+ import type { Span, ObservabilityExporter, ObservabilityBridge, SpanOutputProcessor, TracingEvent, AnySpan, StartSpanOptions, CreateSpanOptions, ObservabilityInstance, CustomSamplerOptions, ExportedSpan, AnyExportedSpan, TraceState, TracingOptions, LoggerContext, MetricsContext, ObservabilityEvent, SpanType } from '@mastra/core/observability';
8
+ import { ObservabilityBus } from '../bus/index.js';
8
9
  import type { ObservabilityInstanceConfig } from '../config.js';
10
+ import { CardinalityFilter } from '../metrics/cardinality.js';
9
11
  /**
10
12
  * Abstract base class for all Observability implementations in Mastra.
11
13
  */
12
14
  export declare abstract class BaseObservabilityInstance extends MastraBase implements ObservabilityInstance {
13
15
  protected config: ObservabilityInstanceConfig;
16
+ /**
17
+ * Unified event bus for all observability signals.
18
+ * Routes events to registered exporters based on event type.
19
+ */
20
+ protected observabilityBus: ObservabilityBus;
21
+ /**
22
+ * Cardinality filter for metrics label protection.
23
+ */
24
+ protected cardinalityFilter: CardinalityFilter;
14
25
  constructor(config: ObservabilityInstanceConfig);
15
26
  /**
16
27
  * Override setLogger to add Observability specific initialization log
@@ -79,6 +90,43 @@ export declare abstract class BaseObservabilityInstance extends MastraBase imple
79
90
  * Get the logger instance (for exporters and other components)
80
91
  */
81
92
  getLogger(): IMastraLogger;
93
+ /**
94
+ * Get the ObservabilityBus for this instance.
95
+ * The bus routes all observability events (tracing, logs, metrics, scores, feedback)
96
+ * to registered exporters based on event type.
97
+ */
98
+ getObservabilityBus(): ObservabilityBus;
99
+ /**
100
+ * Extract entity context labels from a span's entity hierarchy by
101
+ * walking the parent chain.
102
+ *
103
+ * Returns labels for: entity_type/name, parent_type/name, root_type/name.
104
+ * Internal spans are skipped when resolving parent and root entities.
105
+ */
106
+ private extractEntityLabels;
107
+ /**
108
+ * Resolve tags for a span. Uses the span's own tags if present,
109
+ * otherwise walks to the root span to inherit its tags.
110
+ */
111
+ private resolveSpanTags;
112
+ /**
113
+ * Get a LoggerContext correlated to a span.
114
+ * Called by the context-factory in core (deriveLoggerContext) so that
115
+ * `observabilityContext.loggerVNext` is a real logger instead of no-op.
116
+ */
117
+ getLoggerContext(span?: AnySpan): LoggerContext;
118
+ /**
119
+ * Get a MetricsContext, optionally tagged from a span's entity info.
120
+ * Called by the context-factory in core (deriveMetricsContext) so that
121
+ * `observabilityContext.metrics` is a real metrics context instead of no-op.
122
+ */
123
+ getMetricsContext(span?: AnySpan): MetricsContext;
124
+ /**
125
+ * Emit any observability event through the bus.
126
+ * The bus routes the event to the appropriate handler on each registered exporter,
127
+ * and for tracing events triggers auto-extracted metrics.
128
+ */
129
+ protected emitObservabilityEvent(event: ObservabilityEvent): void;
82
130
  /**
83
131
  * Automatically wires up Observability lifecycle events for any span
84
132
  * This ensures all spans emit events regardless of implementation
@@ -106,19 +154,36 @@ export declare abstract class BaseObservabilityInstance extends MastraBase imple
106
154
  private processSpan;
107
155
  getSpanForExport(span: AnySpan): AnyExportedSpan | undefined;
108
156
  /**
109
- * Emit a span started event
157
+ * Emit a span started event.
158
+ * Routes through the ObservabilityBus so exporters receive it via onTracingEvent
159
+ * and auto-extracted metrics are generated.
110
160
  */
111
161
  protected emitSpanStarted(span: AnySpan): void;
112
162
  /**
113
- * Emit a span ended event (called automatically when spans end)
163
+ * Emit a span ended event (called automatically when spans end).
164
+ * Routes through the ObservabilityBus so exporters receive it via onTracingEvent
165
+ * and auto-extracted metrics are generated.
114
166
  */
115
167
  protected emitSpanEnded(span: AnySpan): void;
116
168
  /**
117
- * Emit a span updated event
169
+ * Emit a span updated event.
170
+ * Routes through the ObservabilityBus so exporters receive it via onTracingEvent
171
+ * and auto-extracted metrics are generated.
118
172
  */
119
173
  protected emitSpanUpdated(span: AnySpan): void;
120
174
  /**
121
- * Export tracing event through all exporters and bridge (realtime mode)
175
+ * Emit a tracing event through the bus.
176
+ *
177
+ * The bus routes the event to each registered exporter's and bridge's
178
+ * onTracingEvent handler and triggers auto-extracted metrics (e.g.,
179
+ * mastra_agent_runs_started, mastra_model_duration_ms).
180
+ */
181
+ private emitTracingEvent;
182
+ /**
183
+ * Export tracing event through all exporters and bridge.
184
+ *
185
+ * @deprecated Prefer emitTracingEvent() which routes through the bus.
186
+ * Kept for backward compatibility with subclasses that may override it.
122
187
  */
123
188
  protected exportTracingEvent(event: TracingEvent): Promise<void>;
124
189
  /**
@@ -126,12 +191,14 @@ export declare abstract class BaseObservabilityInstance extends MastraBase imple
126
191
  */
127
192
  init(): void;
128
193
  /**
129
- * Force flush any buffered/queued spans from all exporters and the bridge
130
- * without shutting down the observability instance.
194
+ * Flush all observability data: awaits in-flight handler promises, then
195
+ * drains exporter and bridge SDK-internal buffers.
196
+ *
197
+ * Delegates to ObservabilityBus.flush() which owns the two-phase logic.
131
198
  *
132
- * This is useful in serverless environments (like Vercel's fluid compute) where
133
- * you need to ensure all spans are exported before the runtime instance is
134
- * terminated, while keeping the observability system active for future requests.
199
+ * This is critical for durable execution engines (e.g., Inngest) where
200
+ * the process may be interrupted after a step completes. Calling flush()
201
+ * outside the durable step ensures all span data reaches external systems.
135
202
  */
136
203
  flush(): Promise<void>;
137
204
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/instances/base.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB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AG,SAAS,EACjD,UAAU,EAAE,UAAU,GAAG,SAAS,GACjC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS;IAkBlC;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IA2B1F;;OAEG;IACH,OAAO,CAAC,WAAW;IAqBnB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,GAAG,SAAS;IAQ5D;;;;OAIG;IACH,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAQ9C;;;;OAIG;IACH,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAQ5C;;;;OAIG;IACH,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAQ9C;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;;;OAKG;cACa,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BtE;;OAEG;IACH,IAAI,IAAI,IAAI;IASZ;;;;;;;;;OASG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAyBhC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * AutoExtractedMetrics - Converts TracingEvent, ScoreEvent, and FeedbackEvent
3
+ * into MetricEvents automatically.
4
+ *
5
+ * Cross-emission pattern: When a tracing span ends, this class emits
6
+ * metric events for agent runs, tool calls, workflow runs, and model
7
+ * generation stats (including token usage).
8
+ */
9
+ import type { TracingEvent, ScoreEvent, FeedbackEvent } from '@mastra/core/observability';
10
+ import type { ObservabilityBus } from '../bus/index.js';
11
+ import type { CardinalityFilter } from './cardinality.js';
12
+ export declare class AutoExtractedMetrics {
13
+ private observabilityBus;
14
+ private cardinalityFilter?;
15
+ /**
16
+ * @param observabilityBus - Bus used to emit derived MetricEvents.
17
+ * @param cardinalityFilter - Optional filter applied to metric labels before emission.
18
+ */
19
+ constructor(observabilityBus: ObservabilityBus, cardinalityFilter?: CardinalityFilter | undefined);
20
+ /**
21
+ * Route a tracing event to the appropriate span lifecycle handler.
22
+ * SPAN_STARTED increments a started counter; SPAN_ENDED emits ended counter,
23
+ * duration histogram, and (for model spans) token counters.
24
+ */
25
+ processTracingEvent(event: TracingEvent): void;
26
+ /** Emit a `mastra_scores_total` counter for a score event. */
27
+ processScoreEvent(event: ScoreEvent): void;
28
+ /** Emit a `mastra_feedback_total` counter for a feedback event. */
29
+ processFeedbackEvent(event: FeedbackEvent): void;
30
+ /** Emit a started counter (e.g. `mastra_agent_runs_started`) for the span type. */
31
+ private onSpanStarted;
32
+ /** Emit ended counter, duration histogram, and token counters (for model spans). */
33
+ private onSpanEnded;
34
+ /** Build base metric labels from a span's entity and model attributes. */
35
+ private extractLabels;
36
+ /** Emit token usage counters from a MODEL_GENERATION span's `usage` attributes. Negative and non-finite values are skipped. */
37
+ private extractTokenMetrics;
38
+ /** Map a span type to its `*_started` counter metric name, or `null` for unsupported types. */
39
+ private getStartedMetricName;
40
+ /** Map a span type to its `*_ended` counter metric name, or `null` for unsupported types. */
41
+ private getEndedMetricName;
42
+ /** Map a span type to its `*_duration_ms` histogram metric name, or `null` for unsupported types. */
43
+ private getDurationMetricName;
44
+ /** Build an ExportedMetric, apply cardinality filtering, and emit it through the bus. */
45
+ private emit;
46
+ }
47
+ //# sourceMappingURL=auto-extract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-extract.d.ts","sourceRoot":"","sources":["../../src/metrics/auto-extract.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,aAAa,EAKd,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,qBAAa,oBAAoB;IAM7B,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,iBAAiB,CAAC;IAN5B;;;OAGG;gBAEO,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,CAAC,EAAE,iBAAiB,YAAA;IAG/C;;;;OAIG;IACH,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAW9C,8DAA8D;IAC9D,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAa1C,mEAAmE;IACnE,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAchD,mFAAmF;IACnF,OAAO,CAAC,aAAa;IAQrB,oFAAoF;IACpF,OAAO,CAAC,WAAW;IAkCnB,0EAA0E;IAC1E,OAAO,CAAC,aAAa;IAkBrB,+HAA+H;IAC/H,OAAO,CAAC,mBAAmB;IAyB3B,+FAA+F;IAC/F,OAAO,CAAC,oBAAoB;IAe5B,6FAA6F;IAC7F,OAAO,CAAC,kBAAkB;IAe1B,qGAAqG;IACrG,OAAO,CAAC,qBAAqB;IAe7B,yFAAyF;IACzF,OAAO,CAAC,IAAI;CAab"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * CardinalityFilter - Prevents metric cardinality explosion.
3
+ *
4
+ * Filters out high-cardinality labels (like trace_id, user_id) and
5
+ * optionally blocks UUID-like values in labels.
6
+ */
7
+ import type { CardinalityConfig } from '@mastra/core/observability';
8
+ export declare class CardinalityFilter {
9
+ private blockedLabels;
10
+ private blockUUIDs;
11
+ /**
12
+ * @param config - Optional configuration. When omitted, uses
13
+ * {@link DEFAULT_BLOCKED_LABELS} and blocks UUID-valued labels.
14
+ */
15
+ constructor(config?: CardinalityConfig);
16
+ /**
17
+ * Return a copy of `labels` with blocked keys and UUID values removed.
18
+ *
19
+ * @param labels - Raw metric labels to filter.
20
+ * @returns A new object containing only the allowed labels.
21
+ */
22
+ filterLabels(labels: Record<string, string>): Record<string, string>;
23
+ }
24
+ //# sourceMappingURL=cardinality.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cardinality.d.ts","sourceRoot":"","sources":["../../src/metrics/cardinality.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAMpE,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,aAAa,CAAc;IACnC,OAAO,CAAC,UAAU,CAAU;IAE5B;;;OAGG;gBACS,MAAM,CAAC,EAAE,iBAAiB;IAMtC;;;;;OAKG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAiBrE"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Metrics implementations for observability.
3
+ */
4
+ export { CardinalityFilter } from './cardinality.js';
5
+ export { AutoExtractedMetrics } from './auto-extract.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/metrics/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/observability",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "Core observability package for Mastra - includes tracing and scoring features",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -32,11 +32,11 @@
32
32
  "typescript": "^5.9.3",
33
33
  "vitest": "4.0.18",
34
34
  "zod": "^3.25.76",
35
- "@internal/lint": "0.0.61",
36
- "@internal/types-builder": "0.0.36",
37
- "@internal/ai-sdk-v4": "0.0.8",
38
- "@mastra/core": "1.6.0",
39
- "@internal/ai-sdk-v5": "0.0.8"
35
+ "@internal/types-builder": "0.0.39",
36
+ "@internal/ai-sdk-v4": "0.0.11",
37
+ "@internal/lint": "0.0.64",
38
+ "@internal/ai-sdk-v5": "0.0.11",
39
+ "@mastra/core": "1.9.0"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@mastra/core": ">=1.1.0-0 <2.0.0-0"
@@ -1,386 +0,0 @@
1
- /**
2
- * JSON Exporter for Observability Testing
3
- *
4
- * A full-featured exporter primarily designed for testing purposes that provides:
5
- * - In-memory event collection with JSON serialization
6
- * - File output support
7
- * - Span lifecycle tracking and validation
8
- * - Query methods for filtering spans by type, trace ID, span ID, etc.
9
- * - Statistics and analytics on collected spans
10
- */
11
- import type { TracingEvent, TracingEventType, AnyExportedSpan, ExportedSpan, SpanType } from '@mastra/core/observability';
12
- import { BaseExporter } from './base.js';
13
- import type { BaseExporterConfig } from './base.js';
14
- /**
15
- * Span state tracking for lifecycle validation
16
- */
17
- interface SpanState {
18
- /** Whether SPAN_STARTED was received */
19
- hasStart: boolean;
20
- /** Whether SPAN_ENDED was received */
21
- hasEnd: boolean;
22
- /** Whether SPAN_UPDATED was received */
23
- hasUpdate: boolean;
24
- /** All events for this span in order */
25
- events: TracingEvent[];
26
- /** Whether this is an event span (zero duration) */
27
- isEventSpan?: boolean;
28
- }
29
- /**
30
- * Statistics about collected spans
31
- */
32
- export interface JsonExporterStats {
33
- /** Total number of events collected */
34
- totalEvents: number;
35
- /** Number of unique spans */
36
- totalSpans: number;
37
- /** Number of unique traces */
38
- totalTraces: number;
39
- /** Number of completed spans */
40
- completedSpans: number;
41
- /** Number of incomplete spans (started but not ended) */
42
- incompleteSpans: number;
43
- /** Breakdown by event type */
44
- byEventType: {
45
- started: number;
46
- updated: number;
47
- ended: number;
48
- };
49
- /** Breakdown by span type */
50
- bySpanType: Record<string, number>;
51
- }
52
- /**
53
- * Span node in a tree structure with nested children
54
- */
55
- export interface SpanTreeNode {
56
- /** The span data */
57
- span: AnyExportedSpan;
58
- /** Child spans nested under this span */
59
- children: SpanTreeNode[];
60
- }
61
- /**
62
- * Normalized span data for snapshot testing.
63
- * Dynamic fields (IDs, timestamps) are replaced with stable values.
64
- */
65
- export interface NormalizedSpan {
66
- /** Stable ID like <span-1>, <span-2> */
67
- id: string;
68
- /** Normalized trace ID like <trace-1>, <trace-2> */
69
- traceId: string;
70
- /** Normalized parent ID, or undefined for root */
71
- parentId?: string;
72
- /** Span name */
73
- name: string;
74
- /** Span type */
75
- type: string;
76
- /** Entity type */
77
- entityType?: string;
78
- /** Entity ID */
79
- entityId?: string;
80
- /** Whether the span completed (had an endTime) */
81
- completed: boolean;
82
- /** Span attributes */
83
- attributes?: Record<string, unknown>;
84
- /** Span metadata */
85
- metadata?: Record<string, unknown>;
86
- /** Input data */
87
- input?: unknown;
88
- /** Output data */
89
- output?: unknown;
90
- /** Error info if span failed */
91
- errorInfo?: unknown;
92
- /** Is an event span */
93
- isEvent: boolean;
94
- /** Is root span */
95
- isRootSpan: boolean;
96
- /** Tags */
97
- tags?: string[];
98
- }
99
- /**
100
- * Normalized tree node for snapshot testing
101
- */
102
- export interface NormalizedTreeNode {
103
- /** Normalized span data */
104
- span: NormalizedSpan;
105
- /** Child nodes (omitted if empty) */
106
- children?: NormalizedTreeNode[];
107
- }
108
- /**
109
- * Incomplete span information for debugging
110
- */
111
- export interface IncompleteSpanInfo {
112
- spanId: string;
113
- span: AnyExportedSpan | undefined;
114
- state: {
115
- hasStart: boolean;
116
- hasUpdate: boolean;
117
- hasEnd: boolean;
118
- };
119
- }
120
- /**
121
- * Configuration for JsonExporter
122
- */
123
- export interface JsonExporterConfig extends BaseExporterConfig {
124
- /**
125
- * Whether to validate span lifecycles in real-time.
126
- * When true, will log warnings for lifecycle violations.
127
- * @default true
128
- */
129
- validateLifecycle?: boolean;
130
- /**
131
- * Whether to store verbose logs for debugging.
132
- * @default true
133
- */
134
- storeLogs?: boolean;
135
- /**
136
- * Indentation for JSON output (number of spaces, or undefined for compact).
137
- * @default 2
138
- */
139
- jsonIndent?: number;
140
- }
141
- /**
142
- * JSON Exporter for testing and debugging observability.
143
- *
144
- * Provides comprehensive span collection, querying, and JSON output capabilities
145
- * designed primarily for testing purposes but useful for debugging as well.
146
- *
147
- * @example
148
- * ```typescript
149
- * const exporter = new JsonExporter();
150
- *
151
- * // Use with Mastra
152
- * const mastra = new Mastra({
153
- * observability: {
154
- * configs: {
155
- * test: {
156
- * serviceName: 'test',
157
- * exporters: [exporter],
158
- * },
159
- * },
160
- * },
161
- * });
162
- *
163
- * // Run some operations...
164
- *
165
- * // Query spans
166
- * const agentSpans = exporter.getSpansByType('agent_run');
167
- * const traceSpans = exporter.getByTraceId('abc123');
168
- *
169
- * // Get statistics
170
- * const stats = exporter.getStatistics();
171
- *
172
- * // Export to JSON
173
- * await exporter.writeToFile('./traces.json');
174
- * const jsonString = exporter.toJSON();
175
- * ```
176
- */
177
- export declare class JsonExporter extends BaseExporter {
178
- #private;
179
- name: string;
180
- constructor(config?: JsonExporterConfig);
181
- /**
182
- * Process incoming tracing events with lifecycle tracking
183
- */
184
- protected _exportTracingEvent(event: TracingEvent): Promise<void>;
185
- /**
186
- * Get all collected events
187
- */
188
- get events(): TracingEvent[];
189
- /**
190
- * Get completed spans by SpanType (e.g., 'agent_run', 'tool_call')
191
- *
192
- * @param type - The SpanType to filter by
193
- * @returns Array of completed exported spans of the specified type
194
- */
195
- getSpansByType<T extends SpanType>(type: T): ExportedSpan<T>[];
196
- /**
197
- * Get events by TracingEventType (SPAN_STARTED, SPAN_UPDATED, SPAN_ENDED)
198
- *
199
- * @param type - The TracingEventType to filter by
200
- * @returns Array of events of the specified type
201
- */
202
- getByEventType(type: TracingEventType): TracingEvent[];
203
- /**
204
- * Get all events and spans for a specific trace
205
- *
206
- * @param traceId - The trace ID to filter by
207
- * @returns Object containing events and final spans for the trace
208
- */
209
- getByTraceId(traceId: string): {
210
- events: TracingEvent[];
211
- spans: AnyExportedSpan[];
212
- };
213
- /**
214
- * Get all events for a specific span
215
- *
216
- * @param spanId - The span ID to filter by
217
- * @returns Object containing events and final span state
218
- */
219
- getBySpanId(spanId: string): {
220
- events: TracingEvent[];
221
- span: AnyExportedSpan | undefined;
222
- state: SpanState | undefined;
223
- };
224
- /**
225
- * Get all unique spans (returns the final state of each span)
226
- */
227
- getAllSpans(): AnyExportedSpan[];
228
- /**
229
- * Get only completed spans (those that have received SPAN_ENDED)
230
- */
231
- getCompletedSpans(): AnyExportedSpan[];
232
- /**
233
- * Get root spans only (spans with no parent)
234
- */
235
- getRootSpans(): AnyExportedSpan[];
236
- /**
237
- * Get incomplete spans (started but not yet ended)
238
- */
239
- getIncompleteSpans(): IncompleteSpanInfo[];
240
- /**
241
- * Get unique trace IDs from all collected spans
242
- */
243
- getTraceIds(): string[];
244
- /**
245
- * Get comprehensive statistics about collected spans
246
- */
247
- getStatistics(): JsonExporterStats;
248
- /**
249
- * Serialize all collected data to JSON string
250
- *
251
- * @param options - Serialization options
252
- * @returns JSON string of all collected data
253
- */
254
- toJSON(options?: {
255
- indent?: number;
256
- includeEvents?: boolean;
257
- includeStats?: boolean;
258
- }): string;
259
- /**
260
- * Build a tree structure from spans, nesting children under their parents
261
- *
262
- * @returns Array of root span tree nodes (spans with no parent)
263
- */
264
- buildSpanTree(): SpanTreeNode[];
265
- /**
266
- * Serialize spans as a tree structure to JSON string
267
- *
268
- * @param options - Serialization options
269
- * @returns JSON string with spans nested in tree format
270
- */
271
- toTreeJSON(options?: {
272
- indent?: number;
273
- includeStats?: boolean;
274
- }): string;
275
- /**
276
- * Build a normalized tree structure suitable for snapshot testing.
277
- *
278
- * Normalizations applied:
279
- * - Span IDs replaced with stable placeholders (<span-1>, <span-2>, etc.)
280
- * - Trace IDs replaced with stable placeholders (<trace-1>, <trace-2>, etc.)
281
- * - parentSpanId replaced with normalized parent ID
282
- * - Timestamps replaced with durationMs (or null if not ended)
283
- * - Empty children arrays are omitted
284
- *
285
- * @returns Array of normalized root tree nodes
286
- */
287
- buildNormalizedTree(): NormalizedTreeNode[];
288
- /**
289
- * Generate an ASCII tree structure graph for debugging.
290
- * Shows span type and name in a hierarchical format.
291
- *
292
- * @param nodes - Normalized tree nodes (defaults to current normalized tree)
293
- * @returns Array of strings representing the tree structure
294
- *
295
- * @example
296
- * ```
297
- * agent_run: "agent run: 'test-agent'"
298
- * ├── processor_run: "input processor: validator"
299
- * │ └── agent_run: "agent run: 'validator-agent'"
300
- * └── model_generation: "llm: 'mock-model-id'"
301
- * ```
302
- */
303
- generateStructureGraph(nodes?: NormalizedTreeNode[]): string[];
304
- /**
305
- * Serialize spans as a normalized tree structure for snapshot testing.
306
- * Includes a __structure__ field with an ASCII tree graph for readability.
307
- *
308
- * @param options - Serialization options
309
- * @returns JSON string with normalized spans in tree format
310
- */
311
- toNormalizedTreeJSON(options?: {
312
- indent?: number;
313
- includeStructure?: boolean;
314
- }): string;
315
- /**
316
- * Write collected data to a JSON file
317
- *
318
- * @param filePath - Path to write the JSON file
319
- * @param options - Serialization options
320
- */
321
- writeToFile(filePath: string, options?: {
322
- indent?: number;
323
- includeEvents?: boolean;
324
- includeStats?: boolean;
325
- format?: 'flat' | 'tree' | 'normalized';
326
- }): Promise<void>;
327
- /**
328
- * Assert that the current normalized tree matches a snapshot file.
329
- * Throws an error with a diff if they don't match.
330
- *
331
- * The snapshot format includes:
332
- * - `__structure__`: ASCII tree graph (compared first for quick validation)
333
- * - `spans`: The normalized span tree (detailed comparison)
334
- *
335
- * Supports special markers in the snapshot:
336
- * - `{"__or__": ["value1", "value2"]}` - matches if actual equals any listed value
337
- * - `{"__any__": "string"}` - matches any string value
338
- * - `{"__any__": "number"}` - matches any number value
339
- * - `{"__any__": "boolean"}` - matches any boolean value
340
- * - `{"__any__": "object"}` - matches any object value
341
- * - `{"__any__": "array"}` - matches any array value
342
- * - `{"__any__": true}` - matches any non-null/undefined value
343
- *
344
- * Environment variables:
345
- * Use `{ updateSnapshot: true }` option to update the snapshot instead of comparing
346
- *
347
- * @param snapshotName - Name of the snapshot file (resolved relative to __snapshots__ directory)
348
- * @param options - Options for snapshot comparison
349
- * @param options.updateSnapshot - If true, update the snapshot file instead of comparing
350
- * @throws Error if the snapshot doesn't match (and updateSnapshot is false)
351
- */
352
- assertMatchesSnapshot(snapshotName: string, options?: {
353
- updateSnapshot?: boolean;
354
- }): Promise<void>;
355
- /**
356
- * Get all stored logs
357
- */
358
- getLogs(): string[];
359
- /**
360
- * Dump logs to console for debugging (uses console.error for visibility in test output)
361
- */
362
- dumpLogs(): void;
363
- /**
364
- * Validate final state - useful for test assertions
365
- *
366
- * @returns Object with validation results
367
- */
368
- validateFinalState(): {
369
- valid: boolean;
370
- singleTraceId: boolean;
371
- allSpansComplete: boolean;
372
- traceIds: string[];
373
- incompleteSpans: IncompleteSpanInfo[];
374
- };
375
- /**
376
- * Clear all collected events and state
377
- */
378
- clearEvents(): void;
379
- /**
380
- * Alias for clearEvents (compatibility with TestExporter)
381
- */
382
- reset(): void;
383
- shutdown(): Promise<void>;
384
- }
385
- export {};
386
- //# sourceMappingURL=json.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/exporters/json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA0BH,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,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,oDAA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