fix: Jaeger API returns 404 for recently ingested traces #109
Open
shreyas-quizizz wants to merge 1 commit intoVictoriaMetrics:masterfrom
Open
fix: Jaeger API returns 404 for recently ingested traces #109shreyas-quizizz wants to merge 1 commit intoVictoriaMetrics:masterfrom
shreyas-quizizz wants to merge 1 commit intoVictoriaMetrics:masterfrom
Conversation
…shed
Jaeger GET /api/traces/{id} returns 404 for ~60s after ingestion because
GetTrace() relies on the trace ID index stream, which is delayed by the
double-buffer flush in vtinsert. Span data is already queryable via
vtselect during this window. When the index lookup returns
ErrOutOfRetention, fall back to searching span data directly over a
recent time window (default 5m) via findSpansByTraceIDAndTime().
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Describe Your Changes
Jaeger
GET /api/traces/{id}returns 404 for ~60s after ingestion, while the same trace isimmediately queryable via vtselect. This happens because
GetTrace()relies on the trace IDindex stream, which hasn't been flushed yet due to the double-buffer delay in vtinsert. When
the index lookup returns
ErrOutOfRetention, it returns empty instead of falling back tospan data.
This change adds a fallback to search span data directly via
findSpansByTraceIDAndTime()over a recent time window when the index is not yet available. The fallback window is
configurable via
-search.recentTraceFallbackWindow(default 5m).Checklist
The following checks are mandatory:
rics.com/victoriametrics/contributing/#pull-request-checklist).
goals.
Summary by cubic
Fixes Jaeger GET /api/traces/{id} returning 404 for ~60s after ingestion by falling back to span search when the trace ID index hasn’t flushed yet. Adds -search.recentTraceFallbackWindow (default 5m) to define the recent window for this fallback.
Written for commit 41f09b5. Summary will update on new commits.