{"record":{"id":"4b5540358f5fe52c","repo":"mastra-ai/mastra","slug":"observability-storage-get-trace-light-not-implemen","errorCode":"OBSERVABILITY_STORAGE_GET_TRACE_LIGHT_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support getting lightweight traces","messagePattern":"This storage provider does not support getting lightweight traces","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"warning","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":252,"sourceCode":"    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',\n        domain: ErrorDomain.MASTRA_OBSERVABILITY,\n        category: ErrorCategory.SYSTEM,\n        text: 'This storage provider does not support getting lightweight traces',\n      });\n    }\n    return this.getStructure(args);\n  }\n\n  /**\n   * Retrieves the subtree of spans rooted at a given span, optionally bounded\n   * to `depth` levels of descendants.\n   *\n   * Default implementation prefers a two-step path: fetch the lightweight\n   * structure to determine which spans belong to the branch, then batch-fetch\n   * only those with full data. This avoids pulling the entire trace when the\n   * branch is a small slice of a large trace. Backends that don't yet\n   * implement {@link getStructure} or {@link getSpans} fall back to fetching","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L234-L270","documentation":"getTraceLight() is the deprecated legacy name for the lightweight trace view; its default forwards to getStructure(). The base class throws this error only when the adapter also left getStructure() at the default — i.e. the backend implements neither lightweight-trace method. Migrate to getStructure().","triggerScenarios":"Calling getTraceLight({ traceId }) (legacy callers) on an adapter where BOTH getTraceLight and getStructure are the prototype defaults; any legacy UI/server route still using the deprecated name against an adapter without structure support.","commonSituations":"Old code paths written against getTraceLight before it was deprecated; third-party storage adapters that never implemented the lightweight endpoints; upgrading Mastra where callers must switch to getStructure.","solutions":["Replace getTraceLight() calls with getStructure() — the response shape is identical and it is the canonical method.","Use a storage adapter that overrides getStructure (then getTraceLight forwards automatically).","Override getStructure() in your custom adapter.","Fall back to getTrace() and derive the lightweight view client-side."],"exampleFix":"// before\nconst light = await observability.getTraceLight({ traceId });\n\n// after\nconst structure = await observability.getStructure({ traceId });","handlingStrategy":"fallback","validationCode":"const supportsTraceLight = obs.getTraceLight !== ObservabilityStorage.prototype.getTraceLight;","typeGuard":"function supportsGetTraceLight(o: { getTraceLight: unknown }): boolean {\n  return o.getTraceLight !== (ObservabilityStorage.prototype as any).getTraceLight;\n}","tryCatchPattern":"try {\n  return await obs.getTraceLight(args);\n} catch (e) {\n  if ((e as MastraError).id === 'OBSERVABILITY_STORAGE_GET_TRACE_LIGHT_NOT_IMPLEMENTED') {\n    return obs.getStructure(args).catch(() => null);\n  }\n  throw e;\n}","preventionTips":["Migrate all callers from getTraceLight to getStructure (it is deprecated).","Grep your codebase for getTraceLight after upgrades.","Ensure the adapter overrides getStructure so legacy callers keep working."],"tags":["storage","observability","tracing","deprecated-api","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"}