-
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
Add optional time window for GetTrace & SearchTrace of http_handler #6159
Add optional time window for GetTrace & SearchTrace of http_handler #6159
Conversation
cb5f24f
to
d00b4d3
Compare
a0bb411
to
74fd1e5
Compare
please rebase |
7c3ab0c
to
3d939f2
Compare
@yurishkuro Updated bsaed on comments, please reivew this PR, thanks |
@rim99 this PR is too large, please break it into logical pieces. At minimum grpc storage changes could be a separate PR, e.g. changing the IDL. The anonymizer change can be separate. |
you have jaeger-ui submodule change, it's not related |
Cool, I'll keep creating new PRs and rebasing until we're satisfied with the size of this PR. And first PR is: #6242 . Other changes rely on this |
Signed-off-by: Zhang Xin <zhangxin@outlook.com>
295a9f3
to
a35d464
Compare
@yurishkuro Now this PR contains changes of http_handler only, please review |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6159 +/- ##
==========================================
- Coverage 96.22% 96.21% -0.01%
==========================================
Files 361 362 +1
Lines 20621 20705 +84
==========================================
+ Hits 19843 19922 +79
- Misses 595 599 +4
- Partials 183 184 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Zhang Xin <zhangxin@outlook.com>
55ea627
to
d8fc5f9
Compare
Signed-off-by: Zhang Xin <zhangxin@outlook.com>
cmd/query/app/http_handler.go
Outdated
TraceID: traceID, | ||
TraceID: traceID, | ||
StartTime: startTime, | ||
EndTime: endTime, |
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.
from the start of the function up to this point it's the same code as in getTrace. Please move it to parseGetTraceParameters
helper
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.
done
var response structuredResponse | ||
err := getJSON(ts.server.URL+`/api/traces?traceID=1&`+tc.query, &response) | ||
require.Error(t, err) | ||
}) |
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.
how is this test different from the one on L426?
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.
updated with multiple traceIds
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.
Actually, URIs are different:
- this is
/api/traces?traceID=1
, with a ? - the other is
/api/traces/traceID=1
, with a / in the same position
These are handled by different handler methods
Signed-off-by: Zhang Xin <zhangxin@outlook.com>
Signed-off-by: Zhang Xin <zhangxin@outlook.com>
Signed-off-by: Zhang Xin <zhangxin@outlook.com>
f9d81a5
to
3c56050
Compare
cmd/query/app/http_handler.go
Outdated
|
||
func (aH *APIHandler) parseGetTraceParameters(w http.ResponseWriter, r *http.Request) (spanstore.GetTraceParameters, bool) { | ||
traceID, traceIdOk := aH.parseTraceID(w, r) | ||
startTime, startTimeOk := aH.parseMicroseconds(w, r, startTimeParam) |
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 defer checking the error like that because helper functions already called aH.handleError
which writes to the client (you cannot do that more than once).
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.
I see, updated as checking result immediately
Signed-off-by: Zhang Xin <zhangxin@outlook.com>
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