[ES] Refactor FindTraces and GetTrace of SpanReader to make them reusable for v2 APIs#6845
[ES] Refactor FindTraces and GetTrace of SpanReader to make them reusable for v2 APIs#6845yurishkuro merged 14 commits intojaegertracing:mainfrom
FindTraces and GetTrace of SpanReader to make them reusable for v2 APIs#6845Conversation
|
Fixing tests! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6845 +/- ##
==========================================
- Coverage 96.05% 96.05% -0.01%
==========================================
Files 367 368 +1
Lines 20831 20844 +13
==========================================
+ Hits 20010 20021 +11
- Misses 626 628 +2
Partials 195 195
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:
|
internal/storage/v1/elasticsearch/spanstore/internal/dbmodel/model.go
Outdated
Show resolved
Hide resolved
## Which problem is this PR solving? Fixes a part of #6458 ## Description of the changes - As discussed in the comment #6845 (comment), legacy trace id is moved to feature gate ## How was this change tested? - Unit and Integration tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/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 - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
| { | ||
| traceID: traceIDHigh, | ||
| query: elastic.NewTermQuery(traceIDField, "00000000000000010000000000000001"), | ||
| disableLegacyIdsEnabled: true, |
There was a problem hiding this comment.
this same test with false should produce two queries, one of them for 10000000000000001
There was a problem hiding this comment.
It's already there, please see the second test
|
|
||
| // Trace is the type of traces | ||
| type Trace struct { | ||
| Spans []*Span |
There was a problem hiding this comment.
can we do without pointer?
| Spans []*Span | |
| Spans []Span |
There was a problem hiding this comment.
Even I wanted to do that but then I was concerned that it might increase the diff, as all the methods in core reader are returing pointers. Should I do that refactoring in this PR? Or a separate PR after this?
| // GetTrace takes a traceID and returns a Trace associated with that traceID | ||
| GetTrace(ctx context.Context, query spanstore.GetTraceParameters) (*model.Trace, error) | ||
| // GetTraces takes a traceID and returns a Trace associated with that traceID | ||
| GetTraces(ctx context.Context, query []dbmodel.TraceID) ([]*dbmodel.Trace, error) |
There was a problem hiding this comment.
in the next PR can we try to get rid of all the pointers in the signatures? They are not providing any value, only forcing extra memory allocations.
…reusable for v2 APIs (jaegertracing#6845) ## Which problem is this PR solving? Fixes a part of: jaegertracing#6458 ## Description of the changes - Refactoring of `FindTraces` and `GetTrace` to complete refactoring for ES Span Reader ## How was this change tested? - Unit tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/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 - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Manik2708 <mehtamanik96@gmail.com> Signed-off-by: sAchin-680 <mrmister680@gmail.com>
…gertracing#6848) ## Which problem is this PR solving? Fixes a part of jaegertracing#6458 ## Description of the changes - As discussed in the comment jaegertracing#6845 (comment), legacy trace id is moved to feature gate ## How was this change tested? - Unit and Integration tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/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 - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
…reusable for v2 APIs (jaegertracing#6845) ## Which problem is this PR solving? Fixes a part of: jaegertracing#6458 ## Description of the changes - Refactoring of `FindTraces` and `GetTrace` to complete refactoring for ES Span Reader ## How was this change tested? - Unit tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/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 - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
…gertracing#6848) ## Which problem is this PR solving? Fixes a part of jaegertracing#6458 ## Description of the changes - As discussed in the comment jaegertracing#6845 (comment), legacy trace id is moved to feature gate ## How was this change tested? - Unit and Integration tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/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 - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Manik2708 <mehtamanik96@gmail.com> Signed-off-by: amol-verma-allen <amol.verma@allen.in>
…reusable for v2 APIs (jaegertracing#6845) ## Which problem is this PR solving? Fixes a part of: jaegertracing#6458 ## Description of the changes - Refactoring of `FindTraces` and `GetTrace` to complete refactoring for ES Span Reader ## How was this change tested? - Unit tests ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/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 - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Manik2708 <mehtamanik96@gmail.com> Signed-off-by: amol-verma-allen <amol.verma@allen.in>
Which problem is this PR solving?
Fixes a part of: #6458
Description of the changes
FindTracesandGetTraceto complete refactoring for ES Span ReaderHow was this change tested?
Checklist
jaeger:make lint testjaeger-ui:npm run lintandnpm run test