-
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
SqlResource: Metrics, request logs, cancellation #4047
Comments
Why would metrics need to be different? |
Because one SQL query can lead to multiple native Druid queries, there's an extra layer that QueryResource doesn't have to deal with. |
Would it make sense to have an extra dimension for those metrics instead? |
I dunno, it depends on whether you think With other things, we give different "layers" of a request different names, like |
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.
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.
* 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 #4047. * Code style * Remove unused imports. * Fix tests. * Remove unused import.
* 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 issue has been marked as stale due to 280 days of inactivity. It will be closed in 2 weeks if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions. |
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time. |
SqlResource should be up to the standards of QueryResource:
query/sql/time
to differentiate it fromquery/time
.Emit metrics likeFixed in Add metrics to the native queries underpinning SQL. #4561query/time
for the Druid native queries that underlie a SQL query. There might be more than one of these per SQL query.Emit request logs for the Druid native queries that underlie a SQL query.Fixed in Add metrics to the native queries underpinning SQL. #4561Emit friendly errors for QueryInterruptedException and any other cases that QueryResource emits friendly errors. This can be tested by setting a really low timeout and confirming you get a friendly JSON error rather than unfriendly HTML.Fixed in SQL: Better error handling for HTTP API. #4053I think a lot of this could be accomplished by sharing code between QueryResource and SqlResource. Some of it (like a
query/sql/time
metric) would be unique to SqlResource.The text was updated successfully, but these errors were encountered: