Skip to main content

遥测 API

🌐 Telemetry API

Telemetry API 提供了从你的 Mastra 应用中获取和分析追踪的方法。这有助于你监控和调试应用的行为和性能。

🌐 The Telemetry API provides methods to retrieve and analyze traces from your Mastra application. This helps you monitor and debug your application's behavior and performance.

获取追踪
Direct link to 获取追踪

🌐 Getting Traces

检索跟踪记录,可选择过滤和分页:

🌐 Retrieve traces with optional filtering and pagination:

const telemetry = await mastraClient.getTelemetry({
name: "trace-name", // Optional: Filter by trace name
scope: "scope-name", // Optional: Filter by scope
page: 1, // Optional: Page number for pagination
perPage: 10, // Optional: Number of items per page
attribute: {
// Optional: Filter by custom attributes
key: "value",
},
});