{"record":{"id":"4038429e308a8979","repo":"mastra-ai/mastra","slug":"observability-storage-get-trace-not-implemented","errorCode":"OBSERVABILITY_STORAGE_GET_TRACE_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support getting traces","messagePattern":"This storage provider does not support getting traces","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":214,"sourceCode":"  }\n\n  /**\n   * Retrieves a single root span.\n   */\n  async getRootSpan(_args: GetRootSpanArgs): Promise<GetRootSpanResponse | null> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_ROOT_SPAN_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support getting root spans',\n    });\n  }\n\n  /**\n   * Retrieves a single trace with all its associated spans.\n   */\n  async getTrace(_args: GetTraceArgs): Promise<GetTraceResponse | null> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_TRACE_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support getting traces',\n    });\n  }\n\n  /**\n   * Retrieves the structural skeleton of a trace -- parent/child links, span\n   * type, timing, and status -- with heavy fields (input, output, attributes,\n   * metadata, tags, links) excluded. Intended for waterfall/timeline rendering\n   * where the full payload would be wasteful.\n   *\n   * Default implementation forwards to {@link getTraceLight} (the legacy\n   * override surface). Backends should override either method -- the response\n   * shape is identical, and the unimplemented one delegates to the\n   * implemented one. The cycle guard is what makes that safe.\n   */","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L196-L232","documentation":"getTrace() on the ObservabilityStorage base class throws unless the adapter overrides it. It fetches one trace with all its spans; throwing means the configured storage backend has no trace-read capability. Called internally by the trace accessor path.","triggerScenarios":"Calling storage.getObservability().getTrace({ traceId }) (directly or through the trace() helper / traces UI) against an adapter that kept the base-class default.","commonSituations":"Minimal in-memory or custom storage used in tests that only supports span export; adapters that implement AI/agent domains but not observability reads; version drift where an older adapter build predates getTrace.","solutions":["Switch to a storage backend that implements trace reads (libsql/pg/upstash/adapters that override getTrace).","If you maintain a custom adapter, implement getTrace() by fetching all spans WHERE traceId = ? and grouping them.","If only a span listing is needed and the backend implements it, use getSpans() or listTraces() instead.","Add a capability check before calling and return a clear 'traces unavailable' state in your app."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const supportsGetTrace = obs.getTrace !== ObservabilityStorage.prototype.getTrace;","typeGuard":"function supportsGetTrace(o: { getTrace: unknown }): o is { getTrace: (a: any) => Promise<any> } {\n  return o.getTrace !== (ObservabilityStorage.prototype as any).getTrace;\n}","tryCatchPattern":"try {\n  return await obs.getTrace({ traceId });\n} catch (e) {\n  if ((e as MastraError).id === 'OBSERVABILITY_STORAGE_GET_TRACE_NOT_IMPLEMENTED') {\n    return null;\n  }\n  throw e;\n}","preventionTips":["Choose adapters documented as supporting trace reads when you need trace inspection.","Run a smoke query (getTrace on a known trace) in your storage bootstrap.","Pin adapter versions that include observability read methods."],"tags":["storage","observability","tracing","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"}