Description
crates/zeph-index/src/indexer.rs contains the primary indexing loop. Four async fn methods await external resources (Qdrant embed, file I/O, SQLite) with no #[tracing::instrument] spans:
pub async fn index_project — top-level loop; awaits ensure_collection_for_provider and walk_project_files
async fn index_batch — per-batch embedding + upsert; awaits index_file for each file
async fn index_file — reads file bytes via tokio::fs, calls embed, calls upsert_chunks_batch
pub async fn reindex_file — incremental re-index on watcher trigger
ensure_collection_for_provider calls provider.embed("probe") — an LLM round-trip — with no span.
Without spans the trace view shows only a flat wall-clock gap during indexing, making it impossible to attribute latency to embedding, dedup lookup, or Qdrant upsert.
This violates the project's continuous-improvement instrumentation requirement (CLAUDE.md: "every async fn that awaits an external resource MUST be wrapped in a tracing span").
Expected Behavior
All four methods carry #[tracing::instrument(name = "index.indexer.*", skip_all)]. ensure_collection_for_provider carries #[tracing::instrument(name = "index.indexer.ensure_collection", skip_all)].
Actual Behavior
Zero #[tracing::instrument] annotations in indexer.rs.
Environment
- Crate:
zeph-index
- File:
crates/zeph-index/src/indexer.rs
Description
crates/zeph-index/src/indexer.rscontains the primary indexing loop. Fourasync fnmethods await external resources (Qdrant embed, file I/O, SQLite) with no#[tracing::instrument]spans:pub async fn index_project— top-level loop; awaitsensure_collection_for_providerandwalk_project_filesasync fn index_batch— per-batch embedding + upsert; awaitsindex_filefor each fileasync fn index_file— reads file bytes viatokio::fs, callsembed, callsupsert_chunks_batchpub async fn reindex_file— incremental re-index on watcher triggerensure_collection_for_providercallsprovider.embed("probe")— an LLM round-trip — with no span.Without spans the trace view shows only a flat wall-clock gap during indexing, making it impossible to attribute latency to embedding, dedup lookup, or Qdrant upsert.
This violates the project's continuous-improvement instrumentation requirement (CLAUDE.md: "every async fn that awaits an external resource MUST be wrapped in a tracing span").
Expected Behavior
All four methods carry
#[tracing::instrument(name = "index.indexer.*", skip_all)].ensure_collection_for_providercarries#[tracing::instrument(name = "index.indexer.ensure_collection", skip_all)].Actual Behavior
Zero
#[tracing::instrument]annotations inindexer.rs.Environment
zeph-indexcrates/zeph-index/src/indexer.rs