mastra-ai/mastra · warning · MastraError
OBSERVABILITY_STORAGE_GET_METRIC_NAMES_NOT_IMPLEMENTED
OBSERVABILITY_STORAGE_GET_METRIC_NAMES_NOT_IMPLEMENTED
Error message
This storage provider does not support metric name discovery
What it means
MastraError OBSERVABILITY_STORAGE_GET_METRIC_NAMES_NOT_IMPLEMENTED. The observability storage base class declares getMetricNames as an optional capability; the default implementation unconditionally throws this error. It is thrown when the active storage provider has not overridden getMetricNames, meaning metric name discovery is not available for that backend. It is a deliberate 'capability not implemented' signal, not a runtime failure.
Source
Thrown at packages/core/src/storage/domains/observability/base.ts:490
text: 'This storage provider does not support metric time series',
});
}
async getMetricPercentiles(_args: GetMetricPercentilesArgs): Promise<GetMetricPercentilesResponse> {
throw new MastraError({
id: 'OBSERVABILITY_STORAGE_GET_METRIC_PERCENTILES_NOT_IMPLEMENTED',
domain: ErrorDomain.MASTRA_OBSERVABILITY,
category: ErrorCategory.SYSTEM,
text: 'This storage provider does not support metric percentiles',
});
}
// ============================================================================
// Discovery / Metadata Methods
// ============================================================================
async getMetricNames(_args: GetMetricNamesArgs): Promise<GetMetricNamesResponse> {
throw new MastraError({
id: 'OBSERVABILITY_STORAGE_GET_METRIC_NAMES_NOT_IMPLEMENTED',
domain: ErrorDomain.MASTRA_OBSERVABILITY,
category: ErrorCategory.SYSTEM,
text: 'This storage provider does not support metric name discovery',
});
}
async getMetricLabelKeys(_args: GetMetricLabelKeysArgs): Promise<GetMetricLabelKeysResponse> {
throw new MastraError({
id: 'OBSERVABILITY_STORAGE_GET_METRIC_LABEL_KEYS_NOT_IMPLEMENTED',
domain: ErrorDomain.MASTRA_OBSERVABILITY,
category: ErrorCategory.SYSTEM,
text: 'This storage provider does not support metric label key discovery',
});
}
async getMetricLabelValues(_args: GetMetricLabelValuesArgs): Promise<GetMetricLabelValuesResponse> {
throw new MastraError({View on GitHub (pinned to 75dd419e61)
Solutions
- Switch to a storage provider that implements metric name discovery (e.g. the official Postgres/ClickHouse observability backends)
- Implement getMetricNames in your custom storage domain class, returning the metric names you persist
- Wrap the call in try/catch and degrade gracefully (return an empty list or hide discovery UI) when the backend lacks support
Example fix
// before
const names = await storage.getMetricNames({});
// after
let names = [];
try {
names = (await storage.getMetricNames({})).metricNames ?? [];
} catch (e) {
if (e.id !== 'OBSERVABILITY_STORAGE_GET_METRIC_NAMES_NOT_IMPLEMENTED') throw e;
} Defensive patterns
Strategy: fallback
Validate before calling
// capability probe
async function supportsMetricNames(storage) {
try { await storage.getMetricNames({}); return true; }
catch (e) { return e?.id === 'OBSERVABILITY_STORAGE_GET_METRIC_NAMES_NOT_IMPLEMENTED' ? false : true; }
} Type guard
function isNotImplementedError(e: unknown): e is MastraError {
return e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_METRIC_NAMES_NOT_IMPLEMENTED';
} Try / catch
try {
const res = await storage.getMetricNames(args);
} catch (e) {
if (isNotImplementedError(e)) return { metricNames: [] };
throw e;
} Prevention
- Check your storage provider's docs for observability metric discovery support before wiring the metrics API
- Write a capability smoke test against your storage instance in CI
- Centralize storage calls in a wrapper that degrades gracefully on not-implemented errors
- Keep custom storage adapters in sync with MastraStorage interface updates on upgrades
When it happens
Trigger: Calling getMetricNames(args) on a storage instance whose class extends MastraObservabilityStorage (base.ts) without overriding the method — e.g. an in-memory or minimal storage adapter used with the observability metrics API.
Common situations: Using a storage adapter (LibSQL, in-memory, or a custom driver) that predates observability metrics support; swapping storage backends and assuming all MastraStorage domains are fully implemented; calling the metrics discovery API through the server/API layer against a provider lacking the feature.
Related errors
- OBSERVABILITY_STORAGE_BATCH_CREATE_METRICS_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_LIST_METRICS_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_GET_METRIC_AGGREGATE_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_GET_METRIC_BREAKDOWN_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_GET_METRIC_TIME_SERIES_NOT_IMPLEMENTED
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/a46e84b313129ceb.
Report an issue: GitHub.