[es] Rename NumTraces to SearchDepth in ES v2 dbmodel#8611
Conversation
Renames NumTraces int to SearchDepth int inside TraceQueryParameters to align the ES internal dbmodel with the core v2 TraceQueryParameters API definition. This addresses a technical debt item marked with a TODO and fixes all associated references across core packages, readers, and unit tests. Signed-off-by: ayu. <aezyus1@gmail.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR aligns the Elasticsearch trace reader query parameter naming by replacing NumTraces with SearchDepth across the DB model, reader logic, and related tests.
Changes:
- Renamed
dbmodel.TraceQueryParameters.NumTracestoSearchDepth. - Updated trace query mapping and defaulting logic to use
SearchDepth. - Adjusted unit tests to construct queries using
SearchDepth.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/storage/v2/elasticsearch/tracestore/reader_test.go | Updates test query params to use SearchDepth instead of NumTraces. |
| internal/storage/v2/elasticsearch/tracestore/reader.go | Maps TraceQueryParams.SearchDepth into DB query params via the new SearchDepth field. |
| internal/storage/v2/elasticsearch/tracestore/core/reader_test.go | Updates core reader tests to set SearchDepth in query parameters. |
| internal/storage/v2/elasticsearch/tracestore/core/reader.go | Renames default constant and applies defaulting + aggregation sizing based on SearchDepth. |
| internal/storage/v2/elasticsearch/tracestore/core/dbmodel/model.go | Renames the field in TraceQueryParameters to SearchDepth. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
NumTraces to SearchDepth in ES v2 dbmodel
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8611 +/- ##
==========================================
+ Coverage 96.56% 96.57% +0.01%
==========================================
Files 331 331
Lines 17566 17566
==========================================
+ Hits 16963 16965 +2
+ Misses 454 453 -1
+ Partials 149 148 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
909a3a5
…ing#8611) Renames NumTraces int to SearchDepth int inside TraceQueryParameters to align the ES internal dbmodel with the core v2 TraceQueryParameters API definition. This addresses a technical debt item marked with a TODO and fixes all associated references across core packages, readers, and unit tests. ## Which problem is this PR solving? - Resolves jaegertracing#8601 ## Description of the changes - Renamed `NumTraces` -> `SearchDepth` fields inside the Elasticsearch internal `TraceQueryParameters` struct (`internal/storage/v2/elasticsearch/tracestore/core/dbmodel/model.go`). - Updated the `defaultNumTraces` constant to `defaultSearchDepth` and updated fallback assignment layers inside `internal/storage/v2/elasticsearch/tracestore/core/reader.go`. - Fixed structural field assignment logic within `internal/storage/v2/elasticsearch/tracestore/reader.go`. - Refactored all corresponding broken field references inside the associated `_test.go` suites. ## How was this change tested? - Validated build consistency locally. - Executed unit regression tests via `make test`. ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/main/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully: `make lint test` ## AI Usage in this PR (choose one) See [AI Usage Policy](https://github.com/jaegertracing/jaeger/blob/main/CONTRIBUTING_GUIDELINES.md#ai-usage-policy). - [ ] **None**: No AI tools were used in creating this PR - [x] **Light**: AI provided minor assistance (formatting, simple suggestions) - [ ] **Moderate**: AI helped with code generation or debugging specific parts - [ ] **Heavy**: AI generated most or all of the code changes Signed-off-by: ayu. <aezyus1@gmail.com> Signed-off-by: Victor Chidera Obiezue <obiezuechidera@gmail.com>
Renames NumTraces int to SearchDepth int inside TraceQueryParameters to align the ES internal dbmodel with the core v2 TraceQueryParameters API definition.
This addresses a technical debt item marked with a TODO and fixes all associated references across core packages, readers, and unit tests.
Which problem is this PR solving?
Description of the changes
NumTraces->SearchDepthfields inside the Elasticsearch internalTraceQueryParametersstruct (internal/storage/v2/elasticsearch/tracestore/core/dbmodel/model.go).defaultNumTracesconstant todefaultSearchDepthand updated fallback assignment layers insideinternal/storage/v2/elasticsearch/tracestore/core/reader.go.internal/storage/v2/elasticsearch/tracestore/reader.go._test.gosuites.How was this change tested?
make test.Checklist
make lint testAI Usage in this PR (choose one)
See AI Usage Policy.