Skip to content

Conversation

@toubatbrian
Copy link
Contributor

@toubatbrian toubatbrian commented Nov 17, 2025

Add tracing and structured logging to agents-js with 100% Python parity.

Breakdown

✅ Implemented in TypeScript: 20/20 Active Spans

Span Name Python TypeScript Status
job_entrypoint job.py:739 job_proc_lazy_main.ts:105
llm_request llm.py:177 llm.ts:192
llm_request_run llm.py:~184 llm.ts:147
llm_node generation.py:86 generation.ts:475
tts_request (streaming) tts.py:367 tts.ts:217
tts_request (non-streaming) tts.py:241 tts.ts:478
tts_request_run tts.py:~380,~254 tts.ts:171,432
tts_node generation.py:214 generation.ts:531
agent_session agent_session.py:519 agent_session.ts:322
agent_turn agent_activity.py:1673 agent_activity.ts:1654
agent_turn (realtime) agent_activity.py:2086 (realtime flow)
user_turn audio_recognition.py:660 audio_recognition.ts:571
function_tool generation.py:544 generation.ts:859
agent_speaking agent_session.py:1159 agent_session.ts:515
user_speaking agent_session.py:1190 agent_session.ts:554
start_agent_activity agent_activity.py:425 agent_activity.ts:210
drain_agent_activity agent_activity.py:577 agent_activity.ts:2167
on_enter agent_activity.py:446 agent_activity.ts:304
on_exit agent_activity.py:584 agent_activity.ts:2183
eou_detection audio_recognition.py:~493 audio_recognition.ts:366

⏸️ Python-Specific Features (Not in TS): 2

Span Name Python Reason
resume_agent_activity agent_activity.py:635 Pause/resume not in TS
pause_agent_activity agent_activity.py:656 Pause/resume not in TS

Pause/resume functionality doesn't exist in TypeScript agent_activity yet.

N/A (Feature Not in TypeScript): 1

Span Name Python Reason
judge_evaluation run_result.py:829 Judge feature not implemented in TS
📈 Span Summary:
  - start_agent_activity: 1
  - on_enter: 1
  - job_entrypoint: 1
  - user_speaking: 4
  - eou_detection: 3
  - user_turn: 3
  - llm_request_run: 5
  - llm_request: 5
  - llm_node: 5
  - tts_node: 5
  - agent_speaking: 3
  - agent_turn: 5
  - function_tool: 2
  - on_exit: 1
  - drain_agent_activity: 1
  - agent_session: 1

🌳 Span Hierarchies:

Trace 1 (job_entrypoint):
└─ job_entrypoint (5474.11ms)
   └─ agent_session (55046.00ms)
      ├─ start_agent_activity (3.33ms)
         └─ on_enter (2.76ms)
      ├─ user_speaking (1469.25ms)
      ├─ user_turn (2091.39ms)
      │  transcript: "Hello can you hear me."
      ├─ agent_turn (6292.53ms)
      │  speech_id: speech_a6409301-17d
      │  user_input: "Hello can you hear me."
         ├─ llm_node (2142.84ms)
            └─ llm_request (2138.71ms)
               model: openai/gpt-4.1-mini
               tokens: 94→17
               └─ llm_request_run (2138.31ms)
         └─ tts_node (3628.79ms)
      ├─ eou_detection (106.69ms)
      ├─ agent_speaking (3715.15ms)
      ├─ user_speaking (2561.00ms)
      ├─ user_turn (4942.13ms)
      │  transcript: "What is the weather only san francisco."
      ├─ user_speaking (1444.43ms)
      ├─ agent_turn (2596.05ms)
      │  speech_id: speech_4960de9e-9a5
      │  user_input: "What is the weather only san francisco."
         ├─ llm_node (2195.47ms)
            └─ llm_request (2194.23ms)
               model: openai/gpt-4.1-mini
               tokens: 127→15
               └─ llm_request_run (2194.12ms)
         ├─ tts_node (2195.61ms)
         └─ function_tool (501.37ms)
            tool: getWeather
      ├─ eou_detection (36.99ms)
      ├─ agent_turn (6425.45ms)
      │  speech_id: speech_7b4ef0c0-26e
         ├─ llm_node (1407.95ms)
            └─ llm_request (1406.97ms)
               model: openai/gpt-4.1-mini
               tokens: 162→16
               └─ llm_request_run (1406.73ms)
         └─ tts_node (3148.83ms)
      ├─ agent_speaking (4502.66ms)
      ├─ user_speaking (1627.59ms)
      ├─ user_turn (2578.55ms)
      │  transcript: "What's the time."
      ├─ agent_turn (2073.87ms)
      │  speech_id: speech_8cb6d87e-726
      │  user_input: "What's the time."
         ├─ llm_node (2072.98ms)
            └─ llm_request (2071.19ms)
               model: openai/gpt-4.1-mini
               tokens: 189→11
               └─ llm_request_run (2071.10ms)
         ├─ tts_node (2072.82ms)
         └─ function_tool (0.26ms)
            tool: getCurrentTime
      ├─ eou_detection (28.43ms)
      ├─ agent_turn (5553.00ms)
      │  speech_id: speech_76a71364-ef7
         ├─ llm_node (2407.05ms)
            └─ llm_request (2405.40ms)
               model: openai/gpt-4.1-mini
               tokens: 217→11
               └─ llm_request_run (2405.34ms)
         └─ tts_node (3532.38ms)
      ├─ agent_speaking (2648.94ms)
      └─ drain_agent_activity (0.30ms)
         └─ on_exit (0.15ms)

@changeset-bot
Copy link

changeset-bot bot commented Nov 17, 2025

⚠️ No Changeset found

Latest commit: 780d42e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@toubatbrian toubatbrian changed the title https://linear.app/livekit/issue/AGT-2197/otel-logging-integration-and-system-wise-traces brian/system-span-logging Nov 17, 2025
@toubatbrian toubatbrian changed the title brian/system-span-logging OTEL logging integration & System-wise Traces Nov 17, 2025
@toubatbrian toubatbrian requested review from a team and Shubhrakanti November 17, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants