{"record":{"id":"43b9698b437d6151","repo":"mastra-ai/mastra","slug":"observability-create-span-not-implemented","errorCode":"OBSERVABILITY_CREATE_SPAN_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support creating spans","messagePattern":"This storage provider does not support creating spans","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":162,"sourceCode":"  public get runtimeTracingStrategy(): TracingStorageStrategy | undefined {\n    const supportedStrategies = this.observabilityStrategy.supported;\n    return supportedStrategies.length === 1 ? supportedStrategies[0] : undefined;\n  }\n\n  /**\n   * Optional feature list for observability storage APIs.\n   * Stores should override this to opt in to the APIs they support explicitly.\n   * Older stores and older package versions will simply omit it, which keeps page mode working.\n   */\n  public getFeatures(): readonly ObservabilityStorageFeature[] | undefined {\n    return undefined;\n  }\n\n  /**\n   * Creates a single Span record in the storage provider.\n   */\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,","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L144-L180","documentation":"The base ObservabilityStorageDomain.createSpan is a default implementation for storage providers that do not implement span persistence. It throws a MastraError with id OBSERVABILITY_CREATE_SPAN_NOT_IMPLEMENTED (domain MASTRA_OBSERVABILITY, category SYSTEM) when the provider was not overridden with a real createSpan. It tells you the chosen storage backend cannot store observability spans.","triggerScenarios":"Configuring a storage provider that has not implemented createSpan (uses the base-class default) while enabling tracing/observability so spans are written to storage instead of (or in addition to) an exporter.","commonSituations":"Using a minimal or custom storage adapter that only implements the core domains; enabling AI tracing with a storage backend lacking observability support; upgrading Mastra and turning on storage-backed tracing with an older/third-party provider.","solutions":["Implement createSpan in your storage adapter (persist the CreateSpanArgs payload).","Switch to a storage provider that supports observability spans (e.g. an official provider with the domain implemented).","Disable storage-backed span export and use an external trace exporter (e.g. OTLP) instead.","Check that you are using the provider's latest version — support may have been added in a newer release."],"exampleFix":"// before\nnew Mastra({ storage: myMinimalStorage, observability: { exports: [storageExporter] } });\n// after\n// either remove the storage span exporter:\nnew Mastra({ storage: myMinimalStorage, observability: { exports: [new OTLPExporter()] } });\n// or implement in the adapter:\nclass MyStorage extends BaseStorage {\n  async createSpan(args: CreateSpanArgs) { await this.insertSpanRow(args); }\n}","handlingStrategy":"try-catch","validationCode":"if (typeof (storage as any).createSpan?.prototype !== 'undefined' && storage.createSpan === BaseStorage.prototype.createSpan) {\n  throw new Error(`${storage.constructor.name} does not support spans; use an external exporter`);\n}","typeGuard":"function supportsSpanCreation(storage: MastraStorage): boolean {\n  return storage.createSpan !== undefined && storage.createSpan !== (BaseStorage.prototype as any).createSpan;\n}","tryCatchPattern":"try {\n  await storage.createSpan(spanArgs);\n} catch (e) {\n  if (e instanceof MastraError && e.id === 'OBSERVABILITY_CREATE_SPAN_NOT_IMPLEMENTED') {\n    // fall back to an external OTLP exporter instead of storage-backed tracing\n  } else throw e;\n}","preventionTips":["Verify your storage provider implements the observability domain before enabling storage-backed tracing.","Use an OTLP/external trace exporter when the backend lacks span support.","Keep storage adapters up to date; span support may be added in newer versions.","Smoke-test tracing on a custom storage adapter before deploying."],"tags":["observability","storage","tracing","unsupported-feature"],"backgroundTag":"not-implemented","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}