unstale

npm / @mastra/observability

@mastra/observability

What changed in @mastra/observability 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

7 breaking2 security21 new APIs and options15 behavior and defaults49 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

@mastra/observability 194 changes

Breaking changes 7

  • Opt in to retaining MastraStorageExporter on Platform alongside Mastra Platform; built-in storage exporters remain disabled there by default.

    1.24.0release notes

  • On traces using hideInput or hideOutput, exported span errors redact messages and omit free-form details to avoid exposing hidden input or output.

    1.24.0release notes

  • Ended spans ignore subsequent end(), error(), and outcome updates, preserving the exported result; null or absent outcome means none was recorded.

    1.23.0release notes

  • Agent-stream inference spans retain provider timing and usage but no longer record response output; use processed chunks or MODEL_GENERATION output instead.

    1.23.0release notes

  • Spans and signals no longer attribute a versioned agent's version to its tool or model calls, so grouping or filtering by version counts only that version's own entity.

    1.22.0release notes

  • Completed event spans now end at their start time with zero duration, and no longer emit duration metrics.

    1.18.1release notes

  • Processors returning a copy of a span now cause the span to be dropped with a logged processor error, rather than throwing for started or updated spans or silently dropping ended spans.

    1.17.9release notes

Security 2

  • Redacts the entire value under a sensitive key, including nested objects and arrays, preventing nested values from appearing in traces.

    1.24.0release notes

  • Sensitive fields inside a span's requestContext are now redacted like fields in attributes, metadata, input, output, and errorInfo.

    1.17.6release notes

New APIs and options 21

  • MastraPlatformExporter and MastraStorageExporter support opt-in byte-based flush thresholds and configurable export concurrency; count batching remains the default.

    1.24.0release notes

  • Platform can export feedback and scores that require trace details, retrying while waiting for a trace; flush and shutdown wait for pending deliveries.

    1.24.0release notes

  • Delivers feedback replacements through supporting exporters; Platform sends PUT requests and storage exporters persist their copies independently.

    1.24.0release notes

  • Spans now include local error counts, allowing developers to inspect errors associated with an individual span.

    1.24.0release notes

  • Updates feedback review status through supporting storage and Platform exporters; flush and shutdown wait for pending updates.

    1.24.0release notes

  • After cancellation, end a span and its open descendants by passing endTree: true.

    1.23.0release notes

  • Span lifecycle methods and exporters support execution outcomes; custom producers can retain arbitrary outcome strings.

    1.23.0release notes

  • Span lifecycle methods accept a stop reason, with framework-generated context containing compact facts and span references.

    1.23.0release notes

  • Model and agent spans report milliseconds from model-call start to the first streamed chunk, excluding work before the model call.

    1.23.0release notes

  • Spans can be filtered and grouped by parent or root entity; durable agents retain lineage across steps, while previously stored spans have no parent or root entity.

    1.22.0release notes

  • Model tracing records completionStartTime on the first response chunk and copies it to the model step, model generation, and agent run span, enabling time-to-first-chunk calculations at every level.

    1.21.0release notes

  • Controls price refresh behavior: refresh is on by default under mastra dev and off by default in other environments.

    1.20.0release notes

  • Disables price refresh everywhere, regardless of the MASTRA_AUTO_REFRESH_PRICING setting.

    1.20.0release notes

  • Added tracingOptions.nestUnderParent for runs with a traceId and parentSpanId; exported spans are marked nestedUnderParent and run tags are no longer applied to the trace.

    1.19.0release notes

  • Token and cost metrics now include a shared usageId per model call, letting storage group metric rows independently of their span.

    1.19.0release notes

  • The tools attribute is added to MODEL_INFERENCE spans, holding the tool definitions sent to the provider so exporters can read the tools for each model call.

    1.18.4release notes

  • Set a per-run root span name for agent and workflow runs, including through HTTP routes and generated client request types. The name replaces the default on the root span only; child span names and entity filtering are unchanged.

    1.18.0release notes

  • Added resolveFromEnv; set it to false to ignore the listed environment credentials and endpoint, using only passed config. It defaults to true.

    1.17.9release notes

  • Added the endTree option to close still-open descendant spans when ending a span, without applying the terminal output or error to them.

    1.17.6release notes

  • Adds an API that closes a span and every still-open descendant, applying the supplied options to each so abandoned operations can emit a full trace.

    1.17.2release notes

  • Added the indexed redaction style, which assigns each unique sensitive value a stable token derived from the first matched field name.

    1.17.0release notes

Behavior and default changes 15

  • A fallback model attempt opens its own inference span named after the model it calls, and the failed attempt's span ends with the error.

    1.23.0release notes

  • Exported spans include model as a top-level field when the span's own attributes have both model and provider.

    1.23.0release notes

  • Processed MODEL_CHUNK spans are children of MODEL_STEP regardless of output-processor buffering.

    1.23.0release notes

  • Exported spans include provider as a top-level field when the span's own attributes have both model and provider.

    1.23.0release notes

  • Ending a span again is reported as a dropped event with the span-not-updatable reason.

    1.22.0release notes

  • Storage and Platform exporters automatically provide span-aware input, output, and error previews using processed payloads; intentionally empty strings are preserved.

    1.22.0release notes

  • Classifier token usage now contributes to token and cost metrics and appears in Studio traces, with estimated costs when the model has a known price.

    1.21.0release notes

  • Bundled model pricing was updated with the latest prices from models.dev, affecting estimated costs for models with known prices.

    1.20.1release notesrelease notesrelease notesrelease notesrelease notes

  • The model label on cost metrics now uses the models.dev model ID for some models, so charts grouped by model can show them under a new name.

    1.20.0release notes

  • Cost estimates use model prices from models.dev; models no longer listed there retain token metrics but no longer receive cost estimates.

    1.20.0release notes

  • Custom gateways can return pricing from fetchProviders() to provide cost estimates for models that models.dev doesn't price.

    1.20.0release notes

  • A model request cancelled by a queued signal gets its own inference span ending with finish reason interrupted; its replacement opens a separate span under the same MODEL_STEP.

    1.19.0release notes

  • Provider API errors now include the HTTP status code, request URL, retryability, and provider response body under details, making failures easier to diagnose.

    1.18.3release notes

  • Requests now advertise quota-pause support, allowing the platform to return 402 Payment Required to clients that understand the contract while shielding legacy clients from retry loops.

    1.17.1release notes

  • Automatically pauses uploads when the organization's observability quota is exhausted, drops events locally, and periodically probes for re-enablement; exports resume automatically, with warnings on pause and resume.

    1.16.6release notes

Fixes and other changes 49

  • Each exporter handles its own destination, so missing local traces no longer block remote export; storage lookup retries are included in flush and shutdown.

    1.24.0release notes

  • Model inference spans carry the response again after output processors run, so exporters can show model text and tool calls.

    1.24.0release notes

  • Raw provider streams now attach the serving model to the span, preventing cost estimation and exporters from falling back to the requested model.

    1.24.0release notes

  • Stored spans inherit the service name from Observability config when span metadata does not set one, allowing span and trace filters to find them by that service name.

    1.23.1release notes

  • hideInput and hideOutput settings now remain effective on tool calls, nested workflows, and Inngest workflow and step spans in durable agent runs, including runs continued in a later step.

    1.22.0release notes

  • For batch-with-updates or realtime tracing, ended spans from another process are sent directly to storage instead of waiting for an unseen start; conditional span updates are required.

    1.22.0release notes

  • Model step spans report the model and provider actually called, including after an input processor switches models or a fallback takes over; both are empty when no model is called.

    1.22.0release notes

  • Vercel AI Gateway routing details are retained on model step spans so exporters can identify the serving provider and failed provider attempts before fallback.

    1.22.0release notes

  • Native span fields, including resumedFromSpanId, outcome, stopReason, and stopReasonContext, survive export, snapshots, and rebuilds for durable and multi-worker runs.

    1.22.0release notes

  • Suspended or approval-waiting tool calls now report token usage and end model step and inference spans as suspended; later approval requests from the same step no longer create empty spans.

    1.21.0release notes

  • Cost estimates for inference profiles with the in. prefix no longer report no_matching_model.

    1.20.1release notes

  • Tracking exporters wait for in-progress trace-cap evictions in flush() and shutdown(), ensuring aborted spans are sent instead of queued after flushing or aborted twice.

    1.20.1release notes

  • MastraStorageExporter and DefaultExporter flush() now wait for storage writes already started by a batch timer or size trigger, preventing spans from being lost when a process exits.

    1.20.0release notes

  • Spans keep and export links they were started with and links set before they end; links with invalid W3C trace or span IDs are ignored.

    1.20.0release notes

  • MastraStorageExporter and DefaultExporter shutdown() now wait for storage writes already started by a batch timer or size trigger, preventing spans from being lost when a process exits.

    1.20.0release notes

  • Datadog APM no longer starts a dd-trace span for excluded types, allowing remaining spans to finish and the trace to be sent.

    1.19.0release notes

  • flush() and shutdown() finish processing queued span events first, preventing spans from being incorrectly reported as aborted when shutdown follows flush.

    1.19.0release notes

  • When a model has no separate reasoning price, reasoning tokens use the output price in cost estimates, matching provider billing.

    1.19.0release notes

  • Each model inference span records the first content time for its own request instead of reusing the run's first request time.

    1.19.0release notes

  • Spans in Braintrust, LangSmith, and PostHog traces now end with their real output instead of staying open until shutdown and being marked as failed.

    1.18.4release notes

  • Cost estimates are now available for the newest OpenAI and Anthropic models because the pricing data is up to date.

    1.18.3release notes

  • Root span selection now handles spans returned out of start order and traces with an unpersisted parent, so scores and feedback use the real root's entity and tags.

    1.18.3release notes

  • Cost estimates now use provider raw-usage counts for 5-minute and 1-hour cache writes, pricing 1-hour writes at their actual rate.

    1.18.2release notes

  • model_step spans no longer export the provider's raw HTTP response body in metadata, avoiding oversized spans and repeated output and usage; response headers remain available.

    1.18.2release notes

  • Preserve internal span status through exportSpan() and rebuildSpan(), so internal spans stay out of exporters by default and remain included when includeInternalSpans is enabled.

    1.18.0release notes

  • Pricing data was refreshed to provide cost estimates for the newest models.

    1.17.9release notes

  • Exact OpenRouter generation costs, including BYOK upstream charges, are now reflected in observability spans and Langfuse exports.

    1.17.9release notes

  • Built-in storage exporters no longer continue writing in Mastra Platform deployments; other exporters remain enabled.

    1.17.8release notes

  • Model step and model inference spans now use ModelStepInput for their input type; what the spans record is unchanged.

    1.17.7release notes

  • Errors, aborts, suspensions, tripwires, and prepare failures now close the whole span tree, preventing exporters that wait for every span to finish from retaining traces and payloads indefinitely.

    1.17.6release notes

  • Already-redacted values keep their token across span events, so the same secret maps to one token across a trace; mappings are retained for the 1000 most recently seen traces.

    1.17.6release notes

  • Startup no longer fails when an older supported @mastra/core version lacks observability exports, because the helpers are defined locally.

    1.17.5release notes

  • Values extracted via requestContextKeys now reach exported spans even when the agent has no memory configured.

    1.17.5release notes

  • Metadata entries with undefined values no longer erase existing span values; entries with real values still take precedence.

    1.17.5release notes

  • MastraPlatformExporter now reads this environment variable as an observability endpoint override, allowing projects in non-default regions to route signals to the right collector.

    1.17.4release notes

  • Tripwire aborts from output stream processors in later steps of a multi-step agent run now show up on the processor_run span instead of an empty span.

    1.17.4release notes

  • Newly emitted logs and metrics use the nearest ancestor span that reaches exporters, or omit spanId when no such ancestor exists, preventing links to unavailable spans.

    1.17.3release notes

  • The exporter recovers when a configured observability store is temporarily unavailable during startup, allowing traces to resume on a later event without restarting the process.

    1.17.2release notes

  • Writes now preserve complete surrogate pairs and sanitize NUL characters and unpaired surrogates before the jsonb cast, preventing malformed fields from discarding an entire batch.

    1.17.2release notes

  • Repeated calls are ignored; a force-closed span retains its closed state and reports its end exactly once even if its work later calls end again.

    1.17.2release notes

  • TTL-specific rates are applied without double counting aggregate tokens.

    1.17.1release notes

  • Internal tracing fields are removed only from framework-owned payloads, preserving user data with matching key names.

    1.17.1release notes

  • The marker now counts only fields dropped by the object-key limit, and values beyond the limit are no longer read.

    1.17.1release notes

  • Fixed traces that start under an external parent span not appearing in Mastra Studio.

    1.17.0release notes

  • When excludeSpanTypes removes a parent span, descendant spans now use the nearest exported parent so exporters retain tool calls.

    1.16.6release notes

  • Prevents live workflow scores and feedback from being lost before trace data reaches observability storage, and logs a warning when an annotation cannot be saved.

    1.16.6release notes

  • Completed model inference spans now preserve the provider response model.

    1.16.6release notes

  • Completed model generations use costs reported by Vercel AI Gateway when every step reports a valid cost.

    1.16.6release notes

  • Token metrics retain model labels and cost data when providers return blank response model IDs.

    1.16.5release notes