mastra-ai/mastra · error · MastraError
OBSERVABILITY_STORAGE_GET_SCORE_PERCENTILES_NOT_IMPLEMENTED
OBSERVABILITY_STORAGE_GET_SCORE_PERCENTILES_NOT_IMPLEMENTED
Error message
This storage provider does not support score percentiles
What it means
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.
Source
Thrown at packages/core/src/storage/domains/observability/base.ts:641
throw new MastraError({
id: 'OBSERVABILITY_STORAGE_GET_SCORE_BREAKDOWN_NOT_IMPLEMENTED',
domain: ErrorDomain.MASTRA_OBSERVABILITY,
category: ErrorCategory.SYSTEM,
text: 'This storage provider does not support score breakdown',
});
}
async getScoreTimeSeries(_args: GetScoreTimeSeriesArgs): Promise<GetScoreTimeSeriesResponse> {
throw new MastraError({
id: 'OBSERVABILITY_STORAGE_GET_SCORE_TIME_SERIES_NOT_IMPLEMENTED',
domain: ErrorDomain.MASTRA_OBSERVABILITY,
category: ErrorCategory.SYSTEM,
text: 'This storage provider does not support score time series',
});
}
async getScorePercentiles(_args: GetScorePercentilesArgs): Promise<GetScorePercentilesResponse> {
throw new MastraError({
id: 'OBSERVABILITY_STORAGE_GET_SCORE_PERCENTILES_NOT_IMPLEMENTED',
domain: ErrorDomain.MASTRA_OBSERVABILITY,
category: ErrorCategory.SYSTEM,
text: 'This storage provider does not support score percentiles',
});
}
// ============================================================================
// Feedback
// ============================================================================
/**
* Creates a single feedback record.
*/
async createFeedback(_args: CreateFeedbackArgs): Promise<void> {
throw new MastraError({
id: 'OBSERVABILITY_STORAGE_CREATE_FEEDBACK_NOT_IMPLEMENTED',
domain: ErrorDomain.MASTRA_OBSERVABILITY,View on GitHub (pinned to 75dd419e61)
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.
Example fix
// before
const p = await storage.getScorePercentiles({ scope, percentiles: [50, 90, 99] }); // throws
// after
try {
const p = await storage.getScorePercentiles({ scope, percentiles: [50, 90, 99] });
} catch (e) {
if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_SCORE_PERCENTILES_NOT_IMPLEMENTED') {
return computePercentiles(await storage.listScores({ scope }), [50, 90, 99]);
}
throw e;
} Defensive patterns
Strategy: fallback
Validate before calling
const supportsPercentiles = storage.constructor.prototype.hasOwnProperty('getScorePercentiles');
if (!supportsPercentiles) return computePercentilesClientSide(scores, percentiles); Type guard
function hasPercentiles(s: any): s is { getScorePercentiles: (a: any) => Promise<any> } {
return typeof s?.getScorePercentiles === 'function' && s.constructor.prototype.hasOwnProperty('getScorePercentiles');
} Try / catch
try {
return await storage.getScorePercentiles(args);
} catch (e) {
if (e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_SCORE_PERCENTILES_NOT_IMPLEMENTED') {
return computePercentilesClientSide(await safeListScores(storage, { scope: args.scope }), args.percentiles);
}
throw e;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: Custom storage backends; percentile dashboards; adapters that predate the percentiles API in @mastra/core.
Related errors
- OBSERVABILITY_STORAGE_GET_METRIC_PERCENTILES_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_GET_FEEDBACK_PERCENTILES_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_BATCH_UPDATE_SPANS_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_BATCH_DELETE_TRACES_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_BATCH_CREATE_LOGS_NOT_IMPLEMENTED
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/5dde0730f1951df8.
Report an issue: GitHub.