Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve trace search backward compatibility #5371

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions quickwit/quickwit-jaeger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ use quickwit_proto::jaeger::storage::v1::{
};
use quickwit_proto::opentelemetry::proto::trace::v1::status::StatusCode as OtlpStatusCode;
use quickwit_proto::search::{CountHits, ListTermsRequest, SearchRequest};
use quickwit_query::query_ast::{BoolQuery, QueryAst, RangeQuery, TermQuery};
use quickwit_query::query_ast::{BoolQuery, QueryAst, RangeQuery, TermQuery, UserInputQuery};
use quickwit_query::BooleanOperand;
use quickwit_search::{FindTraceIdsCollector, SearchService};
use serde::Deserialize;
use serde_json::Value as JsonValue;
Expand Down Expand Up @@ -321,13 +322,15 @@ impl JaegerService {
query.should.push(term_query.into());
}
if root_only {
// TODO this isn't backward compatible. We could do NOT is_root:false with a lenient
// UserInputQuery once we support being lenient on missing fields
let term_query = TermQuery {
field: "is_root".to_string(),
value: "true".to_string(),
// we do this so we don't error on old indexes, and instead return both root and non
// root spans
let is_root = UserInputQuery {
user_text: "NOT is_root:false".to_string(),
default_fields: None,
default_operator: BooleanOperand::And,
lenient: true,
};
query.must.push(term_query.into());
query.must.push(is_root.into());
}

let query_ast: QueryAst = query.into();
Expand Down
Loading