Skip to content

search: fix trace fragmentation and restructure spans#6587

Closed
loutPhilipps wants to merge 1 commit into
mainfrom
lout.philipps/fragmentation
Closed

search: fix trace fragmentation and restructure spans#6587
loutPhilipps wants to merge 1 commit into
mainfrom
lout.philipps/fragmentation

Conversation

@loutPhilipps

@loutPhilipps loutPhilipps commented Jul 10, 2026

Copy link
Copy Markdown

This PR fixes a few issues with how traces are emitted to Datadog:

  • nest per-split spans under multi_index_leaf_search
  • remove duplicate grpc adapter spans
  • add more granularity: plan_splits_for_root_search, list_relevant_splits, fetch_docs_in_split, and a per-split wrapper (leaf_search_single_split_wrapper) so each split's wait + warmup + tantivy form one subtree
  • split the CPU-pool queue wait out of tantivy_search into waiting_for_cpu_pool.
  • surface search_partial_hits_phase to have all leaves as children
image

🤖 Generated with Claude Code

Per-split leaf work was spawned without propagating the current span,
starting a new trace instead of nesting under multi_index_leaf_search.
Also prunes collinear gRPC-adapter spans, adds spans for distinct
phases (plan_splits_for_root_search, list_relevant_splits,
fetch_docs_in_split, leaf_search_single_split_wrapper), splits the
CPU-pool queue wait out of tantivy_search, and surfaces
search_partial_hits_phase at INFO.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@loutPhilipps
loutPhilipps marked this pull request as ready for review July 10, 2026 16:16
@loutPhilipps
loutPhilipps requested a review from a team as a code owner July 10, 2026 16:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ecbd534cac

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread quickwit/quickwit-serve/src/search_api/grpc_adapter.rs
/// at the entry of a gRPC handler that is itself wrapped in a
/// `#[tracing::instrument]` so the handler's span is stitched into the
/// caller's trace.
pub fn set_current_span_parent_from_metadata(metadata: &MetadataMap) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this no longer needed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually still needed here, good catch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants