Add search query to TraceFilters#294
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #294 +/- ##
=======================================
Coverage 76.57% 76.57%
=======================================
Files 26 26
Lines 918 918
=======================================
Hits 703 703
Misses 215 215 🚀 New features to boost your workflow:
|
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.
Pull Request
Short Summary
Moves the Lucene-style search query (
q) from a URL query parameter intoTraceFiltersas a first-classquery: Option<String>field. All three trace endpoints (/paginated,/facets,/spans/filters) previously accepted?q=<dsl>alongside a JSON body — now the DSL string travels in the body with everything else.Context
The old design split search state across two transport mechanisms: structured filters in the POST body, freetext DSL in the URL. That meant the server needed a dedicated
SearchQextractor, amerge_q_into_filtersfunction to stitch them together, and the client had to parse the query string, then mutate the resulting struct field-by-field to apply overrides. It was fiddly and the URL param was invisible to any caller buildingTraceFiltersdirectly.Before:
After:
normalize_trace_filtersreadsbody.query, parses it into aFilterClause, merges parsed fields into the body (body fields win on conflict), then clearsquerybefore passing the struct downstream. The DSL query field is consumed at the boundary — nothing downstream sees it.Python stubs and PyO3 bindings updated to expose
queryonTraceFilters.__init__.crates/scouter_types/src/trace/sql.rsquery: Option<String>field toTraceFilterscrates/scouter_server/src/api/routes/trace/route.rsSearchQ,?q=params, renames merge fn tonormalize_trace_filterscrates/scouter_client/src/http/client.rscrates/scouter_server/tests/api/trace.rsqueryin body, removes URL helperpy-scouter/python/scouter/_scouter.pyiqueryparam toTraceFiltersstubpy-scouter/python/scouter/stubs/tracing.pyipy-scouter/tests/integration/test_trace_filters.pyqueryfieldIs this a Breaking Change?
Yes. The
?q=query parameter is removed from all three trace endpoints. Any caller passing?q=<dsl>directly to the HTTP API must move the DSL string into the request body as"query": "<dsl>".