{"record":{"id":"8052d463ae52536e","repo":"mastra-ai/mastra","slug":"observability-storage-batch-create-scores-not-impl","errorCode":"OBSERVABILITY_STORAGE_BATCH_CREATE_SCORES_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support batch creating scores","messagePattern":"This storage provider does not support batch creating scores","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":581,"sourceCode":"  // ============================================================================\n\n  /**\n   * Creates a single score record.\n   */\n  async createScore(_args: CreateScoreArgs): Promise<void> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_CREATE_SCORE_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support creating scores',\n    });\n  }\n\n  /**\n   * Creates multiple score observations in a single batch.\n   */\n  async batchCreateScores(_args: BatchCreateScoresArgs): Promise<void> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_BATCH_CREATE_SCORES_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support batch creating scores',\n    });\n  }\n\n  /**\n   * Retrieves a list of scores with optional filtering.\n   */\n  async listScores(_args: ListScoresArgs): Promise<ListScoresResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_LIST_SCORES_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support listing scores',\n    });\n  }","sourceCodeStart":563,"sourceCodeEnd":599,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L563-L599","documentation":"MastraError OBSERVABILITY_STORAGE_BATCH_CREATE_SCORES_NOT_IMPLEMENTED. batchCreateScores in the observability storage base class always throws, since batch score writing is an optional backend capability. Hitting it means the provider cannot accept bulk score observations.","triggerScenarios":"Calling batchCreateScores(args) on a storage class relying on the base default; scoring pipelines that flush scores in bulk to an unsupported backend.","commonSituations":"Bulk evaluation runs (eval datasets) against storage adapters without score support; custom adapters implementing createScore but not the batch variant; batched telemetry exporters pointed at minimal storage.","solutions":["Use a storage provider implementing batchCreateScores","Override batchCreateScores in your storage class to insert scores in bulk (or loop over createScore)","Catch the error and fall back to per-record createScore calls or buffer scores elsewhere"],"exampleFix":"// before\nawait storage.batchCreateScores({ scores });\n// after\ntry {\n  await storage.batchCreateScores({ scores });\n} catch (e) {\n  if (e.id === 'OBSERVABILITY_STORAGE_BATCH_CREATE_SCORES_NOT_IMPLEMENTED') {\n    for (const s of scores) await storage.createScore(s);\n    return;\n  }\n  throw e;\n}","handlingStrategy":"fallback","validationCode":"async function supportsBatchScores(storage) {\n  try { await storage.batchCreateScores({ scores: [] }); return true; }\n  catch (e) { return e?.id !== 'OBSERVABILITY_STORAGE_BATCH_CREATE_SCORES_NOT_IMPLEMENTED'; }\n}","typeGuard":"function isNotImplementedError(e: unknown): e is MastraError {\n  return e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_BATCH_CREATE_SCORES_NOT_IMPLEMENTED';\n}","tryCatchPattern":"try {\n  await storage.batchCreateScores({ scores });\n} catch (e) {\n  if (isNotImplementedError(e)) {\n    for (const s of scores) await storage.createScore(s);\n    return;\n  }\n  throw e;\n}","preventionTips":["Confirm batch score support in your provider before bulk evaluation runs","Implement a batch-to-single fallback path in your scoring pipeline","Keep custom adapters implementing both createScore and batchCreateScores","Buffer scores durably so a not-implemented error does not lose evaluation data"],"tags":["storage","observability","not-implemented","scores","batch"],"backgroundTag":"storage-method-not-implemented","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}