mastra-ai/mastra · warning · MastraError

OBSERVABILITY_STORAGE_GET_ENTITY_TYPES_NOT_IMPLEMENTED

OBSERVABILITY_STORAGE_GET_ENTITY_TYPES_NOT_IMPLEMENTED

Error message

This storage provider does not support entity type discovery

What it means

MastraError OBSERVABILITY_STORAGE_GET_ENTITY_TYPES_NOT_IMPLEMENTED. The base observability storage class throws this from getEntityTypes when a provider has not implemented entity type discovery. It indicates the backend cannot enumerate the entity types (e.g. agent, workflow, tool) that have telemetry data.

Source

Thrown at packages/core/src/storage/domains/observability/base.ts:517

    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({
      id: 'OBSERVABILITY_STORAGE_GET_LABEL_VALUES_NOT_IMPLEMENTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,
      category: ErrorCategory.SYSTEM,
      text: 'This storage provider does not support label value discovery',
    });
  }

  async getEntityTypes(_args: GetEntityTypesArgs): Promise<GetEntityTypesResponse> {
    throw new MastraError({
      id: 'OBSERVABILITY_STORAGE_GET_ENTITY_TYPES_NOT_IMPLEMENTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,
      category: ErrorCategory.SYSTEM,
      text: 'This storage provider does not support entity type discovery',
    });
  }

  async getEntityNames(_args: GetEntityNamesArgs): Promise<GetEntityNamesResponse> {
    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({

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Use a storage provider that implements entity type discovery
  2. Override getEntityTypes to return the distinct entity types in your telemetry tables
  3. Catch and degrade (return an empty list or hardcode known types) when unsupported

Example fix

// before
const types = await storage.getEntityTypes({});
// after
let types = [];
try {
  types = (await storage.getEntityTypes({})).entityTypes ?? [];
} catch (e) {
  if (e.id !== 'OBSERVABILITY_STORAGE_GET_ENTITY_TYPES_NOT_IMPLEMENTED') throw e;
}
Defensive patterns

Strategy: fallback

Validate before calling

async function supportsEntityTypes(storage) {
  try { await storage.getEntityTypes({}); return true; }
  catch (e) { return e?.id === 'OBSERVABILITY_STORAGE_GET_ENTITY_TYPES_NOT_IMPLEMENTED' ? false : true; }
}

Type guard

function isNotImplementedError(e: unknown): e is MastraError {
  return e instanceof MastraError && e.id === 'OBSERVABILITY_STORAGE_GET_ENTITY_TYPES_NOT_IMPLEMENTED';
}

Try / catch

try {
  const res = await storage.getEntityTypes(args);
} catch (e) {
  if (isNotImplementedError(e)) return { entityTypes: [] };
  throw e;
}

Prevention

When it happens

Trigger: Calling getEntityTypes(args) on a storage instance whose class relies on the base implementation.

Common situations: Telemetry explorer UIs listing entity types against minimal or custom storage adapters; provider versions predating entity-type discovery; wiring a scores-only backend into the observability slot.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/5abb72bd38324bc7. Report an issue: GitHub.