-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add optional time window in TraceGetParameters #6159
base: main
Are you sure you want to change the base?
Add optional time window in TraceGetParameters #6159
Conversation
17bddcc
to
cb5f24f
Compare
Signed-off-by: rim99 <[email protected]>
cb5f24f
to
d00b4d3
Compare
Signed-off-by: rim99 <[email protected]>
Signed-off-by: Zhang Xin <[email protected]>
Signed-off-by: rim99 <[email protected]>
a0bb411
to
74fd1e5
Compare
@@ -49,15 +50,27 @@ func unwrapNotFoundErr(err error) error { | |||
} | |||
|
|||
// QueryTrace queries for a trace and returns all spans inside it | |||
func (q *Query) QueryTrace(traceID string) ([]model.Span, error) { | |||
func (q *Query) QueryTrace(traceID string, startTime int64, endTime int64) ([]model.Span, 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.
we always try to use strong types. Conversion from user-facing values can be done at the user interface layer, not at this internal API.
func (q *Query) QueryTrace(traceID string, startTime int64, endTime int64) ([]model.Span, error) { | |
func (q *Query) QueryTrace(traceID string, startTime time.Time, endTime time.Time) ([]model.Span, error) { |
StartTime *time.Time | ||
EndTime *time.Time |
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.
time.Time
has IsZero
that can be used as an indication of "value not provided", instead of pointers.
@@ -50,6 +50,13 @@ type Reader interface { | |||
FindTraceIDs(ctx context.Context, query *TraceQueryParameters) ([]model.TraceID, error) | |||
} | |||
|
|||
// TraceGetParameters contains parameters of a trace get. | |||
type TraceGetParameters struct { |
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.
the name reads weird
type TraceGetParameters struct { | |
type GetTraceParameters struct { |
Which problem is this PR solving?
Resolves #4150
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test