Guide

Monitor your Mastra agents in production.

Mastra builds typed agents and workflows in TypeScript. AgentPing wraps the run, or rides Mastra's OpenTelemetry output, so one record lands per run with the cost, status and output behind it.

Two lines, then every run reports in.

Install the SDK and point it at your Mastra agent. One record lands per run with the cost, status, latency and output behind it.

shellinstall
npm install @agentping/sdk
typescriptmonitor your agent
import { init, run } from "@agentping/sdk";

init({ apiKey: "apk_…", agent: "mastra-agent" });

// Wrap the agent call; the model usage rolls up into one run.
await run({ agent: "mastra-agent" }, async () => {
  return await agent.generate("…");
});

Mastra also emits OpenTelemetry; if you already export traces, point the OTLP exporter at AgentPing instead of wrapping calls. Full reference is in the docs.

What AgentPing tracks for Mastra.

  • Cost per run, from the model usage, attributed to the customer you tag.
  • A missed-run alert when a scheduled workflow stops running.
  • Output quality on the response, scored against your rubric.

See the pillars behind these: Spend, Pulse and Verify.

Can I use OpenTelemetry instead of the SDK?
Yes. Mastra emits OpenTelemetry, so if you already export traces you can point the OTLP exporter at AgentPing and the agent run is reconstructed from the trace.
Does it cover workflows as well as agents?
Yes. Wrap the workflow call in run() and the model usage inside rolls up into a single run with the combined cost.
Will it block my requests?
No. The SDK is non-blocking with a hard timeout and a bounded queue.

Monitor your Mastra agents in minutes.

Add the SDK, send one run, and watch cost, status and quality land in the dashboard.