{"record":{"id":"571d2fb6d408bbe2","repo":"mastra-ai/mastra","slug":"observability-storage-get-environments-not-impleme","errorCode":"OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support environment discovery","messagePattern":"This storage provider does not support environment discovery","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"warning","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":544,"sourceCode":"    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_ENTITY_NAMES_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support entity name discovery',\n    });\n  }\n\n  async getServiceNames(_args: GetServiceNamesArgs): Promise<GetServiceNamesResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_SERVICE_NAMES_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support service name discovery',\n    });\n  }\n\n  async getEnvironments(_args: GetEnvironmentsArgs): Promise<GetEnvironmentsResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support environment discovery',\n    });\n  }\n\n  async getTags(_args: GetTagsArgs): Promise<GetTagsResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_TAGS_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support tag discovery',\n    });\n  }\n\n  // ============================================================================\n  // Scores","sourceCodeStart":526,"sourceCodeEnd":562,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L526-L562","documentation":"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.","triggerScenarios":"Calling getEnvironments(args) on a storage class that has not overridden the method.","commonSituations":"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.","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"],"exampleFix":"// before\nconst envs = await storage.getEnvironments({});\n// after\nlet envs = [];\ntry {\n  envs = (await storage.getEnvironments({})).environments ?? [];\n} catch (e) {\n  if (e.id !== 'OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED') throw e;\n}","handlingStrategy":"fallback","validationCode":"async function supportsEnvironments(storage) {\n  try { await storage.getEnvironments({}); return true; }\n  catch (e) { return e?.id === 'OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED' ? false : true; }\n}","typeGuard":"function isNotImplementedError(e: unknown): e is MastraError {\n  return e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_ENVIRONMENTS_NOT_IMPLEMENTED';\n}","tryCatchPattern":"try {\n  const res = await storage.getEnvironments(args);\n} catch (e) {\n  if (isNotImplementedError(e)) return { environments: configuredEnvironments };\n  throw e;\n}","preventionTips":["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"],"tags":["storage","observability","not-implemented","telemetry"],"backgroundTag":"storage-method-not-implemented","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}