Skip to content

feat(index): add tracing spans to zeph-index hot-path async fns#4393

Merged
bug-ops merged 1 commit into
mainfrom
index-tracing-spans
May 18, 2026
Merged

feat(index): add tracing spans to zeph-index hot-path async fns#4393
bug-ops merged 1 commit into
mainfrom
index-tracing-spans

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

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

Summary

  • Add #[tracing::instrument] to 13 async methods across CodeStore (store.rs) and CodeIndexer (indexer.rs) in zeph-index
  • Span names follow index.store.* / index.indexer.* convention; all use skip_all
  • Key fields recorded: file_path, chunk_count, root via tracing::field::display

Motivation

The CI trace analysis loop requires every async fn awaiting an external resource to be wrapped in a span. Without spans, indexing latency (embedding, Qdrant upsert, SQLite dedup) is invisible in traces, making regressions impossible to attribute.

Changes

crates/zeph-index/src/store.rs (6 methods):
upsert_chunk, upsert_chunks_batch, search, existing_hashes, remove_file_chunks, indexed_files

crates/zeph-index/src/indexer.rs (7 methods):
index_project, index_batch, index_file, reindex_file, ensure_collection_for_provider, walk_project_files, cleanup_removed_files

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy -p zeph-index --all-targets -- -D warnings — zero warnings
  • cargo nextest run -p zeph-index --lib — 107 passed, 0 failed
  • RUSTFLAGS="-D warnings" cargo check -p zeph-index --lib — clean
  • No behavioral changes — annotation-only diff (20 insertions)

Closes #4388, #4391

@github-actions github-actions Bot added enhancement New feature or request rust Rust code changes size/S Small PR (11-50 lines) labels May 18, 2026
Instrument all async methods in CodeStore and CodeIndexer that await
external resources (Qdrant, SQLite, file I/O, embeddings):

store.rs: upsert_chunk, upsert_chunks_batch, search, existing_hashes,
          remove_file_chunks, indexed_files
indexer.rs: index_project, index_batch, index_file, reindex_file,
            ensure_collection_for_provider, walk_project_files,
            cleanup_removed_files

All spans use skip_all with name = "index.store.*" / "index.indexer.*"
convention. Key fields (file_path, chunk_count, root) recorded via
tracing::field::display where applicable.

Closes #4388, #4391
@bug-ops bug-ops enabled auto-merge (squash) May 18, 2026 17:16
@bug-ops bug-ops force-pushed the index-tracing-spans branch from 08af62d to 8d84763 Compare May 18, 2026 17:16
@bug-ops bug-ops merged commit 74ef546 into main May 18, 2026
32 checks passed
@bug-ops bug-ops deleted the index-tracing-spans branch May 18, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

1 participant