The deprecation warning says to use session_usage_updated instead, but that event gives cumulative session totals via AgentSessionUsage, not per-turn metrics. So it’s not a direct replacement for log_metrics.
Looking at the source, it seems ChatMessage.metrics is the new way to get per-turn latency data, but there’s no documentation on how to use it in practice.
Questions:
Is log_metrics still the right way to log per-turn metrics, or is there a new equivalent?
What’s the intended pattern for accessing per-turn metrics now — listening on conversation_item_added and reading ev.item.metrics?
Any plans to document session_usage_updated and ChatMessage.metrics properly?
Usage/cost data moves to session_usage_updated; per-turn latency moves to ChatMessage.metrics. Old listeners still work with a deprecation warning.
Looking at the source, it seems ChatMessage.metrics is the new way to get per-turn latency data, but there’s no documentation on how to use it in practice.
EOU follows the same migration as the rest of the deprecated metrics_collected event. The per-turn end-of-utterance fields (end_of_utterance_delay, transcription_delay, everything from EOUMetrics in livekit/agents/metrics/base.py) live on ChatMessage.metrics of the conversation_item_added event in the new model.
There’s no separate per-plugin EOU emitter the way RealtimeModel has one, because EOU is computed in the framework’s audio_recognition path, not in a user-pluggable component. The deprecated metrics_collected event still emits EOUMetrics with a deprecation warning per @darryncampbell’s #2 table, so it remains a transitional bridge until you fully cut over to conversation_item_added.
We are currently pulling end_of_turn_delay from Chat.metrics, but we still rely on the plugin-level metrics_collected events for TTFT and TTFB. Previously, we used the speech_id as a common key to map metrics (eou_delay, ttft and ttfb) for total latency calculations.
In the new migration, as ChatMessage.metrics (within conversation_item_added) does not include the speech_id,though it still exists in the LLMMetrics / TTSMetrics objects, how do you recommend correlating these metrics to calculate total latency?
I raised this difficulty (about speech_id) to our agents team, along with other issues raised by the community around the deprecation of this API, and we will not deprecate without an alternative. Thank you for raising this use case.