{"record":{"id":"25d3a31e16944ab8","repo":"mastra-ai/mastra","slug":"observability-storage-get-metric-label-keys-not-im","errorCode":"OBSERVABILITY_STORAGE_GET_METRIC_LABEL_KEYS_NOT_IMPLEMENTED","errorMessage":"This storage provider does not support metric label key discovery","messagePattern":"This storage provider does not support metric label key discovery","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"warning","filePath":"packages/core/src/storage/domains/observability/base.ts","lineNumber":499,"sourceCode":"      text: 'This storage provider does not support metric percentiles',\n    });\n  }\n\n  // ============================================================================\n  // Discovery / Metadata Methods\n  // ============================================================================\n\n  async getMetricNames(_args: GetMetricNamesArgs): Promise<GetMetricNamesResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_METRIC_NAMES_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support metric name discovery',\n    });\n  }\n\n  async getMetricLabelKeys(_args: GetMetricLabelKeysArgs): Promise<GetMetricLabelKeysResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_METRIC_LABEL_KEYS_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support metric label key discovery',\n    });\n  }\n\n  async getMetricLabelValues(_args: GetMetricLabelValuesArgs): Promise<GetMetricLabelValuesResponse> {\n    throw new MastraError({\n      id: 'OBSERVABILITY_STORAGE_GET_LABEL_VALUES_NOT_IMPLEMENTED',\n      domain: ErrorDomain.MASTRA_OBSERVABILITY,\n      category: ErrorCategory.SYSTEM,\n      text: 'This storage provider does not support label value discovery',\n    });\n  }\n\n  async getEntityTypes(_args: GetEntityTypesArgs): Promise<GetEntityTypesResponse> {\n    throw new MastraError({","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/storage/domains/observability/base.ts#L481-L517","documentation":"MastraError OBSERVABILITY_STORAGE_GET_METRIC_LABEL_KEYS_NOT_IMPLEMENTED. The base observability storage class provides no default getMetricLabelKeys implementation, so any provider that has not overridden it throws this error. It signals that label key discovery for metrics is an unimplemented capability in the configured storage backend.","triggerScenarios":"Calling getMetricLabelKeys(args) on a storage instance that extends MastraObservabilityStorage without overriding the method.","commonSituations":"Custom or lightweight storage adapters used with observability metrics; older storage provider versions that shipped before label-key discovery was added; frontend metric explorers fetching label keys from a backend without the capability.","solutions":["Use a storage provider that implements getMetricLabelKeys","Override getMetricLabelKeys in your storage domain class to return persisted label keys","Catch this error and fall back to hardcoded or empty label-key lists in the UI"],"exampleFix":"// before\nconst keys = await storage.getMetricLabelKeys({ metricName });\n// after\nlet keys = [];\ntry {\n  keys = (await storage.getMetricLabelKeys({ metricName })).labelKeys ?? [];\n} catch (e) {\n  if (e.id !== 'OBSERVABILITY_STORAGE_GET_METRIC_LABEL_KEYS_NOT_IMPLEMENTED') throw e;\n}","handlingStrategy":"fallback","validationCode":"async function supportsLabelKeys(storage) {\n  try { await storage.getMetricLabelKeys({}); return true; }\n  catch (e) { return e?.id === 'OBSERVABILITY_STORAGE_GET_METRIC_LABEL_KEYS_NOT_IMPLEMENTED' ? false : true; }\n}","typeGuard":"function isNotImplementedError(e: unknown): e is MastraError {\n  return e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_METRIC_LABEL_KEYS_NOT_IMPLEMENTED';\n}","tryCatchPattern":"try {\n  const res = await storage.getMetricLabelKeys(args);\n} catch (e) {\n  if (isNotImplementedError(e)) return { labelKeys: [] };\n  throw e;\n}","preventionTips":["Verify label key discovery is listed as supported by your storage backend","Add a capability probe at startup and disable metric explorer features when absent","Wrap discovery calls behind a storage facade with fallbacks","Pin/test storage adapter versions against the Mastra version you use"],"tags":["storage","observability","not-implemented","metrics"],"backgroundTag":"storage-method-not-implemented","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}