{"record":{"id":"5dde0730f1951df8","repo":"mastra-ai/mastra","slug":"observability-storage-get-score-percentiles-not-im","errorCode":"OBSERVABILITY_STORAGE_GET_SCORE_PERCENTILES_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support score percentiles","messagePattern":"This storage provider does not support score percentiles","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":641,"sourceCode":"    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({\n      id: 'OBSERVABILITY_STORAGE_GET_SCORE_PERCENTILES_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support score percentiles',\n    });\n  }\n\n  // ============================================================================\n  // Feedback\n  // ============================================================================\n\n  /**\n   * Creates a single feedback record.\n   */\n  async createFeedback(_args: CreateFeedbackArgs): Promise<void> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_CREATE_FEEDBACK_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,","sourceCodeStart":623,"sourceCodeEnd":659,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L623-L659","documentation":"getScorePercentiles computes percentile distributions (p50/p90/etc.) over scores; the observability base class throws by default because percentiles need provider-specific query math. The error means the configured adapter never overrode this capability.","triggerScenarios":"Calling storage.getScorePercentiles({ scope, percentiles, timeRange }) on an adapter extending the base without an implementation, or via score-analytics tooling pointed at a minimal provider.","commonSituations":"Custom storage backends; percentile dashboards; adapters that predate the percentiles API in @mastra/core.","solutions":["Switch to a storage provider that implements percentiles (libsql, postgres, upstash).","Override getScorePercentiles in your custom adapter (e.g. PERCENTILE_CONT query).","Catch the error and compute percentiles client-side from listScores output.","Update the adapter package to a version implementing current score APIs."],"exampleFix":"// before\nconst p = await storage.getScorePercentiles({ scope, percentiles: [50, 90, 99] }); // throws\n// after\ntry {\n  const p = await storage.getScorePercentiles({ scope, percentiles: [50, 90, 99] });\n} catch (e) {\n  if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_SCORE_PERCENTILES_NOT_IMPLEMENTED') {\n    return computePercentiles(await storage.listScores({ scope }), [50, 90, 99]);\n  }\n  throw e;\n}","handlingStrategy":"fallback","validationCode":"const supportsPercentiles = storage.constructor.prototype.hasOwnProperty('getScorePercentiles');\nif (!supportsPercentiles) return computePercentilesClientSide(scores, percentiles);","typeGuard":"function hasPercentiles(s: any): s is { getScorePercentiles: (a: any) => Promise<any> } {\n  return typeof s?.getScorePercentiles === 'function' && s.constructor.prototype.hasOwnProperty('getScorePercentiles');\n}","tryCatchPattern":"try {\n  return await storage.getScorePercentiles(args);\n} catch (e) {\n  if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_SCORE_PERCENTILES_NOT_IMPLEMENTED') {\n    return computePercentilesClientSide(await safeListScores(storage, { scope: args.scope }), args.percentiles);\n  }\n  throw e;\n}","preventionTips":["Use providers with percentile query support (PERCENTILE_CONT etc.)","Implement percentile math in custom adapters where needed","Keep datasets small enough for client-side fallback","Add capability smoke tests to CI"],"tags":["storage","observability","not-implemented","percentiles"],"backgroundTag":"storage-capability-not-implemented","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}