rohangarg opened a new pull request, #12867:
URL: https://github.com/apache/druid/pull/12867
This change adds the query/time metric for SQL queries from router.
Currently, the native queries do report that metric whereas the SQL queries
don't. The biggest problem in support SQL query metrics is that in router the
SQL query doesn't have a native query plan which can be used to send metrics.
So, instead we extract `sqlQueryId` from the query response header and only
set that dimension for query/time metric for SQL queries. Due to the lack of a
native translated query, we use a dummy native query to interact with
`QueryMetrics` interface but ensure that no dummy dimensions are set in the
metric.
The reasons for not de-serializing the SQL query requests are :
1. It can take time on the router which can add to the latencies of the query
2. It is not possible to de-serialize the JDBC SQL queries easily (would
require same structure as Avatica handlers)
This PR has:
- [x] been self-reviewed.
- [ ] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [x] added documentation for new or modified features or behaviors.
- [x] added Javadocs for most classes and all non-trivial methods. Linked
related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [x] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [ ] added integration tests.
- [x] been tested in a test Druid cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]