Mastra 平台推出可观测性警报功能
Introducing Observability Alerts for Mastra Platform
Mastra 平台现支持设置可观测性警报,当模型成本超限、错误率上升或评估分数下降时发送通知至 Slack、Discord、Microsoft Teams、邮件、Webhook、PagerDuty 或 incident.io。用户可配置警报以监控错误与流量、延迟、Token 使用、成本与评估分数,管理员需开启规则以触发通知。
You can now set observability alerts and get notified when model costs exceed limits, error rates climb, or eval scores drop. Send notifications to Slack, Discord, Microsoft Teams, email, webhooks, PagerDuty, or incident.io.
You can configure alerts for:
- Errors and volume: error rate, number of errors, total count of matching traces or spans.
- Latency: duration, time to first token, time to first chunk.
- Token usage: total, input, output, reasoning, cached tokens.
- Cost and eval scores: spend, the average score from a scorer you choose.
You could already create incident alerts in Mastra Platform to find out when a deploy failed or a service crashed. Observability alerts let you know when your agents' behavior falls outside the limits you set, even when the service is running normally. You get an alert before your bill gets too high or a user reports a problem.
Previously, you could watch the Metrics page yourself or export traces and build an alert in a tool like Datadog or Grafana. Now you can create alerts directly in Mastra Platform.
Get started
Set up your app to send traces to Mastra Platform. Run your agent and check that you can see its traces in your project.
note
Only organization admins can create, edit, and delete alerts. Members and viewers have read-only access.
Open the Mastra Platform dashboard and choose Alerts from the sidebar menu. Select New alert, then Observability alert, and choose a template.
For example, choose Tool failures to monitor how often each tool fails.
For your own alert, choose your project, set a threshold, and pick where to send notifications.
You can check the threshold across all matching traffic, or separately for each agent, tool, model, or user.
Use the Backtest chart to see when the rule would have opened and closed on recent traffic.
Adjust the threshold if needed, then select Create alert. Mastra checks enabled rules every five minutes.
To write your own query and condition from scratch, select Start blank instead of a template.
You can also create an alert from the Metrics dashboard. Just click the bell icon on a chart.
For more information and full configuration options, see:
来源: Mastra Blog · mastra.ai