-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[WIP][v2][storage] Create v2 query service to operate on otlp data model #6343
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Mahad Zaryab <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6343 +/- ##
==========================================
- Coverage 96.27% 95.90% -0.38%
==========================================
Files 367 368 +1
Lines 20978 21060 +82
==========================================
Hits 20197 20197
- Misses 597 679 +82
Partials 184 184
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…e on otlp format (#6396) ## Which problem is this PR solving? - Towards #6344 ## Description of the changes - Implemented a function `StandardAdjusters` that returns a list of adjusters to be applied on ptrace.Traces - This will be used by the v2 query service in #6343 ## 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: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
func (qs QueryServiceV2) Adjust(tracesIter iter.Seq[[]ptrace.Traces]) { | ||
tracesIter(func(traces []ptrace.Traces) bool { | ||
for _, trace := range traces { | ||
qs.options.Adjuster.Adjust(trace) | ||
} | ||
return true | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yurishkuro Did I understand correctly in that this is what we wanted here? Or did you mean that we should change the underlying adjusters themselves to work on Seq?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you understood correctly. However, because adjusting needs to re-arrange the data I think this func should return Seq[ptrace.Traces]
where each item is fully adjusted trace.
Signed-off-by: Mahad Zaryab <[email protected]>
@yurishkuro Should this be classified as a new feature or a minor feature? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
func (qs QueryServiceV2) Adjust(tracesIter iter.Seq[[]ptrace.Traces]) { | ||
tracesIter(func(traces []ptrace.Traces) bool { | ||
for _, trace := range traces { | ||
qs.options.Adjuster.Adjust(trace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you cannot assume here that trace
is a full trace, you need to clump consecutive chunks if they are for the same trace ID. We can implement a helper function for that that will take Seq[[]ptrace.Traces]
and return Seq[ptrace.Traces]
where each item is a full trace. Similar to what I was suggesting in https://github.com/jaegertracing/jaeger/pull/6388/files#r1894703201
func (qs QueryServiceV2) Adjust(tracesIter iter.Seq[[]ptrace.Traces]) { | ||
tracesIter(func(traces []ptrace.Traces) bool { | ||
for _, trace := range traces { | ||
qs.options.Adjuster.Adjust(trace) | ||
} | ||
return true | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you understood correctly. However, because adjusting needs to re-arrange the data I think this func should return Seq[ptrace.Traces]
where each item is fully adjusted trace.
This is more like a refactoring, not a new feature. |
Signed-off-by: Mahad Zaryab <[email protected]>
// The iterator is single-use: once consumed, it cannot be used again. | ||
func (qs QueryServiceV2) GetTraces( | ||
ctx context.Context, | ||
traceIDs ...tracestore.GetTraceParams) iter.Seq2[[]ptrace.Traces, error] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
traceIDs ...tracestore.GetTraceParams) iter.Seq2[[]ptrace.Traces, error] { | |
traceIDs ...tracestore.GetTraceParams, | |
) iter.Seq2[[]ptrace.Traces, error] { |
Which problem is this PR solving?
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test