Skip to content

Function: attachChatTurnTelemetry()

attachChatTurnTelemetry(app, options?): void

Install chatTurnTelemetryMiddleware on a Mastra Express sub-app.

Call before MastraServer.init() so the layer sits ahead of the agent routes. Safe to call unconditionally: when no recording tracer is registered, the middleware is a no-op.

Express

ChatTurnTelemetryOptions = {}

void