-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 metrics to the native queries underpinning SQL. #4561
Conversation
8140730
to
66ccd29
Compare
66e6f90
to
57fec55
Compare
Resolved merge conflicts and force pushed, since I think nobody has looked at this yet. |
This is done by factoring out the metrics and request log emitting code from QueryResource into a new QueryLifecycle class. That class is used by both QueryResource and the SQL DruidSchema and QueryMaker. Also fixes a couple of bugs in QueryResource: - RequestLogLine start time was set to `TimeUnit.NANOSECONDS.toMillis(startNs)`, which is incorrect since absolute nanos cannot be converted to millis. - DruidMetrics.makeRequestMetrics was called with null `query` on unparseable queries, which led to spurious "Unable to log query" errors. Partial fix for apache#4047.
57fec55
to
65e5b51
Compare
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
I think a fix for this bug should be backported to 0.10.1 |
A similar fix is included in apache#4561 but this patch has been cut down for the 0.10.1 branch.
* QueryResource: Fix incorrect request log start times. A similar fix is included in #4561 but this patch has been cut down for the 0.10.1 branch. * Fixups
* Add metrics to the native queries underpinning SQL. This is done by factoring out the metrics and request log emitting code from QueryResource into a new QueryLifecycle class. That class is used by both QueryResource and the SQL DruidSchema and QueryMaker. Also fixes a couple of bugs in QueryResource: - RequestLogLine start time was set to `TimeUnit.NANOSECONDS.toMillis(startNs)`, which is incorrect since absolute nanos cannot be converted to millis. - DruidMetrics.makeRequestMetrics was called with null `query` on unparseable queries, which led to spurious "Unable to log query" errors. Partial fix for apache#4047. * Code style * Remove unused imports. * Fix tests. * Remove unused import.
This is done by factoring out the metrics and request log emitting
code from QueryResource into a new QueryLifecycle class. That class
is used by both QueryResource and the SQL DruidSchema and QueryMaker.
Also fixes a couple of bugs in QueryResource:
TimeUnit.NANOSECONDS.toMillis(startNs)
,which is incorrect since absolute nanos cannot be converted to millis.
query
onunparseable queries, which led to spurious "Unable to log query"
errors.
Partial fix for #4047.