@mastra/server 1.75.0-alpha.2 → 1.75.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/{api-schema-manifest-D9_jxxNw.cjs → api-schema-manifest-BmNlBOvP.cjs} +2 -2
- package/dist/{api-schema-manifest-D9_jxxNw.cjs.map → api-schema-manifest-BmNlBOvP.cjs.map} +1 -1
- package/dist/{api-schema-manifest-B0p6nxU1.js → api-schema-manifest-Bsnp8kpD.js} +2 -2
- package/dist/{api-schema-manifest-B0p6nxU1.js.map → api-schema-manifest-Bsnp8kpD.js.map} +1 -1
- package/dist/{dist-5xXLv6KR.js → dist-BFUX7iPi.js} +67 -41
- package/dist/dist-BFUX7iPi.js.map +1 -0
- package/dist/{dist-B6rOIYr_.cjs → dist-DgDFoIF5.cjs} +67 -41
- package/dist/dist-DgDFoIF5.cjs.map +1 -0
- package/dist/docs/SKILL.md +2 -2
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-observability-tracing-trace-query.md +113 -2
- package/dist/{observability-new-endpoints-lNC3o66-.js → observability-new-endpoints-DQuhr8aL.js} +114 -4
- package/dist/observability-new-endpoints-DQuhr8aL.js.map +1 -0
- package/dist/{observability-new-endpoints-7Zd6uEZf.cjs → observability-new-endpoints-Kphyk3do.cjs} +118 -2
- package/dist/observability-new-endpoints-Kphyk3do.cjs.map +1 -0
- package/dist/{routes-CJygX0-a.js → routes--Al6ya95.js} +3 -2
- package/dist/routes--Al6ya95.js.map +1 -0
- package/dist/{routes-BuiLQCOQ.cjs → routes-CeYKJ-Re.cjs} +3 -2
- package/dist/routes-CeYKJ-Re.cjs.map +1 -0
- package/dist/server/handlers/agent-builder.cjs +1 -1
- package/dist/server/handlers/agent-builder.js +1 -1
- package/dist/server/handlers/observability-new-endpoints.cjs +2 -1
- package/dist/server/handlers/observability-new-endpoints.d.ts +260 -0
- package/dist/server/handlers/observability-new-endpoints.d.ts.map +1 -1
- package/dist/server/handlers/observability-new-endpoints.js +2 -2
- package/dist/server/handlers/observability-shared.cjs +19 -0
- package/dist/server/handlers/observability-shared.cjs.map +1 -1
- package/dist/server/handlers/observability-shared.d.ts +10 -0
- package/dist/server/handlers/observability-shared.d.ts.map +1 -1
- package/dist/server/handlers/observability-shared.js +18 -1
- package/dist/server/handlers/observability-shared.js.map +1 -1
- package/dist/server/handlers/observability.cjs +3 -1
- package/dist/server/handlers/observability.cjs.map +1 -1
- package/dist/server/handlers/observability.js +3 -2
- package/dist/server/handlers/observability.js.map +1 -1
- package/dist/server/handlers/system.cjs +2 -2
- package/dist/server/handlers/system.d.ts +2 -0
- package/dist/server/handlers/system.d.ts.map +1 -1
- package/dist/server/handlers/system.js +2 -2
- package/dist/server/schemas/index.cjs +1 -1
- package/dist/server/schemas/index.js +1 -1
- package/dist/server/schemas/system.d.ts +2 -0
- package/dist/server/schemas/system.d.ts.map +1 -1
- package/dist/server/server-adapter/index.cjs +1 -1
- package/dist/server/server-adapter/index.js +1 -1
- package/dist/server/server-adapter/routes/observability.d.ts +129 -0
- package/dist/server/server-adapter/routes/observability.d.ts.map +1 -1
- package/dist/server/server-adapter/routes/system.d.ts +2 -0
- package/dist/server/server-adapter/routes/system.d.ts.map +1 -1
- package/dist/{system-CskEzH1o.cjs → system-Be5n6H_z.cjs} +2 -1
- package/dist/system-Be5n6H_z.cjs.map +1 -0
- package/dist/{system-6qFm79mm.js → system-BtGAJr9R.js} +2 -1
- package/dist/system-BtGAJr9R.js.map +1 -0
- package/package.json +5 -5
- package/dist/dist-5xXLv6KR.js.map +0 -1
- package/dist/dist-B6rOIYr_.cjs.map +0 -1
- package/dist/observability-new-endpoints-7Zd6uEZf.cjs.map +0 -1
- package/dist/observability-new-endpoints-lNC3o66-.js.map +0 -1
- package/dist/routes-BuiLQCOQ.cjs.map +0 -1
- package/dist/routes-CJygX0-a.js.map +0 -1
- package/dist/system-6qFm79mm.js.map +0 -1
- package/dist/system-CskEzH1o.cjs.map +0 -1
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-server
|
|
|
3
3
|
description: Documentation for @mastra/server. Use when working with @mastra/server APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/server"
|
|
6
|
-
version: "1.75.0-alpha.
|
|
6
|
+
version: "1.75.0-alpha.4"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -24,7 +24,7 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
24
24
|
|
|
25
25
|
### Reference
|
|
26
26
|
|
|
27
|
-
- [Advanced trace queries](references/reference-observability-tracing-trace-query.md) - Query completed traces
|
|
27
|
+
- [Advanced trace queries](references/reference-observability-tracing-trace-query.md) - Query completed traces, thread identities, and spans with recursive predicates, numbered pages, keyset cursors, and delta polling.
|
|
28
28
|
- [Reference: createRoute()](references/reference-server-create-route.md) - Use createRoute() to define type-safe Mastra server routes with Zod validation for requests and responses, plus handler context and OpenAPI metadata.
|
|
29
29
|
- [Reference: MastraServer](references/reference-server-mastra-server.md) - The MastraServer abstract class is the base for all server adapters. Extend this class to create adapters for frameworks other than Hono or Express.
|
|
30
30
|
- [Reference: Server routes](references/reference-server-routes.md) - Server adapters register these routes when you call server.init(). All routes are prefixed with the prefix option if configured.
|
|
@@ -6,10 +6,121 @@
|
|
|
6
6
|
|
|
7
7
|
Use `queryTraces()` or `POST /api/observability/traces/query` to find completed logical traces that match trace fields and related span, score, or feedback records. Use `queryTraceThreads()` or `POST /api/observability/threads/query` to find thread identities that qualify across multiple eligible traces.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Use `querySpans()` or `POST /api/observability/spans/query` to list the individual completed spans that match a span predicate.
|
|
10
|
+
|
|
11
|
+
All three endpoints use the same authentication as other observability routes and require the `observability:read` permission. The configured observability store must support the requested trace-query, thread-query, or span-query operation.
|
|
10
12
|
|
|
11
13
|
> **Thread grouping is deprecated:** The `group` option remains supported until the next major release. Use [`queryTraceThreads()`](https://mastra.ai/reference/client-js/observability) to retrieve matching thread identities in new code.
|
|
12
14
|
|
|
15
|
+
## Query individual spans
|
|
16
|
+
|
|
17
|
+
`querySpans()` returns one row per matching completed span across traces, including matching child spans. Use it to list the spans themselves, for example every failed tool call in the last day.
|
|
18
|
+
|
|
19
|
+
`queryTraces()` with a `spans.some` predicate answers a different question. It returns the traces that contain at least one matching span, and it doesn't identify which spans matched. Both use the same span fields and operators.
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
const timeRange = {
|
|
23
|
+
from: '2026-10-01T00:00:00.000Z',
|
|
24
|
+
to: '2026-10-02T00:00:00.000Z',
|
|
25
|
+
}
|
|
26
|
+
const where = {
|
|
27
|
+
op: 'and',
|
|
28
|
+
args: [
|
|
29
|
+
{ op: 'eq', left: { path: 'spanType' }, right: { literal: 'tool_call' } },
|
|
30
|
+
{ op: 'eq', left: { path: 'status' }, right: { literal: 'error' } },
|
|
31
|
+
],
|
|
32
|
+
} as const
|
|
33
|
+
|
|
34
|
+
const firstPage = await mastraClient.querySpans({
|
|
35
|
+
timeRange,
|
|
36
|
+
where,
|
|
37
|
+
orderBy: [{ field: 'startedAt', direction: 'desc' }],
|
|
38
|
+
page: { limit: 50 },
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
if (firstPage.page.next) {
|
|
42
|
+
const secondPage = await mastraClient.querySpans({
|
|
43
|
+
timeRange,
|
|
44
|
+
where,
|
|
45
|
+
orderBy: [{ field: 'startedAt', direction: 'desc' }],
|
|
46
|
+
page: { limit: 50, after: firstPage.page.next },
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The HTTP route accepts the same body:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
curl --request POST \
|
|
55
|
+
--url http://localhost:4111/api/observability/spans/query \
|
|
56
|
+
--header 'Authorization: Bearer <token>' \
|
|
57
|
+
--header 'Content-Type: application/json' \
|
|
58
|
+
--data '{
|
|
59
|
+
"timeRange": {
|
|
60
|
+
"from": "2026-10-01T00:00:00.000Z",
|
|
61
|
+
"to": "2026-10-02T00:00:00.000Z"
|
|
62
|
+
},
|
|
63
|
+
"where": { "op": "eq", "left": { "path": "spanType" }, "right": { "literal": "tool_call" } },
|
|
64
|
+
"page": { "limit": 50 }
|
|
65
|
+
}'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Span queries are optional for observability stores. Call `mastraClient.getObservabilityCapabilities()` and check `capabilities.spanQuery` before showing a span list. Treat a missing `spanQuery` value as unsupported, because older servers don't report it. A server whose store or `@mastra/core` version doesn't support span queries returns `501` with code `SPAN_QUERY_UNSUPPORTED`.
|
|
69
|
+
|
|
70
|
+
The other statuses match trace queries: `400` for malformed JSON or a malformed cursor, `409` for a cursor that doesn't match the query, `413` for a body over 256 KiB, `422` with code `TRACE_QUERY_INVALID` and structured `issues` for an invalid query, `503` with code `TRACE_QUERY_RESOURCE_LIMIT` when a page exceeds a resource limit, and `504` with code `TRACE_QUERY_EXECUTION_TIMEOUT` when the database deadline is exceeded.
|
|
71
|
+
|
|
72
|
+
The server applies [trusted tenant scope](#trusted-tenant-scope) to span queries the same way it does for trace queries. A cursor created under one scope and reused under another returns `409`.
|
|
73
|
+
|
|
74
|
+
### Query individual spans through storage
|
|
75
|
+
|
|
76
|
+
The observability domain in DuckDB and the PostgreSQL and ClickHouse v-next stores supports `querySpans(plan)`. Check `storage.getFeatures()?.includes('span-query')` before using this optional storage method.
|
|
77
|
+
|
|
78
|
+
Build the plan in trusted backend code:
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
import { planSpanQuery } from '@mastra/core/storage'
|
|
82
|
+
|
|
83
|
+
const storage = await mastra.getStorage()?.getStore('observability')
|
|
84
|
+
if (!storage?.getFeatures()?.includes('span-query')) {
|
|
85
|
+
throw new Error('This store does not support span queries')
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const plan = planSpanQuery({
|
|
89
|
+
timeRange: {
|
|
90
|
+
from: '2026-10-01T00:00:00.000Z',
|
|
91
|
+
to: '2026-10-02T00:00:00.000Z',
|
|
92
|
+
},
|
|
93
|
+
where: {
|
|
94
|
+
op: 'eq',
|
|
95
|
+
left: { path: 'spanType' },
|
|
96
|
+
right: { literal: 'tool_call' },
|
|
97
|
+
},
|
|
98
|
+
page: { limit: 50 },
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
const { spans, page } = await storage.querySpans(plan)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This example uses local, unscoped storage. For a shared database, pass `{ scope: { organizationId, resourceId } }` as the second argument to `planSpanQuery()`, using identifiers resolved by your backend's authorization. The request body can't supply trusted scope. Apply the same authorization when loading full span details with `getSpan({ traceId, spanId })`.
|
|
105
|
+
|
|
106
|
+
Span queries use the scalar fields and operators available inside `queryTraces()`'s `spans.some` predicate. They don't accept related-record clauses. Nested attributes require support in the shared predicate contract and each store.
|
|
107
|
+
|
|
108
|
+
The `timeRange` applies to each span's `startedAt`, includes `from`, excludes `to`, and can cover at most 31 days. Sort by `startedAt` or `endedAt`, in either direction. The default is `startedAt` descending. A page contains up to 1,000 rows, with a default of 100. Pass `page.next` back as `page.after` with the same filters, time range, scope, and ordering. Cursors use scope and span identifiers to break timestamp ties. They aren't a snapshot across requests. New completions can appear when the view is refreshed.
|
|
109
|
+
|
|
110
|
+
Each row contains span and trace identifiers, display fields, duration, status, and input/output previews of at most 256 Unicode characters. Truncation flags indicate when a preview is incomplete. Stores select the page before loading previews and cost. Full payloads remain available through the existing span detail method.
|
|
111
|
+
|
|
112
|
+
The `cost` field describes only that span's model-token cost:
|
|
113
|
+
|
|
114
|
+
- `available` includes `amount` and `currency`. Zero is a valid amount.
|
|
115
|
+
- `missing` means no matching model metrics were found.
|
|
116
|
+
- `unavailable` means metrics exist but a complete, unambiguous cost can't be established.
|
|
117
|
+
|
|
118
|
+
Directional token totals supply the cost. Overlapping detail metrics aren't added again. A provider-supplied `query_total` cost is counted once. Partial pricing, conflicting currencies, and ambiguous totals produce `unavailable`.
|
|
119
|
+
|
|
120
|
+
Current-record selection runs before mutable filters. PostgreSQL and ClickHouse select the greatest completed `endedAt`. PostgreSQL breaks ties with its ingestion cursor. DuckDB reconstructs the earliest start event and selects the latest ingested completed event, matching its existing span-predicate behavior. Time bounds are checked again after reconstruction. ClickHouse uses its existing completion-only, insert-only model, where equal-version retries must contain identical records. Querying spans doesn't add a table or materialized view.
|
|
121
|
+
|
|
122
|
+
Queries have a 15-second default execution deadline. PostgreSQL and ClickHouse use their existing `traceQuery.timeoutMs` setting. ClickHouse also caps each query at 512 MiB. A page with more than 50,000 matching model metrics fails with a resource-limit error instead of returning partial cost. A small page size limits returned rows, but doesn't limit the number of records the database must examine.
|
|
123
|
+
|
|
13
124
|
## Query traces with the client SDK
|
|
14
125
|
|
|
15
126
|
Pass the query to `queryTraces()`:
|
|
@@ -718,7 +829,7 @@ PostgreSQL and ClickHouse stop advanced trace and thread queries after 15 second
|
|
|
718
829
|
|
|
719
830
|
## Limitations
|
|
720
831
|
|
|
721
|
-
|
|
832
|
+
Trace and thread queries consider completed traces only, and span queries consider completed spans only. They don't support running traces, custom projections, embedded evidence, summaries, aggregations, measures, or custom grouping. Numbered trace pages include a total count.
|
|
722
833
|
|
|
723
834
|
## Related
|
|
724
835
|
|
package/dist/{observability-new-endpoints-lNC3o66-.js → observability-new-endpoints-DQuhr8aL.js}
RENAMED
|
@@ -3,8 +3,8 @@ import { a as wrapSchemaForQueryParams, i as pickParams, n as createRoute } from
|
|
|
3
3
|
import { d as MASTRA_USER_ROLES_KEY, l as MASTRA_USER_KEY, m as isStudioClientTypeHeader } from "./constants-0jFCWoex.js";
|
|
4
4
|
import { handleError } from "./server/handlers/error.js";
|
|
5
5
|
import { paginationArgsSchema as paginationArgsSchema$1 } from "./server/handlers/observability-list-query-schemas.js";
|
|
6
|
-
import { NEW_ROUTE_DEFS, NO_OBSERVABILITY_STORAGE_CAPABILITIES, OBSERVABILITY_LIST_ENDPOINTS, OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_UPGRADE_MESSAGE, assertObservabilityDeltaSupported, assertObservabilityThreadQuerySupported, assertObservabilityTraceAggregateSupported, assertObservabilityTraceQueryContextIdsSupported, assertObservabilityTraceQueryDiscoverySupported, assertObservabilityTraceQueryRootDurationSupported, assertObservabilityTraceQuerySupported, assertObservabilityTraceQueryTenantScopeSupported, createObservabilityListQuerySchema, getObservabilityStorageCapabilities, getObservabilityStore, isTraceQueryContextIdField, supportsObservabilityTraceQueryContextIds, supportsObservabilityTraceQueryRootDuration, supportsTraceAggregateCore, supportsTraceQueryDiscoveryCore, withDiscoveryFallback } from "./server/handlers/observability-shared.js";
|
|
7
|
-
import { l as observabilityStorageCapabilitiesSchema } from "./system-
|
|
6
|
+
import { NEW_ROUTE_DEFS, NO_OBSERVABILITY_STORAGE_CAPABILITIES, OBSERVABILITY_LIST_ENDPOINTS, OBSERVABILITY_TRACE_QUERY_TENANT_SCOPE_UPGRADE_MESSAGE, assertObservabilityDeltaSupported, assertObservabilitySpanQuerySupported, assertObservabilityThreadQuerySupported, assertObservabilityTraceAggregateSupported, assertObservabilityTraceQueryContextIdsSupported, assertObservabilityTraceQueryDiscoverySupported, assertObservabilityTraceQueryRootDurationSupported, assertObservabilityTraceQuerySupported, assertObservabilityTraceQueryTenantScopeSupported, createObservabilityListQuerySchema, getObservabilityStorageCapabilities, getObservabilityStore, isTraceQueryContextIdField, supportsObservabilityTraceQueryContextIds, supportsObservabilityTraceQueryRootDuration, supportsSpanQueryCore, supportsTraceAggregateCore, supportsTraceQueryDiscoveryCore, withDiscoveryFallback } from "./server/handlers/observability-shared.js";
|
|
7
|
+
import { l as observabilityStorageCapabilitiesSchema } from "./system-BtGAJr9R.js";
|
|
8
8
|
import { prepareAuthorEnrichment } from "./server/handlers/author-enrichment.js";
|
|
9
9
|
import { getCallerPermissions } from "./server/handlers/authorship.js";
|
|
10
10
|
import { z } from "zod/v4";
|
|
@@ -1176,6 +1176,115 @@ if (AGGREGATE_TRACES.openapi) {
|
|
|
1176
1176
|
content: { "application/json": { schema: traceQueryTimeoutErrorSchema } }
|
|
1177
1177
|
};
|
|
1178
1178
|
}
|
|
1179
|
+
const spanQueryUnsupportedErrorSchema = z.object({
|
|
1180
|
+
code: z.literal("SPAN_QUERY_UNSUPPORTED"),
|
|
1181
|
+
message: z.string()
|
|
1182
|
+
}).strict();
|
|
1183
|
+
const spanQueryValidationError = (error) => ({
|
|
1184
|
+
status: 422,
|
|
1185
|
+
body: {
|
|
1186
|
+
code: "TRACE_QUERY_INVALID",
|
|
1187
|
+
message: "The span query is invalid",
|
|
1188
|
+
issues: error.issues.map((issue) => ({
|
|
1189
|
+
code: "invalid_request",
|
|
1190
|
+
path: issue.path.map((part) => typeof part === "symbol" ? String(part) : part),
|
|
1191
|
+
message: issue.message
|
|
1192
|
+
}))
|
|
1193
|
+
}
|
|
1194
|
+
});
|
|
1195
|
+
const QUERY_SPANS = createNewRoute(NEW_ROUTE_DEFS.QUERY_SPANS, {
|
|
1196
|
+
bodySchema: coreStorage.spanQueryRequestSchema,
|
|
1197
|
+
responseSchema: coreStorage.spanQueryResponseSchema,
|
|
1198
|
+
onValidationError: spanQueryValidationError,
|
|
1199
|
+
maxBodySize: 256 * 1024,
|
|
1200
|
+
preserveHttpExceptions: true,
|
|
1201
|
+
isCoreSupported: supportsSpanQueryCore,
|
|
1202
|
+
onUnsupportedCore: () => throwTraceQueryError(501, {
|
|
1203
|
+
code: "SPAN_QUERY_UNSUPPORTED",
|
|
1204
|
+
message: "Span queries require a newer @mastra/core. Please upgrade."
|
|
1205
|
+
}),
|
|
1206
|
+
handler: async ({ mastra, requestContext, timeRange, where, orderBy, page }) => {
|
|
1207
|
+
let plan;
|
|
1208
|
+
try {
|
|
1209
|
+
plan = coreStorage.planSpanQuery({
|
|
1210
|
+
timeRange,
|
|
1211
|
+
where,
|
|
1212
|
+
orderBy,
|
|
1213
|
+
page
|
|
1214
|
+
}, { scope: resolveTraceQueryScope(requestContext, "SPAN_QUERY_UNSUPPORTED") });
|
|
1215
|
+
} catch (error) {
|
|
1216
|
+
if (error instanceof coreStorage.TraceQueryValidationError) throwTraceQueryError(422, {
|
|
1217
|
+
code: error.code,
|
|
1218
|
+
message: "The span query is invalid",
|
|
1219
|
+
issues: error.issues
|
|
1220
|
+
});
|
|
1221
|
+
if (error instanceof coreStorage.TraceQueryCursorError) throwTraceQueryError(error.code === "TRACE_QUERY_CURSOR_CONFLICT" ? 409 : 400, {
|
|
1222
|
+
code: error.code,
|
|
1223
|
+
message: error.message
|
|
1224
|
+
});
|
|
1225
|
+
throw error;
|
|
1226
|
+
}
|
|
1227
|
+
let observabilityStore;
|
|
1228
|
+
try {
|
|
1229
|
+
observabilityStore = await getObservabilityStore(mastra);
|
|
1230
|
+
assertObservabilitySpanQuerySupported(observabilityStore);
|
|
1231
|
+
assertObservabilityTraceQueryTenantScopeSupported(observabilityStore, plan.scope);
|
|
1232
|
+
} catch (error) {
|
|
1233
|
+
if (error instanceof HTTPException && error.status === 501) throwTraceQueryError(501, {
|
|
1234
|
+
code: "SPAN_QUERY_UNSUPPORTED",
|
|
1235
|
+
message: error.message
|
|
1236
|
+
});
|
|
1237
|
+
throw error;
|
|
1238
|
+
}
|
|
1239
|
+
try {
|
|
1240
|
+
return await observabilityStore.querySpans(plan);
|
|
1241
|
+
} catch (error) {
|
|
1242
|
+
if (error instanceof coreStorage.TraceQueryCursorError) throwTraceQueryError(error.code === "TRACE_QUERY_CURSOR_CONFLICT" ? 409 : 400, {
|
|
1243
|
+
code: error.code,
|
|
1244
|
+
message: error.message
|
|
1245
|
+
});
|
|
1246
|
+
if (error instanceof coreStorage.TraceQueryResourceLimitError) throwTraceQueryError(503, {
|
|
1247
|
+
code: error.code,
|
|
1248
|
+
message: error.message
|
|
1249
|
+
});
|
|
1250
|
+
if (error instanceof coreStorage.TraceQueryExecutionError) throwTraceQueryError(504, {
|
|
1251
|
+
code: error.code,
|
|
1252
|
+
message: error.message
|
|
1253
|
+
});
|
|
1254
|
+
throw error;
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
if (QUERY_SPANS.openapi) {
|
|
1259
|
+
QUERY_SPANS.openapi.responses[400] = {
|
|
1260
|
+
description: "Malformed JSON or malformed cursor",
|
|
1261
|
+
content: { "application/json": { schema: z.union([traceQueryMalformedBodyErrorSchema, traceQueryMalformedCursorErrorSchema]) } }
|
|
1262
|
+
};
|
|
1263
|
+
QUERY_SPANS.openapi.responses[409] = {
|
|
1264
|
+
description: "Cursor does not match the normalized query",
|
|
1265
|
+
content: { "application/json": { schema: traceQueryCursorConflictErrorSchema } }
|
|
1266
|
+
};
|
|
1267
|
+
QUERY_SPANS.openapi.responses[413] = {
|
|
1268
|
+
description: "Request body exceeds 256 KiB",
|
|
1269
|
+
content: { "application/json": { schema: traceQueryBodyTooLargeErrorSchema } }
|
|
1270
|
+
};
|
|
1271
|
+
QUERY_SPANS.openapi.responses[422] = {
|
|
1272
|
+
description: "Structurally or semantically invalid span query",
|
|
1273
|
+
content: { "application/json": { schema: traceQueryValidationResponseSchema } }
|
|
1274
|
+
};
|
|
1275
|
+
QUERY_SPANS.openapi.responses[501] = {
|
|
1276
|
+
description: "The configured observability store does not support span queries",
|
|
1277
|
+
content: { "application/json": { schema: spanQueryUnsupportedErrorSchema } }
|
|
1278
|
+
};
|
|
1279
|
+
QUERY_SPANS.openapi.responses[503] = {
|
|
1280
|
+
description: "Span query exceeded a bounded execution resource limit",
|
|
1281
|
+
content: { "application/json": { schema: traceQueryResourceLimitErrorSchema } }
|
|
1282
|
+
};
|
|
1283
|
+
QUERY_SPANS.openapi.responses[504] = {
|
|
1284
|
+
description: "Span query exceeded the configured database execution timeout",
|
|
1285
|
+
content: { "application/json": { schema: traceQueryTimeoutErrorSchema } }
|
|
1286
|
+
};
|
|
1287
|
+
}
|
|
1179
1288
|
const GET_TRACE_QUERY_FIELDS = createNewRoute(NEW_ROUTE_DEFS.GET_TRACE_QUERY_FIELDS, {
|
|
1180
1289
|
bodySchema: coreStorage.getTraceQueryFieldsArgsSchema,
|
|
1181
1290
|
responseSchema: coreStorage.getTraceQueryFieldsResponseSchema,
|
|
@@ -1753,6 +1862,7 @@ const GET_CAPABILITIES = createRoute({
|
|
|
1753
1862
|
const NEW_ROUTES = {
|
|
1754
1863
|
QUERY_TRACES,
|
|
1755
1864
|
QUERY_THREADS,
|
|
1865
|
+
QUERY_SPANS,
|
|
1756
1866
|
LIST_LOGS,
|
|
1757
1867
|
LIST_SCORES,
|
|
1758
1868
|
CREATE_SCORE,
|
|
@@ -1786,6 +1896,6 @@ const NEW_ROUTES = {
|
|
|
1786
1896
|
GET_CAPABILITIES
|
|
1787
1897
|
};
|
|
1788
1898
|
//#endregion
|
|
1789
|
-
export { LIST_FEEDBACK as A, GET_SCORE_BREAKDOWN as C, GET_TAGS as D, GET_SERVICE_NAMES as E,
|
|
1899
|
+
export { LIST_FEEDBACK as A, GET_SCORE_BREAKDOWN as C, GET_TAGS as D, GET_SERVICE_NAMES as E, QUERY_SPANS as F, QUERY_THREADS as I, QUERY_TRACES as L, LIST_METRICS as M, LIST_SCORES as N, GET_TRACE_QUERY_FIELDS as O, NEW_ROUTES as P, UPDATE_FEEDBACK_REVIEW_STATUS as R, GET_SCORE_AGGREGATE as S, GET_SCORE_TIME_SERIES as T, GET_METRIC_LABEL_VALUES as _, DELETE_SCORES as a, GET_METRIC_TIME_SERIES as b, GET_ENTITY_TYPES as c, GET_FEEDBACK_BREAKDOWN as d, GET_FEEDBACK_PERCENTILES as f, GET_METRIC_LABEL_KEYS as g, GET_METRIC_BREAKDOWN as h, DELETE_FEEDBACK as i, LIST_LOGS as j, GET_TRACE_QUERY_VALUES as k, GET_ENVIRONMENTS as l, GET_METRIC_AGGREGATE as m, CREATE_FEEDBACK as n, GET_CAPABILITIES as o, GET_FEEDBACK_TIME_SERIES as p, CREATE_SCORE as r, GET_ENTITY_NAMES as s, AGGREGATE_TRACES as t, GET_FEEDBACK_AGGREGATE as u, GET_METRIC_NAMES as v, GET_SCORE_PERCENTILES as w, GET_SCORE as x, GET_METRIC_PERCENTILES as y };
|
|
1790
1900
|
|
|
1791
|
-
//# sourceMappingURL=observability-new-endpoints-
|
|
1901
|
+
//# sourceMappingURL=observability-new-endpoints-DQuhr8aL.js.map
|