mastra-ai/mastra · warning · MastraError
OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED
OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED
Error message
This storage provider does not support environment discovery
What it means
MastraError OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED. The observability storage base class stub for getEnvironments always throws, signaling that environment discovery is not implemented by the provider. This is an intentional capability gap indicator, not an unexpected failure.
Source
Thrown at packages/core/src/storage/domains/observability/base.ts:544
throw new MastraError({
id: 'OBSERVABILITY_STORAGE_GET_ENTITY_NAMES_NOT_IMPLEMENTED',
domain: ErrorDomain.MASTRA_OBSERVABILITY,
category: ErrorCategory.SYSTEM,
text: 'This storage provider does not support entity name discovery',
});
}
async getServiceNames(_args: GetServiceNamesArgs): Promise<GetServiceNamesResponse> {
throw new MastraError({
id: 'OBSERVABILITY_STORAGE_GET_SERVICE_NAMES_NOT_IMPLEMENTED',
domain: ErrorDomain.MASTRA_OBSERVABILITY,
category: ErrorCategory.SYSTEM,
text: 'This storage provider does not support service name discovery',
});
}
async getEnvironments(_args: GetEnvironmentsArgs): Promise<GetEnvironmentsResponse> {
throw new MastraError({
id: 'OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED',
domain: ErrorDomain.MASTRA_OBSERVABILITY,
category: ErrorCategory.SYSTEM,
text: 'This storage provider does not support environment discovery',
});
}
async getTags(_args: GetTagsArgs): Promise<GetTagsResponse> {
throw new MastraError({
id: 'OBSERVABILITY_STORAGE_GET_TAGS_NOT_IMPLEMENTED',
domain: ErrorDomain.MASTRA_OBSERVABILITY,
category: ErrorCategory.SYSTEM,
text: 'This storage provider does not support tag discovery',
});
}
// ============================================================================
// ScoresView on GitHub (pinned to 75dd419e61)
Solutions
- Use a provider implementing environment discovery
- Override getEnvironments to enumerate environments recorded in your telemetry data
- Catch the error and fall back to configured environment names or an empty list
Example fix
// before
const envs = await storage.getEnvironments({});
// after
let envs = [];
try {
envs = (await storage.getEnvironments({})).environments ?? [];
} catch (e) {
if (e.id !== 'OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED') throw e;
} Defensive patterns
Strategy: fallback
Validate before calling
async function supportsEnvironments(storage) {
try { await storage.getEnvironments({}); return true; }
catch (e) { return e?.id === 'OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED' ? false : true; }
} Type guard
function isNotImplementedError(e: unknown): e is MastraError {
return e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED';
} Try / catch
try {
const res = await storage.getEnvironments(args);
} catch (e) {
if (isNotImplementedError(e)) return { environments: configuredEnvironments };
throw e;
} Prevention
- Fall back to environment names from deployment config when discovery is unsupported
- Probe storage capabilities during startup health checks
- Document which storage domains your chosen provider implements
- Update custom adapters when adding new discovery methods
When it happens
Trigger: Calling getEnvironments(args) on a storage class that has not overridden the method.
Common situations: Environment filter dropdowns in monitoring UIs backed by providers without discovery support; custom storage adapters written before this API existed; pointing observability at a generic non-telemetry storage backend.
Related errors
- OBSERVABILITY_STORAGE_GET_ENTITY_TYPES_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_GET_ENTITY_NAMES_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_GET_SERVICE_NAMES_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_GET_TAGS_NOT_IMPLEMENTED
- OBSERVABILITY_STORAGE_BATCH_UPDATE_SPANS_NOT_IMPLEMENTED
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/571d2fb6d408bbe2.
Report an issue: GitHub.