Skip to content

RTC and Turn Execution Logs

RTC is the core mechanism for LLM to call external tools. Each tool call creates an RTC instance. A Turn is a complete execution round of an Agent, which may contain multiple RTCs. These logs allow you to trace the full tool execution chain.

EventTriggerKey Fields
[SubmitRtcResult]Client submits RTC execution resultuser, rtc, success
[SubmitRtcResult] idempotent repeatDuplicate submission (idempotent deduplication)rtc, status, client_id
[UpdateRtcStatus]RTC status changeduser, rtc, status
rtcToolBase.rtc_createdRTC instance createdrtc_id, session_id, turn_id
EventTriggerKey Fields
[turnagent] createTurn.createdTurn createdturn_id, session_id, work_kind
[turnagent] createTurn.idempotent_hitIdempotent creation hit cacheturn_id, session_id
[turnagent] beginTurn.doneTurn execution startedturn_id, session_id
[turnagent] completeTurn.doneTurn completed normallyturn_id, session_id
[turnagent] cancelTurn.doneTurn cancelledturn_id, session_id
[turnagent] failTurn.doneTurn execution failedturn_id, session_id
[turnagent] interruptTurn.doneTurn interruptedturn_id, session_id, interrupt_id
[turnagent] resumeTurn.doneTurn resumed executionturn_id

Execution Layer (Turn Internal State Machine)

Section titled “Execution Layer (Turn Internal State Machine)”
EventTriggerKey Fields
[turnagent] turn.startTurn execution startedturn_id, session_id, work_kind, work_id
[turnagent] turn.waiting_completionTurn waiting for LLM/RTC completionturn_id, session_id, work_id
[turnagent] turn.work_completedTurn work completedturn_id, session_id, work_id
[turnagent] turn.loop_exitedTurn loop exitedturn_id, session_id, work_kind, exit_reason, has_error
[turnagent] turn.clean_exitTurn clean exitturn_id, session_id, message
[turnagent] turn.endTurn ended (final event)turn_id, session_id, work_kind, status, duration_ms
[turnagent] interruptTurn interrupted (with reason)turn_id, session_id, interrupt_id, interrupt_count, reason
EventTriggerKey Fields
[rtcqueue] worker.received_notificationWorker received notificationsession_id
[rtcqueue] worker.claimingWorker attempting to claim tasksession_id, worker_id
[rtcqueue] worker.claimedWorker claimed successfullysession_id, credential, work_id
[rtcqueue] worker.claim_emptyWorker claim failed (queue empty)session_id
[rtcqueue] worker.processing_workWorker started processingsession_id, work_id, hold_lock
[rtcqueue] worker.loaded_workWorker loaded work datasession_id, work_id
[rtcqueue] worker.calling_onworkWorker calling processing callbacksession_id, work_id
[rtcqueue] worker.onwork_returnedWorker processing completed, returnedsession_id, work_id
[rtcqueue] worker.queue_empty_releasing_lockQueue emptied, releasing Session locksession_id
EventTriggerKey Fields
[turnagent] tool.call_failedTool call failed (e.g. interrupted)tool_name, session_id, turn_id, error
[turnagent] agent.processAgent started processing worksession_id, work_id, kind (submit/resume)
EventTriggerKey Fields
[resumeTurnAfterRtc] entryAttempt to recover Turn after RTC completionrtc, turn, remaining
[resumeTurnAfterRtc] batch progressBatch recovery progressrtc, turn, remaining
[resumeTurnAfterRtc] batch itemBatch recovery single itemrtc_id, interrupt_id, result_len
[resumeTurnAfterRtc] batch complete, resuming turnBatch recovery complete, resuming Turnturn, session, batch_size
[resumeTurnAfterRtc] resume publishedRecovery event published to queuertc, session, turn, batch_size
[resumeTurnAfterRtc] skip: session closedSkip recovery (Session closed)rtc, session
[resumeTurnAfterRtc] orphan submit publishedOrphan RTC submission publishedrtc, session
EventTriggerKey Fields
[StopActiveTurns] cancelled turnsBatch cancel active Turnssession, count
{service="server"} | json rtc="rtc", rtc_id="rtc_id" | msg=~"\\[SubmitRtcResult\\]|\\[UpdateRtcStatus\\]|rtcToolBase\\.rtc_created|\\[resumeTurnAfterRtc\\]" | rtc_id="rtc-123"
{service="server"} | json | msg="rtcToolBase.rtc_created"

Troubleshoot RTC result submission failures

Section titled “Troubleshoot RTC result submission failures”
{service="server"} | json | msg="[SubmitRtcResult]" | json success="success" | success="false"

View duplicate submissions (may indicate client retry issues)

Section titled “View duplicate submissions (may indicate client retry issues)”
{service="server"} | json | msg="[SubmitRtcResult] idempotent repeat"

Trace the complete execution flow of a Turn

Section titled “Trace the complete execution flow of a Turn”
{service="server"} | json turn_id="turn_id", session_id="session_id" | msg=~"\\[turnagent\\] (create|begin|complete|cancel|fail|interrupt|resume)Turn" | turn_id="turn-456"
{service="server"} | json | msg="[turnagent] failTurn.done"
{service="server"} | json | msg="[turnagent] interruptTurn.done"

View Turn execution rate (by type and status)

Section titled “View Turn execution rate (by type and status)”
sum by (work_kind, status) (rate(rtc_turn_total[5m]))
histogram_quantile(0.95, sum(rate(rtc_turn_duration_seconds_bucket[5m])) by (le, work_kind))

Troubleshoot Turn recovery anomalies (has entry but no completion)

Section titled “Troubleshoot Turn recovery anomalies (has entry but no completion)”
{service="server"} | json | msg=~"\\[resumeTurnAfterRtc\\] (entry|batch complete|skip|orphan)"

Sort by rtc field. If there is an entry but no corresponding completion event, the recovery process is abnormal.

{service="server"} | json | msg=~"\\[resumeTurnAfterRtc\\].*(failed|error)"
{service="server"} | json session="session", count="count" | msg="[StopActiveTurns] cancelled turns"

View all Turn activity for a specific Session

Section titled “View all Turn activity for a specific Session”
{service="server"} | json session_id="session_id", session="session" | msg=~"\\[turnagent\\]|\\[StopActiveTurns\\]|\\[resumeTurnAfterRtc\\]|\\[rtcqueue\\]" | session_id="session-abc"
{service="server"} | json turn_id="turn_id" | msg=~"\\[turnagent\\] turn\\.(start|waiting_completion|work_completed|loop_exited|clean_exit|end)" | turn_id="turn-456"
{service="server"} | json turn_id="turn_id", status="status", duration_ms="duration_ms", work_kind="work_kind" | msg="[turnagent] turn.end"
{service="server"} | json turn_id="turn_id", exit_reason="exit_reason", has_error="has_error" | msg="[turnagent] turn.loop_exited"
{service="server"} | json has_error="has_error" | msg="[turnagent] turn.loop_exited" | has_error="true"
{service="server"} | json session_id="session_id", work_id="work_id" | msg=~"\\[rtcqueue\\] worker\\.(claiming|claimed|claim_empty|processing_work|onwork_returned)"
{service="server"} | json session_id="session_id" | msg="[rtcqueue] worker.claim_empty"
{service="server"} | json tool_name="tool_name", error="error", session_id="session_id" | msg="[turnagent] tool.call_failed"
{service="server"} | json turn_id="turn_id", interrupt_id="interrupt_id", reason="reason", interrupt_count="interrupt_count" | msg="[turnagent] interrupt"
{service="server"} | json session_id="session_id", work_id="work_id", kind="kind" | msg="[turnagent] agent.process"
MetricTypeLabelsPurpose
rtc_turn_totalCounterwork_kind, statusTotal Turn count
rtc_turn_duration_secondsHistogramwork_kind, statusTurn execution duration
rtc_stale_turns_recovered_totalCounterstatusStale Turn recovery statistics
# Turn success/failure rate
sum by (status) (rate(rtc_turn_total[5m]))
# Turn execution latency P50 / P95 / P99
histogram_quantile(0.50, sum(rate(rtc_turn_duration_seconds_bucket[5m])) by (le))
histogram_quantile(0.95, sum(rate(rtc_turn_duration_seconds_bucket[5m])) by (le))
histogram_quantile(0.99, sum(rate(rtc_turn_duration_seconds_bucket[5m])) by (le))
# Stale Turns recovered per minute
sum(rate(rtc_stale_turns_recovered_total[5m])) by (status)
AlertConditionDescription
High Turn failure raterate(rtc_turn_total{status="failed"}[5m]) / rate(rtc_turn_total[5m]) > 0.1More than 10% of Turns fail
High Turn latencyhistogram_quantile(0.95, ...) > 60P95 latency exceeds 60 seconds
Frequent stale Turn recoveryrate(rtc_stale_turns_recovered_total[5m]) > 0.5More than 30 stale Turns recovered per minute