Skip to content

refactor(tracing): add #[tracing::instrument] to hot-path async fns in index, commands, subagent#4826

Merged
bug-ops merged 1 commit into
mainfrom
4817-tracing-instrumentation
Jun 5, 2026
Merged

refactor(tracing): add #[tracing::instrument] to hot-path async fns in index, commands, subagent#4826
bug-ops merged 1 commit into
mainfrom
4817-tracing-instrumentation

Conversation

@bug-ops

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

Copy link
Copy Markdown
Owner

Summary

  • zeph-index: instrument retrieve_filtered, refresh, chunk_exists — hot-path code retrieval functions now visible in local Chrome JSON traces
  • zeph-commands: instrument CommandRegistry::dispatch behind profiling feature gate; adds profiling = [] to zeph-commands/Cargo.toml and propagates through zeph-core/profiling
  • zeph-subagent: instrument fire_hooks, fire_single_hook, fire_shell_hook — hook dispatch latency now visible in traces with hook_count field on the outer span

All 7 annotations use skip_all/skip(self) and match the existing style in each crate. No logic changes — tracing::instrument is a no-op without a registered subscriber.

Closes #4817, Closes #4820, Closes #4805

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy -p zeph-index -p zeph-commands -p zeph-core -p zeph-subagent -- -D warnings — clean
  • cargo clippy -p zeph-commands --features profiling -- -D warnings — clean (profiling path)
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked — clean
  • cargo nextest run -p zeph-index -p zeph-commands -p zeph-subagent --lib — 596/596 passed (108 + 105 + 383)

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes refactor Code refactoring without functional changes core zeph-core crate dependencies Dependency updates size/S Small PR (11-50 lines) labels Jun 5, 2026
@bug-ops bug-ops enabled auto-merge (squash) June 5, 2026 14:17
@bug-ops bug-ops force-pushed the 4817-tracing-instrumentation branch 2 times, most recently from 474e389 to bb00b5c Compare June 5, 2026 14:18
…n index, commands, subagent

Add tracing instrumentation to 7 uninstrumented pub async functions across three crates:

- zeph-index: retrieve_filtered, refresh, chunk_exists (spans: index.retriever.retrieve_filtered,
  index.mcp_server.refresh, index.store.chunk_exists)
- zeph-commands: CommandRegistry::dispatch (span: commands.dispatch, profiling-gated);
  add profiling feature to zeph-commands and propagate through zeph-core
- zeph-subagent: fire_hooks, fire_single_hook, fire_shell_hook (spans: subagent.hooks.fire,
  subagent.hooks.single, subagent.hooks.shell); fire_hooks records hook_count field

All annotations use skip_all or skip(self) and match the existing style in each crate.
No logic changes — tracing::instrument is a no-op without a subscriber.

Closes #4817, #4820, #4805
@bug-ops bug-ops force-pushed the 4817-tracing-instrumentation branch from bb00b5c to ff31dc8 Compare June 5, 2026 14:26
@bug-ops bug-ops merged commit ce8a897 into main Jun 5, 2026
32 checks passed
@bug-ops bug-ops deleted the 4817-tracing-instrumentation branch June 5, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation refactor Code refactoring without functional changes rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

1 participant