{"record":{"id":"5892229f6188759d","repo":"mastra-ai/mastra","slug":"observability-storage-update-span-not-implemented","errorCode":"OBSERVABILITY_STORAGE_UPDATE_SPAN_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support updating spans","messagePattern":"This storage provider does not support updating spans","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":178,"sourceCode":"   */\n  async createSpan(_args: CreateSpanArgs): Promise<void> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_CREATE_SPAN_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support creating spans',\n    });\n  }\n\n  /**\n   * Updates a single Span with partial data. Primarily used for realtime trace creation.\n   *\n   * @deprecated This method only works with stores that support span updates,\n   * It will be removed in the future. Instead try to add all data to a span before\n   * ending it.\n   */\n  async updateSpan(_args: UpdateSpanArgs): Promise<void> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_UPDATE_SPAN_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support updating spans',\n    });\n  }\n\n  /**\n   * Retrieves a single span.\n   */\n  async getSpan(_args: GetSpanArgs): Promise<GetSpanResponse | null> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_SPAN_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support getting spans',\n    });\n  }","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L160-L196","documentation":"The ObservabilityStorage base class (packages/core/src/storage/domains/observability/base.ts) provides a default updateSpan() that unconditionally throws this MastraError. It means the concrete storage adapter in use has not implemented span updates. The method is also deprecated: the library expects all span data to be written before the span ends, and updateSpan will be removed in the future.","triggerScenarios":"Calling await storage.getObservability().updateSpan(args) (directly or via an observability exporter/processor) on a storage adapter that only supports span creation (batchCreateSpans/exportSpan) and did not override updateSpan.","commonSituations":"Using a minimal or custom MastraStorage subclass that implements only the required domains; using a storage backend (e.g. some lightweight/upstash-style adapters) that persists spans append-only; following older docs/examples that rely on the deprecated updateSpan API after the backend dropped support for it.","solutions":["Stop calling updateSpan; add all span data (attributes, events, status) before ending the span so a single create/export call suffices.","Check your storage adapter's documentation to confirm whether span updates are supported; if not, remove updateSpan usage from your observability pipeline.","If you own the storage adapter, override updateSpan() to persist the update (e.g. an UPSERT keyed by spanId).","If you only need trace inspection, use getTrace/getSpans instead of mutating stored spans."],"exampleFix":"// before\nawait observability.updateSpan({ spanId, endTime: Date.now() });\n\n// after\nawait observability.exportSpan({ ...span, endTime: Date.now(), status: 'ENDED' });","handlingStrategy":"fallback","validationCode":"import { ObservabilityStorage } from '@mastra/core/storage';\nconst supportsUpdate = obs.updateSpan !== ObservabilityStorage.prototype.updateSpan;","typeGuard":"function supportsSpanUpdate(o: { updateSpan: unknown }): boolean {\n  return typeof o.updateSpan === 'function' &&\n    o.updateSpan !== (ObservabilityStorage.prototype as any).updateSpan;\n}","tryCatchPattern":"try {\n  await obs.updateSpan(args);\n} catch (e) {\n  if ((e as MastraError).id === 'OBSERVABILITY_STORAGE_UPDATE_SPAN_NOT_IMPLEMENTED') {\n    logger.warn('Span updates unsupported; write span data before ending the span.');\n  } else throw e;\n}","preventionTips":["Write all span attributes, events and status before ending the span instead of patching afterwards.","Check the adapter's supported observability methods during storage selection.","Treat updateSpan as deprecated and remove it from new code."],"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"}