Skip to content

perf(tracing): add llm.turn_call span to main-turn LLM call#3623

Merged
bug-ops merged 1 commit intomainfrom
add-tracing-span-chat-stream
May 5, 2026
Merged

perf(tracing): add llm.turn_call span to main-turn LLM call#3623
bug-ops merged 1 commit intomainfrom
add-tracing-span-chat-stream

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented May 5, 2026

Summary

  • Rename llm_call tracing span to llm.turn_call in native.rs (both production and test paths)
  • Add provider field to the span so traces identify the active LLM backend
  • Avoid naming collision with existing llm.chat_stream spans at the provider layer (compatible.rs, ollama.rs)
  • Update book/src/advanced/observability.md span reference table

Motivation

The main-turn LLM call was a silent gap in local Chrome traces — ~15 s of unattributed latency inside agent.turn. This change makes the span visible as llm.turn_call with model and provider attributes, enabling bottleneck detection in Perfetto / chrome://tracing.

Test plan

  • All 1350 zeph-core tests pass
  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler" -- -D warnings — 0 warnings
  • Docs build without broken intra-doc links
  • No sensitive data in span fields (security audit passed)
  • Zero measurable performance overhead (span already existed, only renamed + one &'static str field added)

Closes #3619

@github-actions github-actions Bot added performance Performance improvements size/S Small PR (11-50 lines) documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate labels May 5, 2026
Rename existing llm_call spans in native.rs to llm.turn_call and add a
provider field. The new name avoids collision with llm.chat_stream spans
emitted at the provider layer (compatible.rs, ollama.rs). Both the
production path (call_chat_with_tools) and the test path
(call_llm_with_timeout) are updated.

Closes #3619
@bug-ops bug-ops enabled auto-merge (squash) May 5, 2026 22:38
@bug-ops bug-ops force-pushed the add-tracing-span-chat-stream branch from 2d88be4 to 3393afa Compare May 5, 2026 22:38
@bug-ops bug-ops merged commit f36fab2 into main May 5, 2026
36 checks passed
@bug-ops bug-ops deleted the add-tracing-span-chat-stream branch May 5, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate documentation Improvements or additions to documentation performance Performance improvements rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: add tracing span for main-turn chat_stream LLM call

1 participant