Create

Sign in to ReadmeX

or

How we handle your data: Privacy Policy

ReadmeX

Your AI reading companion

What would you like to catch up on?

Pick a briefing, or ask your own question.

Your community and people briefings stay personal to you.

Story

Mastra Adds Custom Metrics for Agent Observability

AI summary

Mastra announced that developers can use metrics.emit() to record custom metrics from tools, workflows, processors, scorers, and other application code. Metrics accept a name, numeric value, optional labels, cost details, and metadata, and work alongside automatic duration, token, and cost tracking for agent runs, tool calls, and model calls. Mastra says the feature supports threshold alerts, queries through its SDK, CLI, and observability endpoints, and is available with @mastra/core 1.76.0 or later.

In-depth insight

The release gives AI-agent developers a way to track application-specific business and operational measures through the same observability system used for runtime telemetry.

You can now emit custom metrics from tools, workflows, processors, scorers, or anywhere else in your application using metrics.emit(), and passing in a name, a value, optional labels, cost details, or specific metadata.

Custom metrics work alongside Mastra's automatic metrics, which record duration, tokens, and cost for every agent run, tool call, and model call. Anything else you'd like to measure can now be recorded with labels and payloads that work for you.

Your browser does not support the video tag.Custom metrics emitted from a tool, workflow step, processor, and scorer, each shown next to its exported record, then Mastra Code using the Mastra CLI to list the five custom metrics, total this week's refunds, and break them down by reason.

Automatically collected metrics have been visible on the Mastra platform for a while, but now with custom metrics you can create your own measures and set alerts when a value crosses a threshold.

Custom metrics work on the Mastra platform with MastraPlatformExporter, and on self-hosted Mastra projects with MastraStorageExporter and a ClickHouse, DuckDB, or PostgreSQL observability store.

#Mastra#Mastra Platform#MastraPlatformExporter#MastraStorageExporter#ClickHouse#DuckDB#PostgreSQL

Original · 2 min readRead the original
Group chat

No comments yet. Start the conversation.