{"record":{"id":"2575c8c7f8a2ed5c","repo":"mastra-ai/mastra","slug":"observability-storage-list-traces-not-implemented","errorCode":"OBSERVABILITY_STORAGE_LIST_TRACES_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support listing traces","messagePattern":"This storage provider does not support listing traces","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":322,"sourceCode":"   * Batch-fetches spans by spanId within a single trace. Used by the\n   * optimized {@link getBranch} path to fetch only the spans that belong to\n   * the requested branch (after walking the lightweight structure to identify\n   * them) instead of pulling the entire trace.\n   */\n  async getSpans(_args: GetSpansArgs): Promise<GetSpansResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_SPANS_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support batch-fetching spans',\n    });\n  }\n\n  /**\n   * Retrieves a list of traces with optional filtering.\n   */\n  async listTraces(_args: ListTracesArgs): Promise<ListTracesResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_LIST_TRACES_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support listing traces',\n    });\n  }\n\n  /**\n   * Retrieves a lightweight list of traces with optional filtering.\n   *\n   * Defaults to {@link listTraces} with each row projected down, so every backend\n   * serves the same response shape whether or not it has a dedicated implementation.\n   * Backends that can push the projection into the query should override this --\n   * that is what actually keeps the blob columns off the read path -- but the\n   * fallback stays correct, just not cheaper than `listTraces`.\n   */\n  async listTracesLight(args: ListTracesArgs): Promise<ListTracesLightResponse> {\n    const { spans, ...rest } = await this.listTraces(args);","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L304-L340","documentation":"listTraces() retrieves traces with optional filtering (pagination, resource, attributes). The base class throws by default, so the error indicates the configured storage adapter implements no trace-listing capability. Used by trace listing UIs and the { spans, ...rest } aggregation paths.","triggerScenarios":"Calling storage.getObservability().listTraces(args) — e.g. the traces list page, a paginated query, or code aggregating spans plus trace metadata — on an adapter that kept the base default.","commonSituations":"Using a storage backend chosen only for workflow/memory persistence that lacks observability reads; custom test doubles for storage; adapters older than the observability read API.","solutions":["Switch to a storage adapter that overrides listTraces (libsql, PostgreSQL, upstash, etc.).","Implement listTraces() in your custom adapter (paginated SELECT over root/anchor spans).","If traces are exported to a dedicated backend (e.g. a telemetry vendor), query that system instead of Mastra storage.","Guard with a capability check and render an empty/disabled traces view instead of throwing."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const supportsListTraces = obs.listTraces !== ObservabilityStorage.prototype.listTraces;","typeGuard":"function supportsListTraces(o: { listTraces: unknown }): o is { listTraces: (a: any) => Promise<any> } {\n  return o.listTraces !== (ObservabilityStorage.prototype as any).listTraces;\n}","tryCatchPattern":"try {\n  return await obs.listTraces(args);\n} catch (e) {\n  if ((e as MastraError).id === 'OBSERVABILITY_STORAGE_LIST_TRACES_NOT_IMPLEMENTED') {\n    return { traces: [], total: 0 };\n  }\n  throw e;\n}","preventionTips":["Confirm trace-listing support before wiring a traces UI to a storage backend.","Feature-detect listTraces at server startup and surface a clear capability flag.","Export traces to a dedicated telemetry backend if your primary storage cannot list them."],"tags":["storage","observability","tracing","pagination","unsupported-operation"],"backgroundTag":"storage-provider-not-implemented","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}