Skip to main content

init_telemetry

Function init_telemetry 

Source
pub fn init_telemetry(
    runtime: &AgentRuntime,
    session_id: String,
    node_id: String,
    model: String,
) -> ObserverHandle
Expand description

Initialise telemetry for an agent runtime.

Registers an on_turn_end hook that sends TurnContext data through a channel to an independent observer task. The observer task builds TurnMetrics and accumulates SessionMetrics — it never blocks the agent runtime hot path.

Returns an ObserverHandle that can be used to inject custom data or shut down the observer.