Skip to content

index: indexer hot-path async fns (index_project, index_batch, index_file) missing tracing instrument #4391

@bug-ops

Description

@bug-ops

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

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexityarchitectureArchitecture improvements

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions