refactor(tracing): add #[tracing::instrument] to hot-path async fns in index, commands, subagent#4826
Merged
Merged
Conversation
474e389 to
bb00b5c
Compare
…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
bb00b5c to
ff31dc8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
retrieve_filtered,refresh,chunk_exists— hot-path code retrieval functions now visible in local Chrome JSON tracesCommandRegistry::dispatchbehindprofilingfeature gate; addsprofiling = []tozeph-commands/Cargo.tomland propagates throughzeph-core/profilingfire_hooks,fire_single_hook,fire_shell_hook— hook dispatch latency now visible in traces withhook_countfield on the outer spanAll 7 annotations use
skip_all/skip(self)and match the existing style in each crate. No logic changes —tracing::instrumentis a no-op without a registered subscriber.Closes #4817, Closes #4820, Closes #4805
Test plan
cargo +nightly fmt --check— cleancargo clippy -p zeph-index -p zeph-commands -p zeph-core -p zeph-subagent -- -D warnings— cleancargo 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— cleancargo nextest run -p zeph-index -p zeph-commands -p zeph-subagent --lib— 596/596 passed (108 + 105 + 383)