Back to all workshops

Track Agent Cost and Performance with Mastra Metrics

April 2, 20265:00 PM UTC60 minutes

"How much is this agent costing me per run?" If you're running agents in production, you've probably asked this — and logs and traces alone can't answer it. They're great for debugging a single run, but they don't show you the trends: whether costs are climbing, error rates are spiking, or latency is creeping up over time.

Mastra Studio now has a metrics dashboard — the third observability pillar alongside traces and logs. In this workshop, you'll get a hands-on walkthrough of the new feature, which tracks model costs, token usage, latency percentiles, error rates, and eval scores across your agents, tools, and workflows. You'll see how to read the dashboard and use it to spot problems before your users do.

You'll also learn how to set it up. Metrics are powered by the same instrumentation pipeline you may already be using, but they require columnar storage to handle the volume of data efficiently. We'll walk through configuring DuckDB as your metrics backend so you can add observability without touching your existing storage setup.

We'll wrap up with a look at what's coming next, including ClickHouse support for high-traffic production environments and per-agent, per-model cost breakdowns. Whether you're trying to keep API spend under control or prove to your team that your agent is actually getting better, this session will give you the tools to back it up with data.

Hosted by

Recording and code examples will be available to everyone who registers.

Workshop Hosts

Alex Booker

Alex Booker

Mastra
EP

Eric Pinzur

Mastra

Watch Recording

YouTube