-
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
Fix for errors in prometheus connector when backquotes are used for fieldnames in aggregations. #1041
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.4 #1041 +/- ##
============================================
- Coverage 98.26% 95.68% -2.58%
- Complexity 3326 3332 +6
============================================
Files 324 334 +10
Lines 8400 9071 +671
Branches 553 672 +119
============================================
+ Hits 8254 8680 +426
- Misses 142 334 +192
- Partials 4 57 +53
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Backquotes could be used to wrap any identifier. Could you, please, test a more complex scenario? source=`prometheus`.`promhttp_metric` | stats avg(@value) as `agg` by span(@timestamp, 15s), `instance`, `handler`, `job` |
63df9f9
to
2c6d0d2
Compare
Sure |
2c6d0d2
to
acce058
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.
Is it covered by Parser?
Yes, Kind of covered.
NamedExpression
{
name : \`instance\`
refExpression : {
attr : "instance"
}
}
I can rely on ReferenceExpression instead of stripping the backquotes.
acce058
to
77588fd
Compare
Signed-off-by: vamsi-amazon <[email protected]>
77588fd
to
0cc5dc7
Compare
Signed-off-by: vamsi-amazon <[email protected]> (cherry picked from commit d3bb902)
Signed-off-by: vamsi-amazon <[email protected]> (cherry picked from commit d3bb902) Co-authored-by: vamsi-amazon <[email protected]>
* Fix `FLOAT` -> `DOUBLE` cast. (#1025) Signed-off-by: Yury-Fridlyand <[email protected]> * Fix error messaging from prometheus. (#1029) (#1037) Signed-off-by: vamsi-amazon <[email protected]> (cherry picked from commit 4a9cef3) Co-authored-by: vamsi-amazon <[email protected]> * Add `query` function as alternate syntax to `query_string` function (#1010) This maintains backwards compatibility with the v1 engine. * Update DATE and TIME functions to parse string input as datetime (#991) Add option to accept datetime like string in both TIME and DATE (eg. accept "1999-01-02 12:12:12" for both TIME and DATE. Strict check on date for testing for valid dates (eg. Don't accept Feb 30th as a valid date) and throws a SemanticCheckException. Co-authored-by: Yury-Fridlyand <[email protected]> Signed-off-by: MitchellGale-BitQuill <[email protected]> * back quote fix (#1041) (#1050) Signed-off-by: vamsi-amazon <[email protected]> (cherry picked from commit d3bb902) Co-authored-by: vamsi-amazon <[email protected]> * Catalog to Datasource changes (#1027) (#1049) Signed-off-by: vamsi-amazon <[email protected]> (cherry picked from commit 3e30379) * Bump jackson to 2.14.0 (#1058) Signed-off-by: Joshua Li <[email protected]> (cherry picked from commit 5a1adb2) * Add valueOf() to Expression (#1055) Signed-off-by: Joshua Li <[email protected]> Signed-off-by: Yury-Fridlyand <[email protected]> Signed-off-by: MitchellGale-BitQuill <[email protected]> Signed-off-by: Joshua Li <[email protected]> Signed-off-by: Chen Dai <[email protected]> Co-authored-by: Yury-Fridlyand <[email protected]> Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Co-authored-by: vamsi-amazon <[email protected]> Co-authored-by: GabeFernandez310 <[email protected]> Co-authored-by: MitchellGale-BitQuill <[email protected]> Co-authored-by: Joshua Li <[email protected]>
Signed-off-by: vamsi-amazon [email protected]
Description
Backquotes in stats groupby list is causing errors in prometheus connector.
Eg command:
source=prometheus.promhttp_metric | stats avg(@value) by span(@timestamp, 15s), `instance`
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.