-
Notifications
You must be signed in to change notification settings - Fork 141
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
Change query range response structure #1867
Change query range response structure #1867
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1867 +/- ##
============================================
- Coverage 97.39% 97.39% -0.01%
+ Complexity 4608 4603 -5
============================================
Files 401 401
Lines 11408 11397 -11
Branches 843 835 -8
============================================
- Hits 11111 11100 -11
Misses 290 290
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
77b6bb4
to
d3eb1a2
Compare
There is only IT for explain? Could you add to your PR description the response format before/after your changes? |
|
716df8e
to
8f04562
Compare
Signed-off-by: Vamsi Manohar <reddyvam@amazon.com>
8f04562
to
b1e2687
Compare
@@ -97,10 +97,6 @@ public Map<String, ExprType> getFieldTypes() { | |||
public PhysicalPlan implement(LogicalPlan plan) { | |||
PrometheusMetricScan metricScan = | |||
new PrometheusMetricScan(prometheusClient); | |||
if (prometheusQueryRequest != null) { | |||
metricScan.setRequest(prometheusQueryRequest); |
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 request
field is still in use in metric scan. So where we set it now?
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.
Implementation of query_range and ppl.prometheus_http_requests_total got coupled with weird logic. Need to refactor in another PR.
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.
query_range...we directly set the prometheusQueryRequest.
In case of source = my_prometheus.prometheus_http_requests_total
we set these parameters in PrometheusDefaultImplementator class.
@@ -94,14 +94,12 @@ public PhysicalPlan visitIndexAggregation(PrometheusLogicalMetricAgg node, | |||
public PhysicalPlan visitRelation(LogicalRelation node, | |||
PrometheusMetricScan context) { | |||
PrometheusMetricTable prometheusMetricTable = (PrometheusMetricTable) node.getTable(); | |||
if (prometheusMetricTable.getMetricName() != null) { |
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.
Just my feel that it's a little hard to follow why several if
check removed in this PR. it's fine if it's covered in UT.
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.
In earlier implementation, query_range function implementation got coupled with normal PPL queries source = my_prometheus.proemtheus_http_requests_total implementation. This PR at least decouples few of the things.
Need to refactor the existing implementation. I tried to refactor in this PR, the changes are becoming huge. Will cover them in another PR.
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.
With the new implementation. Visit Relation will always have metricName.
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. Please add TODO comment or put all refactor items in Github issue. Thanks!
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.
Signed-off-by: Vamsi Manohar <reddyvam@amazon.com> (cherry picked from commit 4102b58)
Signed-off-by: Vamsi Manohar <reddyvam@amazon.com>
Signed-off-by: Vamsi Manohar <reddyvam@amazon.com> (cherry picked from commit 4102b58)
Signed-off-by: Vamsi Manohar <reddyvam@amazon.com> Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
Signed-off-by: Vamsi Manohar <reddyvam@amazon.com> (cherry picked from commit 4102b58) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
This PR is for changing the response structure of query_range table function in Prometheus Connector.
BWC failures are unrelated. WIll get fixed with the below PRs
#1876
#1868
Request::
PUT http://localhost:9200/_plugins/_ppl
Sample Old Response
There is no segregation of data among different timeseries in a metric.
In the new response below...each timeseries of a metric is a row individually.
Response::
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.