@mastra/observability 1.24.0-alpha.2 → 1.24.0-alpha.4

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/config.d.ts CHANGED
@@ -51,6 +51,17 @@ export interface ObservabilityInstanceConfig {
51
51
  sampling?: SamplingStrategy;
52
52
  /** Custom exporters */
53
53
  exporters?: ObservabilityExporter[];
54
+ /**
55
+ * Keep configured MastraStorageExporter instances on Mastra Platform deployments.
56
+ * Defaults to false: when MASTRA_DEPLOYMENT_ID is set, MastraStorageExporter
57
+ * and the deprecated DefaultExporter are skipped. Set to true to persist to
58
+ * your own storage alongside Platform observability. Applies to this instance,
59
+ * including exporters registered later; does not add an exporter automatically.
60
+ * Storage domains reporting local persistence remain disabled on Platform,
61
+ * with a warning during exporter initialization, even when this is true.
62
+ * The deprecated DefaultExporter remains disabled on Platform.
63
+ */
64
+ retainStorageExporterOnPlatform?: boolean;
54
65
  /** Observability bridge (e.g., OpenTelemetry bridge for context extraction) */
55
66
  bridge?: ObservabilityBridge;
56
67
  /** Custom span output processors */
@@ -193,6 +204,7 @@ export declare const observabilityInstanceConfigSchema: z.ZodObject<{
193
204
  sampler: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
194
205
  }, z.core.$strip>], "type">>;
195
206
  exporters: z.ZodOptional<z.ZodArray<z.ZodAny>>;
207
+ retainStorageExporterOnPlatform: z.ZodOptional<z.ZodBoolean>;
196
208
  bridge: z.ZodOptional<z.ZodAny>;
197
209
  spanOutputProcessors: z.ZodOptional<z.ZodArray<z.ZodAny>>;
198
210
  includeInternalSpans: z.ZodOptional<z.ZodBoolean>;
@@ -239,6 +251,7 @@ export declare const observabilityConfigValueSchema: z.ZodObject<{
239
251
  sampler: z.ZodCustom<(...args: any[]) => unknown, (...args: any[]) => unknown>;
240
252
  }, z.core.$strip>], "type">>;
241
253
  exporters: z.ZodOptional<z.ZodArray<z.ZodAny>>;
254
+ retainStorageExporterOnPlatform: z.ZodOptional<z.ZodBoolean>;
242
255
  bridge: z.ZodOptional<z.ZodAny>;
243
256
  spanOutputProcessors: z.ZodOptional<z.ZodArray<z.ZodAny>>;
244
257
  includeInternalSpans: z.ZodOptional<z.ZodBoolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,QAAQ,EACR,eAAe,EAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAMpE;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAMD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACzD;IAAE,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,oBAAoB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AC5C;;;;OAIG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE;QACR,iGAAiG;QACjG,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,iFAAiF;QACjF,KAAK,CAAC,EAAE,QAAQ,CAAC;KAClB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,0FAA0F;IAC1F,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,2BAA2B,EAAE,MAAM,CAAC,GAAG,qBAAqB,CAAC,CAAC;IAC5F,yEAAyE;IACzE,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;;;;;;;;;;;;;OAiBG;IACH,mBAAmB,CAAC,EAAE,OAAO,GAAG,0BAA0B,CAAC;CAC5D;AAMD;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;mCA7JO,GAAG,EAAE,KAAK,OAAO;2BA4KzD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;kBAO1B,CAAC;AAoCd;;;;GAIG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;uCAjOJ,GAAG,EAAE,KAAK,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgPxD,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;uCAtPD,GAAG,EAAE,KAAK,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgQ1D,CAAC;AAgBF,eAAO,MAAM,iCAAiC;;;;;wDAhRJ,GAAG,EAAE,KAAK,OAAO;;;;;;;;;;iBAsVxD,CAAC"}
@@ -3,7 +3,7 @@ name: mastra-observability
3
3
  description: Documentation for @mastra/observability. Use when working with @mastra/observability APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/observability"
6
- version: "1.24.0-alpha.2"
6
+ version: "1.24.0-alpha.4"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,11 +1,11 @@
1
1
  {
2
- "version": "1.24.0-alpha.2",
2
+ "version": "1.24.0-alpha.4",
3
3
  "package": "@mastra/observability",
4
4
  "exports": {
5
5
  "BaseExporter": {
6
6
  "types": "dist/exporters/base.d.ts",
7
7
  "implementation": "dist/index.js",
8
- "line": 4147
8
+ "line": 4249
9
9
  },
10
10
  "BaseObservabilityEventBus": {
11
11
  "types": "dist/bus/base.d.ts",
@@ -15,27 +15,27 @@
15
15
  "BaseObservabilityInstance": {
16
16
  "types": "dist/instances/base.d.ts",
17
17
  "implementation": "dist/index.js",
18
- "line": 5602
18
+ "line": 5725
19
19
  },
20
20
  "BaseSpan": {
21
21
  "types": "dist/spans/base.d.ts",
22
22
  "implementation": "dist/index.js",
23
- "line": 3433
23
+ "line": 3534
24
24
  },
25
25
  "CardinalityFilter": {
26
26
  "types": "dist/metrics/cardinality.d.ts",
27
27
  "implementation": "dist/index.js",
28
- "line": 2075
28
+ "line": 2076
29
29
  },
30
30
  "CloudExporter": {
31
31
  "types": "dist/exporters/cloud.d.ts",
32
32
  "implementation": "dist/index.js",
33
- "line": 8007
33
+ "line": 8144
34
34
  },
35
35
  "ConsoleExporter": {
36
36
  "types": "dist/exporters/console.d.ts",
37
37
  "implementation": "dist/index.js",
38
- "line": 8330
38
+ "line": 8467
39
39
  },
40
40
  "DEFAULT_DEEP_CLEAN_OPTIONS": {
41
41
  "types": "dist/spans/serialization.d.ts",
@@ -45,67 +45,67 @@
45
45
  "DEFAULT_LIMITS": {
46
46
  "types": "dist/client/proxy.d.ts",
47
47
  "implementation": "dist/index.js",
48
- "line": 6573
48
+ "line": 6710
49
49
  },
50
50
  "DefaultExporter": {
51
51
  "types": "dist/exporters/default.d.ts",
52
52
  "implementation": "dist/index.js",
53
- "line": 4529
53
+ "line": 4631
54
54
  },
55
55
  "DefaultObservabilityInstance": {
56
56
  "types": "dist/instances/default.d.ts",
57
57
  "implementation": "dist/index.js",
58
- "line": 10157
58
+ "line": 10294
59
59
  },
60
60
  "DefaultSpan": {
61
61
  "types": "dist/spans/default.d.ts",
62
62
  "implementation": "dist/index.js",
63
- "line": 3919
63
+ "line": 4020
64
64
  },
65
65
  "JsonExporter": {
66
66
  "types": "dist/exporters/test.d.ts",
67
67
  "implementation": "dist/index.js",
68
- "line": 10155
68
+ "line": 10292
69
69
  },
70
70
  "LoggerContextImpl": {
71
71
  "types": "dist/context/logger.d.ts",
72
72
  "implementation": "dist/index.js",
73
- "line": 937
73
+ "line": 938
74
74
  },
75
75
  "MastraPlatformExporter": {
76
76
  "types": "dist/exporters/mastra-platform.d.ts",
77
77
  "implementation": "dist/index.js",
78
- "line": 8625
78
+ "line": 8762
79
79
  },
80
80
  "MastraStorageExporter": {
81
81
  "types": "dist/exporters/mastra-storage.d.ts",
82
82
  "implementation": "dist/index.js",
83
- "line": 5038
83
+ "line": 5150
84
84
  },
85
85
  "MetricsContextImpl": {
86
86
  "types": "dist/context/metrics.d.ts",
87
87
  "implementation": "dist/index.js",
88
- "line": 1001
88
+ "line": 1002
89
89
  },
90
90
  "ModelSpanTracker": {
91
91
  "types": "dist/model-tracing.d.ts",
92
92
  "implementation": "dist/index.js",
93
- "line": 2507
93
+ "line": 2508
94
94
  },
95
95
  "NoOpSpan": {
96
96
  "types": "dist/spans/no-op.d.ts",
97
97
  "implementation": "dist/index.js",
98
- "line": 4090
98
+ "line": 4192
99
99
  },
100
100
  "OBSERVABILITY_CAPABILITIES_HEADER": {
101
101
  "types": "dist/exporters/mastra-platform.d.ts",
102
102
  "implementation": "dist/index.js",
103
- "line": 8526
103
+ "line": 8663
104
104
  },
105
105
  "Observability": {
106
106
  "types": "dist/default.d.ts",
107
107
  "implementation": "dist/index.js",
108
- "line": 10814
108
+ "line": 10951
109
109
  },
110
110
  "ObservabilityBus": {
111
111
  "types": "dist/bus/observability-bus.d.ts",
@@ -115,7 +115,7 @@
115
115
  "QUOTA_PAUSE_CAPABILITY": {
116
116
  "types": "dist/exporters/mastra-platform.d.ts",
117
117
  "implementation": "dist/index.js",
118
- "line": 8527
118
+ "line": 8664
119
119
  },
120
120
  "SamplingStrategyType": {
121
121
  "types": "dist/config.d.ts",
@@ -125,57 +125,57 @@
125
125
  "SensitiveDataFilter": {
126
126
  "types": "dist/span_processors/sensitive-data-filter.d.ts",
127
127
  "implementation": "dist/index.js",
128
- "line": 10584
128
+ "line": 10721
129
129
  },
130
130
  "TestExporter": {
131
131
  "types": "dist/exporters/test.d.ts",
132
132
  "implementation": "dist/index.js",
133
- "line": 9170
133
+ "line": 9307
134
134
  },
135
135
  "TraceData": {
136
136
  "types": "dist/exporters/tracking.d.ts",
137
137
  "implementation": "dist/index.js",
138
- "line": 6726
138
+ "line": 6863
139
139
  },
140
140
  "TrackingExporter": {
141
141
  "types": "dist/exporters/tracking.d.ts",
142
142
  "implementation": "dist/index.js",
143
- "line": 7055
143
+ "line": 7192
144
144
  },
145
145
  "buildExportedLog": {
146
146
  "types": "dist/client/otlp.d.ts",
147
147
  "implementation": "dist/index.js",
148
- "line": 6490
148
+ "line": 6627
149
149
  },
150
150
  "buildExportedSpan": {
151
151
  "types": "dist/client/otlp.d.ts",
152
152
  "implementation": "dist/index.js",
153
- "line": 6472
153
+ "line": 6609
154
154
  },
155
155
  "buildTracingOptions": {
156
156
  "types": "dist/tracing-options.d.ts",
157
157
  "implementation": "dist/index.js",
158
- "line": 11159
158
+ "line": 11296
159
159
  },
160
160
  "chainFormatters": {
161
161
  "types": "dist/exporters/span-formatters.d.ts",
162
162
  "implementation": "dist/index.js",
163
- "line": 7821
163
+ "line": 7958
164
164
  },
165
165
  "createClientObservabilityProxy": {
166
166
  "types": "dist/client/proxy.d.ts",
167
167
  "implementation": "dist/index.js",
168
- "line": 6707
168
+ "line": 6844
169
169
  },
170
170
  "decodeResourceLogs": {
171
171
  "types": "dist/client/otlp.d.ts",
172
172
  "implementation": "dist/index.js",
173
- "line": 6409
173
+ "line": 6546
174
174
  },
175
175
  "decodeResourceSpans": {
176
176
  "types": "dist/client/otlp.d.ts",
177
177
  "implementation": "dist/index.js",
178
- "line": 6372
178
+ "line": 6509
179
179
  },
180
180
  "deepClean": {
181
181
  "types": "dist/spans/serialization.d.ts",
@@ -185,17 +185,17 @@
185
185
  "formatBaggage": {
186
186
  "types": "dist/client/w3c.d.ts",
187
187
  "implementation": "dist/index.js",
188
- "line": 6563
188
+ "line": 6700
189
189
  },
190
190
  "formatTraceparent": {
191
191
  "types": "dist/client/w3c.d.ts",
192
192
  "implementation": "dist/index.js",
193
- "line": 6526
193
+ "line": 6663
194
194
  },
195
195
  "getExternalParentId": {
196
196
  "types": "dist/spans/base.d.ts",
197
197
  "implementation": "dist/index.js",
198
- "line": 3414
198
+ "line": 3515
199
199
  },
200
200
  "isSerializedMap": {
201
201
  "types": "dist/spans/serialization.d.ts",
@@ -210,37 +210,37 @@
210
210
  "observabilityConfigValueSchema": {
211
211
  "types": "dist/config.d.ts",
212
212
  "implementation": "dist/index.js",
213
- "line": 816
213
+ "line": 817
214
214
  },
215
215
  "observabilityFeatures": {
216
216
  "types": "dist/features.d.ts",
217
217
  "implementation": "dist/index.js",
218
- "line": 11140
218
+ "line": 11277
219
219
  },
220
220
  "observabilityInstanceConfigSchema": {
221
221
  "types": "dist/config.d.ts",
222
222
  "implementation": "dist/index.js",
223
- "line": 804
223
+ "line": 805
224
224
  },
225
225
  "observabilityRegistryConfigSchema": {
226
226
  "types": "dist/config.d.ts",
227
227
  "implementation": "dist/index.js",
228
- "line": 836
228
+ "line": 837
229
229
  },
230
230
  "otlpSeverityToLogLevel": {
231
231
  "types": "dist/client/otlp.d.ts",
232
232
  "implementation": "dist/index.js",
233
- "line": 6446
233
+ "line": 6583
234
234
  },
235
235
  "parseBaggage": {
236
236
  "types": "dist/client/w3c.d.ts",
237
237
  "implementation": "dist/index.js",
238
- "line": 6536
238
+ "line": 6673
239
239
  },
240
240
  "parseTraceparent": {
241
241
  "types": "dist/client/w3c.d.ts",
242
242
  "implementation": "dist/index.js",
243
- "line": 6512
243
+ "line": 6649
244
244
  },
245
245
  "reconstructSerializedMap": {
246
246
  "types": "dist/spans/serialization.d.ts",
@@ -74,6 +74,47 @@ export const mastra = new Mastra({
74
74
  })
75
75
  ```
76
76
 
77
+ ## Export to storage and Platform
78
+
79
+ On Mastra Platform, a nonempty `MASTRA_DEPLOYMENT_ID` disables `MastraStorageExporter` and the deprecated `DefaultExporter` by default. Other exporters remain enabled. The opt-in below applies only to `MastraStorageExporter`. Deprecated `DefaultExporter` stays disabled on Platform even with the flag set to `true`. Migrate to `MastraStorageExporter` to use this option.
80
+
81
+ > **Local storage remains blocked even with the opt-in:** `retainStorageExporterOnPlatform: true` **doesn't** enable in-memory, local libSQL, or DuckDB observability writes on Platform. When the observability domain reports local persistence, the built-in storage exporter stays disabled: it won't persist traces, logs, metrics, scores, or feedback to that database. Other exporters continue to receive events.
82
+
83
+ With updated adapters and `retainStorageExporterOnPlatform: true`, the behavior on Platform is:
84
+
85
+ | Observability database | Storage export on Platform |
86
+ | --------------------------------------------------------------------- | -------------------------------- |
87
+ | PostgreSQL | Allowed |
88
+ | Remote libSQL/Turso (`libsql://` or `https://`) | Allowed |
89
+ | Local libSQL (`file:` or `:memory:`) | Blocked |
90
+ | libSQL embedded replica with a remote sync URL | Blocked: it still writes locally |
91
+ | DuckDB, including in-memory databases | Blocked |
92
+ | `InMemoryStore`, including the fallback when no storage is configured | Blocked |
93
+
94
+ To keep writing to your own remote database alongside Platform observability, set [`retainStorageExporterOnPlatform`](https://mastra.ai/reference/observability/tracing/configuration) to `true` on the observability config:
95
+
96
+ ```typescript
97
+ import { Observability, MastraStorageExporter, MastraPlatformExporter } from '@mastra/observability'
98
+
99
+ const observability = new Observability({
100
+ configs: {
101
+ production: {
102
+ serviceName: 'my-service',
103
+ retainStorageExporterOnPlatform: true,
104
+ exporters: [new MastraStorageExporter(), new MastraPlatformExporter()],
105
+ },
106
+ },
107
+ })
108
+ ```
109
+
110
+ Pass this `observability` instance to `new Mastra()` alongside your configured `storage` provider. The option applies only to this config, including exporters registered later. It doesn't configure a database or add exporters automatically. Other configs keep the default suppression unless they also opt in.
111
+
112
+ The restriction applies to the **observability domain**, which can use a different provider from your default application storage. It doesn't disable other storage domains. Outside Platform, local observability storage continues to work.
113
+
114
+ To enable this guard, upgrade `@mastra/core` and any `@mastra/libsql` or `@mastra/duckdb` adapters alongside `@mastra/observability`: older or custom adapters without the `persistenceLocation` capability retain the existing opt-in behavior and aren't checked for local persistence.
115
+
116
+ A blocked exporter logs a warning during initialization, but the restriction applies even if your logging setup hides that warning. If dual export isn't writing to your database, check the observability provider against the table above and configure a remote database. Retrying or increasing the batch interval won't enable a blocked exporter.
117
+
77
118
  ## Studio
78
119
 
79
120
  Access your traces through Studio:
@@ -31,6 +31,7 @@ interface ObservabilityInstanceConfig {
31
31
  serviceName: string
32
32
  sampling?: SamplingStrategy
33
33
  exporters?: ObservabilityExporter[]
34
+ retainStorageExporterOnPlatform?: boolean
34
35
  spanOutputProcessors?: SpanOutputProcessor[]
35
36
  includeInternalSpans?: boolean
36
37
  excludeSpanTypes?: SpanType[]
@@ -49,6 +50,8 @@ interface ObservabilityInstanceConfig {
49
50
 
50
51
  **exporters** (`ObservabilityExporter[]`): Trace data exporters
51
52
 
53
+ **retainStorageExporterOnPlatform** (`boolean`): Defaults to false. Retains configured MastraStorageExporter instances on Platform, including later registration. Known local storage remains blocked, and deprecated DefaultExporter remains disabled. See storage export on Platform for configuration, adapter requirements, and restrictions.
54
+
52
55
  **spanOutputProcessors** (`SpanOutputProcessor[]`): Span output processors
53
56
 
54
57
  **includeInternalSpans** (`boolean`): Include spans internal to Mastra operations
@@ -8,6 +8,10 @@ Persists traces to Mastra's configured storage with automatic batching and retry
8
8
 
9
9
  > **Note:** `MastraStorageExporter` was previously called `DefaultExporter`. The original `DefaultExporter` class is still exported from `@mastra/observability` so existing imports keep working, but it's deprecated and will be removed in a future major version. New code should use `MastraStorageExporter`.
10
10
 
11
+ > **Platform storage restrictions:** When `MASTRA_DEPLOYMENT_ID` is set, this exporter is disabled by default. Set `retainStorageExporterOnPlatform: true` on the **observability config**, not the exporter constructor, to allow remote storage export. `InMemoryStore` (including the fallback when no storage is configured), local libSQL, embedded replicas, and DuckDB remain blocked when the adapter reports local persistence, even with the opt-in. No observability events are written to that local database, even if the initialization warning is hidden by your logging setup.
12
+ >
13
+ > See [storage export on Platform](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for the supported-provider table, adapter upgrade requirements, and a configuration example.
14
+
11
15
  ## Span previews
12
16
 
13
17
  `MastraStorageExporter` automatically generates short, readable `inputPreview`, `outputPreview`, and `errorPreview` summaries based on the span type. Each preview contains up to 100 characters plus an ellipsis when truncated. Full payloads remain available separately.
@@ -1 +1 @@
1
- {"version":3,"file":"mastra-storage.d.ts","sourceRoot":"","sources":["../../src/exporters/mastra-storage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,QAAQ,EACR,UAAU,EACV,aAAa,EAId,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAwB,sBAAsB,EAAwB,MAAM,sBAAsB,CAAC;AAS/G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAKtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClG,YAAY,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElG,4FAA4F;AAC5F,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACrE,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE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O,CAAC,eAAe;YAUT,iBAAiB;YA2DjB,iBAAiB;IAS/B;;OAEG;IACH,OAAO,CAAC,WAAW;IA0BnB;;OAEG;IACH,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,iBAAiB;IAiBzB;;;;OAIG;YACW,kBAAkB;IAahC,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,QAAQ;IAsBhB;;;;OAIG;YACW,YAAY;IAmC1B;;;;;;;;;;;OAWG;YACW,gBAAgB;IA4E9B;;;OAGG;IACH,OAAO,CAAC,cAAc;IAuBtB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAgCxB;;;;;;;OAOG;YACW,WAAW;IAoJzB,oBAAoB,IAAI,wBAAwB,GAAG,SAAS,CAE3D;IAEK,mBAAmB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAS5D;IAED;;OAEG;IACG,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrD;IAED;;OAEG;IACG,UAAU,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAM/C;IAED;;OAEG;IACG,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAMnD;IAED;;OAEG;IACG,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzD;IAED;;;;OAIG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CA0C3B;IAEK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CA6B9B;CACF"}
@@ -0,0 +1,8 @@
1
+ import type { IMastraLogger } from '@mastra/core/logger';
2
+ import type { ObservabilityStorage } from '@mastra/core/storage';
3
+ /**
4
+ * Check the resolved observability domain, not the composite store's default backend.
5
+ * Older or custom adapters without location metadata retain opt-in compatibility.
6
+ */
7
+ export declare function skipLocalStorageOnPlatform(storage: ObservabilityStorage, logger: IMastraLogger): boolean;
8
+ //# sourceMappingURL=storage-platform-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-platform-policy.d.ts","sourceRoot":"","sources":["../../src/exporters/storage-platform-policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAOxG"}