-
Notifications
You must be signed in to change notification settings - Fork 105
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
Adds findings in bucket level monitor #636
Conversation
Signed-off-by: Surya Sashank Nistala <[email protected]>
Signed-off-by: Surya Sashank Nistala <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #636 +/- ##
============================================
- Coverage 76.35% 76.13% -0.23%
Complexity 116 116
============================================
Files 124 124
Lines 6445 6569 +124
Branches 942 972 +30
============================================
+ Hits 4921 5001 +80
- Misses 1044 1070 +26
- Partials 480 498 +18
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Thanks @eirsep . Overall approach looks good to me. Few comments/clarifications to consider.
if (grouByFields > 0) { | ||
return listOf() | ||
} |
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.
Why do we need to return from here?
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.
If there are more groupby fields then aggregation buckets would become tuples. We can develop iteratively and first begin by supporting only for a single field(buckets with single field aggregated on) to filter on.
monitorCtx.client!!.suspendUntil<Client, IndexResponse> { | ||
monitorCtx.client!!.index(indexRequest, it) |
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.
Are we indexing each finding document, one at a time? Wondering if we should use bulk request instead?
findings.add(finding.id) | ||
} | ||
} | ||
return findings |
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.
Do we need to return the findings from here, as indexing is already done?
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.
we are returning finding ids. finding ids list is populated in the alert.
@@ -1321,6 +1323,71 @@ class MonitorRunnerServiceIT : AlertingRestTestCase() { | |||
) | |||
} | |||
|
|||
fun `test bucket-level monitor with findings enabled`() { |
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.
Lets validate other scenarios as well:
- Where findings will not be created - such as compound aggregation.
- Findings index unavailable, or exception in index.
Signed-off-by: Surya Sashank Nistala <[email protected]>
* bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> * add test to verify bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> * added tests. fixed document ids in bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> Signed-off-by: Surya Sashank Nistala <[email protected]> (cherry picked from commit 5b451b9)
* bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> * add test to verify bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> * added tests. fixed document ids in bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> Signed-off-by: Surya Sashank Nistala <[email protected]> (cherry picked from commit 5b451b9)
* bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> * add test to verify bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> * added tests. fixed document ids in bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> Signed-off-by: Surya Sashank Nistala <[email protected]> (cherry picked from commit 5b451b9) Co-authored-by: Surya Sashank Nistala <[email protected]>
* bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> * add test to verify bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> * added tests. fixed document ids in bucket level monitor findings Signed-off-by: Surya Sashank Nistala <[email protected]> Signed-off-by: Surya Sashank Nistala <[email protected]> (cherry picked from commit 5b451b9) Co-authored-by: Surya Sashank Nistala <[email protected]>
This change surfaces out the list of documents that become a part of bucket level monitor aggregation buckets as findings for the monitor.
Signed-off-by: Surya Sashank Nistala [email protected]
CheckList:
[x] Commits are signed per the DCO using --signoff
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.