Skip to content
Mastra Blog·· 4 d agoAI score33

Mastra Observability adds custom metrics via metrics.emit()

Introducing Custom Metrics for Mastra Observability

AI summary

Mastra Observability now lets developers emit custom metrics from tools, workflows, processors, scorers, or anywhere else in an app using metrics.emit(), passing a name, value, and optional labels, cost details, or metadata. Custom metrics sit alongside Mastra's automatic duration, token, and cost metrics, and can trigger alerts when a value crosses a threshold. They work on the Mastra platform via MastraPlatformExporter or self-hosted with MastraStorageExporter and a ClickHouse, DuckDB, or PostgreSQL store, requiring @mastra/core@1.76.0 or later.

Source:Mastra Blog · mastra.ai

Deployment engineeringProduct updates