{"record":{"id":"af40debfa6feef50","repo":"mastra-ai/mastra","slug":"observability-storage-get-structure-not-implemente","errorCode":"OBSERVABILITY_STORAGE_GET_STRUCTURE_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support getting trace structure","messagePattern":"This storage provider does not support getting trace structure","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":235,"sourceCode":"      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   */\n  async getStructure(args: GetTraceArgs): Promise<GetStructureResponse | null> {\n    if (this.getTraceLight === ObservabilityStorage.prototype.getTraceLight) {\n      throw new MastraError({\n        id: 'OBSERVABILITY_STORAGE_GET_STRUCTURE_NOT_IMPLEMENTED',\n        domain: ErrorDomain.MASTRA_OBSERVABILITY,\n        category: ErrorCategory.SYSTEM,\n        text: 'This storage provider does not support getting trace structure',\n      });\n    }\n    return this.getTraceLight(args);\n  }\n\n  /**\n   * @deprecated Use {@link getStructure} instead. Default implementation\n   * forwards to {@link getStructure} so backends that only override the\n   * canonical name still work for legacy callers.\n   */\n  async getTraceLight(args: GetTraceArgs): Promise<GetTraceLightResponse | null> {\n    if (this.getStructure === ObservabilityStorage.prototype.getStructure) {\n      throw new MastraError({\n        id: 'OBSERVABILITY_STORAGE_GET_TRACE_LIGHT_NOT_IMPLEMENTED',","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L217-L253","documentation":"getStructure() returns a lightweight tree/structure view of a trace. Its default base implementation only throws when the adapter also left getTraceLight() at the default: the two methods delegate to each other, so if neither is overridden the base class throws this error to signal the backend supports no structure surface at all.","triggerScenarios":"Calling getStructure({ traceId }) (or getTraceLight()/skeleton paths that delegate to it) on an adapter where BOTH getStructure and getTraceLight remain the ObservabilityStorage prototype defaults.","commonSituations":"Custom storage adapters that implement only full-trace reads (getTrace) and not the optimized structure endpoints; adapter versions from before the getStructure/getTraceLight pair was introduced; UI skeleton loading that assumes structure support.","solutions":["Override getStructure() (preferred, canonical name) in your storage adapter; getTraceLight will then forward to it automatically.","If full structure isn't needed, fall back to getTrace() and build the tree client-side from parentId links.","Upgrade the storage package to a version whose adapters implement getStructure.","Feature-detect with `adapter.getStructure !== ObservabilityStorage.prototype.getStructure` before calling."],"exampleFix":"// before\nclass MyStore extends ObservabilityStorage { /* only getTrace overridden */ }\n\n// after\nclass MyStore extends ObservabilityStorage {\n  async getStructure(args) {\n    const trace = await this.getTrace(args);\n    return trace ? toStructure(trace) : null;\n  }\n}","handlingStrategy":"type-guard","validationCode":"const supportsStructure = obs.getStructure !== ObservabilityStorage.prototype.getStructure;\nif (!supportsStructure) throw new Error('Storage adapter does not implement getStructure');","typeGuard":"function supportsStructure(o: { getStructure: unknown }): boolean {\n  return o.getStructure !== (ObservabilityStorage.prototype as any).getStructure;\n}","tryCatchPattern":"try {\n  return await obs.getStructure({ traceId });\n} catch (e) {\n  if ((e as MastraError).id === 'OBSERVABILITY_STORAGE_GET_STRUCTURE_NOT_IMPLEMENTED') {\n    const trace = await obs.getTrace({ traceId }).catch(() => null);\n    return trace ? toStructure(trace) : null;\n  }\n  throw e;\n}","preventionTips":["Override getStructure (the canonical name) in custom adapters — getTraceLight then works automatically.","Only one of getStructure/getTraceLight needs an override; implement exactly one.","Upgrade storage packages if structure endpoints return this error on a first-party adapter."],"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"}