@mastra/core
Version:
16 lines • 956 B
TypeScript
import type { Mastra } from '../mastra/index.js';
export declare const MODEL_USAGE_TELEMETRY_EVENT = "mastra_model_token_usage_v2";
export interface StartModelUsageTelemetryOptions {
/** How often accumulated usage is reported. Defaults to 15 minutes. */
reportIntervalMs?: number;
/** How long shutdown waits for the final report to be delivered. Defaults to 2 seconds. */
shutdownTimeoutMs?: number;
}
/**
* Starts reporting model token usage for this server process to Mastra's project-linked
* telemetry. Usage is read from the observability metrics bus, so it is only counted when
* observability is configured. Reports go out every 15 minutes when there is new usage,
* and once more when Mastra shuts down. Respects `MASTRA_TELEMETRY_DISABLED`. Never throws.
*/
export declare function startModelUsageTelemetry(mastra: Mastra, options?: StartModelUsageTelemetryOptions): void;
//# sourceMappingURL=model-usage-telemetry.d.ts.map