mastra-ai/mastra · error · MastraError

OBSERVABILITY_DELTA_POLLING_NOT_SUPPORTED

OBSERVABILITY_DELTA_POLLING_NOT_SUPPORTED

Error message

This storage provider does not support observability delta polling

What it means

ObservabilityInMemory supports delta polling (incremental reads via cursors) only when the corresponding feature flag is enabled. assertDeltaPollingEnabled() throws this error from listTraces, listBranches, listMetrics, listLogs, listScores, and listFeedback when the flag is off, i.e. the in-memory provider cannot serve delta/incremental queries in that configuration.

Source

Thrown at packages/core/src/storage/domains/observability/inmemory.ts:166

    this.db.observabilityNextCursorId = 1;
    this.db.traceCursorIds.clear();
    this.db.branchCursorIds.clear();
    this.db.metricCursorIds.clear();
    this.db.logCursorIds.clear();
    this.db.scoreCursorIds.clear();
    this.db.feedbackCursorIds.clear();
  }

  private deltaPollingFeatureEnabled(): boolean {
    return coreFeatures.has(OBSERVABILITY_DELTA_POLLING_FEATURE);
  }

  private assertDeltaPollingEnabled(): void {
    if (this.deltaPollingFeatureEnabled()) {
      return;
    }

    throw new MastraError({
      id: 'OBSERVABILITY_DELTA_POLLING_NOT_SUPPORTED',
      domain: ErrorDomain.MASTRA_OBSERVABILITY,
      category: ErrorCategory.SYSTEM,
      text: 'This storage provider does not support observability delta polling',
    });
  }

  private allocateObservabilityCursorId(): number {
    const cursorId = this.db.observabilityNextCursorId;
    this.db.observabilityNextCursorId += 1;
    return cursorId;
  }

  /**
   * Upserts a record into an append-only collection keyed by an id field.
   *
   * If an existing record with the same id is found, it is replaced in place
   * (preserving its cursor id so delta polling does not re-emit it). Otherwise

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Enable the delta polling feature flag for ObservabilityInMemory (constructor option/env flag it checks via deltaPollingFeatureEnabled()).
  2. Switch to a persistent storage provider that supports delta polling for observability.
  3. Change the client to use full-list queries instead of cursor/delta-based reads when using the in-memory store.
  4. Verify you are instantiating ObservabilityInMemory deliberately rather than as an accidental default storage.

Example fix

// before
const storage = new ObservabilityInMemory(); // delta polling off
const { traces } = await storage.listTraces({ ... }); // throws

// after
const storage = new ObservabilityInMemory({ deltaPolling: true }); // enable flag
const { traces } = await storage.listTraces({ ... });
Defensive patterns

Strategy: try-catch

Validate before calling

if (storage instanceof ObservabilityInMemory && !isDeltaPollingEnabled(storage)) { useFullListPath(); }

Type guard

function supportsDeltaPolling(s: unknown): boolean {
  return !(s instanceof ObservabilityInMemory) || isDeltaPollingEnabled(s);
}

Try / catch

try {
  page = await storage.listTraces(args);
} catch (e) {
  if ((e as MastraError).id === 'OBSERVABILITY_DELTA_POLLING_NOT_SUPPORTED') {
    page = await fullListTraces(args); // fallback to non-delta read
  } else throw e;
}

Prevention

When it happens

Trigger: Calling any of listTraces/listBranches/listMetrics/listLogs/listScores/listFeedback on ObservabilityInMemory while deltaPollingFeatureEnabled() returns false (flag not set / not configured).

Common situations: Running local dev with the in-memory store while a client (e.g. Studio or a poller) requests delta-polling reads; forgetting to enable the delta-polling feature flag in the storage constructor or environment; mixing an in-memory store into an environment designed for DB-backed delta polling.

Related errors


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