{"record":{"id":"3615dd083a597465","repo":"mastra-ai/mastra","slug":"observability-storage-get-score-breakdown-not-impl","errorCode":"OBSERVABILITY_STORAGE_GET_SCORE_BREAKDOWN_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support score breakdown","messagePattern":"This storage provider does not support score breakdown","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":623,"sourceCode":"    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_SCORE_BY_ID_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support getting scores by ID',\n    });\n  }\n\n  async getScoreAggregate(_args: GetScoreAggregateArgs): Promise<GetScoreAggregateResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_SCORE_AGGREGATE_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support score aggregation',\n    });\n  }\n\n  async getScoreBreakdown(_args: GetScoreBreakdownArgs): Promise<GetScoreBreakdownResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_SCORE_BREAKDOWN_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support score breakdown',\n    });\n  }\n\n  async getScoreTimeSeries(_args: GetScoreTimeSeriesArgs): Promise<GetScoreTimeSeriesResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_SCORE_TIME_SERIES_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support score time series',\n    });\n  }\n\n  async getScorePercentiles(_args: GetScorePercentilesArgs): Promise<GetScorePercentilesResponse> {\n    throw new MastraError({","sourceCodeStart":605,"sourceCodeEnd":641,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L605-L641","documentation":"getScoreBreakdown groups scores by a dimension (e.g. per-agent, per-entity) and is an optional provider capability; the observability base class throws by default. This error means the configured storage adapter lacks a breakdown query implementation.","triggerScenarios":"Calling storage.getScoreBreakdown({ scope, breakdownBy, ... }) against an adapter that extends the base without overriding it, or via UI/tooling requesting grouped score analytics from a minimal provider.","commonSituations":"Custom storage backends implementing only write paths; dashboards with grouped charts; adapters ported from older Mastra versions before the breakdown API existed.","solutions":["Use a provider that implements score breakdown (libsql, postgres, upstash).","Override getScoreBreakdown in your custom adapter with a GROUP BY-style query.","Catch the error and fall back to grouping listScores results in application code.","Upgrade the storage adapter package to match current @mastra/core APIs."],"exampleFix":"// before\nconst breakdown = await storage.getScoreBreakdown({ scope, breakdownBy: 'entityId' }); // throws\n// after\ntry {\n  const breakdown = await storage.getScoreBreakdown({ scope, breakdownBy: 'entityId' });\n} catch (e) {\n  if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_SCORE_BREAKDOWN_NOT_IMPLEMENTED') {\n    return groupClientSide(await storage.listScores({ scope }), 'entityId');\n  }\n  throw e;\n}","handlingStrategy":"fallback","validationCode":"const supportsBreakdown = storage.constructor.prototype.hasOwnProperty('getScoreBreakdown');\nif (!supportsBreakdown) return groupClientSide(scores, breakdownBy);","typeGuard":"function hasBreakdown(s: any): s is { getScoreBreakdown: (a: any) => Promise<any> } {\n  return typeof s?.getScoreBreakdown === 'function' && s.constructor.prototype.hasOwnProperty('getScoreBreakdown');\n}","tryCatchPattern":"try {\n  return await storage.getScoreBreakdown(args);\n} catch (e) {\n  if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_SCORE_BREAKDOWN_NOT_IMPLEMENTED') {\n    return groupClientSide(await safeListScores(storage, args.scope), args.breakdownBy);\n  }\n  throw e;\n}","preventionTips":["Implement GROUP BY queries in custom adapters","Use fully featured providers for grouped analytics","Cache the capability result to avoid repeated failed calls","Log unsupported analytics calls for observability"],"tags":["storage","observability","not-implemented","analytics"],"backgroundTag":"storage-capability-not-implemented","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}