Skip to content
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

optimize bucket level monitor to resolve alias to query only those time-series indices that contain docs within timeframe of range query filter in search input #1701

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

eirsep
Copy link
Member

@eirsep eirsep commented Oct 18, 2024

Description

optimize bucket level monitor to resolve alias to query only those time-series indices that contain docs within timeframe of range query filter in search input

Related Issues

#1710

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.

@eirsep eirsep changed the title optimize bucket level monitor to resolve alias to query only those ti… optimize bucket level monitor to resolve alias to query only those time-series indices that contain docs within timeframe of range query filter in search input Oct 18, 2024
Copy link
Collaborator

@AWSHurneyt AWSHurneyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM. Approving for when the separate PRs to fix the build error is merged.

@@ -1190,6 +1191,133 @@ class MonitorRunnerServiceIT : AlertingRestTestCase() {
assertEquals("Incorrect search result", 2, buckets.size)
}

fun `test execute bucket-level monitor with alias optimization - indices not skipped`() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a test case with partial index consideration e.g. after the current monitor run, 5 new docs are added to index1, index1 is rolled over to index2, 5 new docs added to index2, index2 is rolled over to index3, 5 new docs added to index3, index3 is rolled over to index4, 5 new docs added to index4 & now bucket-level monitor run happens. So, this run considers, index1, index2, index3 & index4.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added 2 test scenarios

scenario one
12 indices in alias
1st index skipped as creation time out of time range of query contains 3 docs (3 new buckets in response)
2nd index NOT SKIPPED with creation time out of time range of query contains 3 docs (3 new buckets in response)
10 indices contains 2 docs (2 new buckets in response)
Response has only 5 buckets

scenario 2
12 indices in alias
1st index NOT SKIPPED as creation time in time range of query contains 3 docs (3 new buckets in response)
2nd index NOT SKIPPED with creation time in time range of query contains 3 docs (3 new buckets in response)
10 indices contains 2 docs (2 new buckets in response)
Response has only 8 buckets

…me-series indices that contain docs within timeframe of range query filter in search input

Signed-off-by: Surya Sashank Nistala <[email protected]>
…ces being skipped and not skipped

Signed-off-by: Surya Sashank Nistala <[email protected]>
Signed-off-by: Surya Sashank Nistala <[email protected]>
@eirsep eirsep merged commit e3c9fc2 into opensearch-project:main Oct 21, 2024
12 of 14 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 21, 2024
…me-series indices that contain docs within timeframe of range query filter in search input (#1701)

* optimize bucket level monitor to resolve alias to query only those time-series indices that contain docs within timeframe of range query filter in search input

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add tests to verify alias based optimziation scenarios

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix tests to verify aggregation query on alias optimziation with indices being skipped and not skipped

Signed-off-by: Surya Sashank Nistala <[email protected]>

* null check addded

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit e3c9fc2)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 21, 2024
…me-series indices that contain docs within timeframe of range query filter in search input (#1701)

* optimize bucket level monitor to resolve alias to query only those time-series indices that contain docs within timeframe of range query filter in search input

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add tests to verify alias based optimziation scenarios

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix tests to verify aggregation query on alias optimziation with indices being skipped and not skipped

Signed-off-by: Surya Sashank Nistala <[email protected]>

* null check addded

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit e3c9fc2)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 21, 2024
…me-series indices that contain docs within timeframe of range query filter in search input (#1701)

* optimize bucket level monitor to resolve alias to query only those time-series indices that contain docs within timeframe of range query filter in search input

Signed-off-by: Surya Sashank Nistala <[email protected]>

* add tests to verify alias based optimziation scenarios

Signed-off-by: Surya Sashank Nistala <[email protected]>

* fix tests to verify aggregation query on alias optimziation with indices being skipped and not skipped

Signed-off-by: Surya Sashank Nistala <[email protected]>

* null check addded

Signed-off-by: Surya Sashank Nistala <[email protected]>

---------

Signed-off-by: Surya Sashank Nistala <[email protected]>
(cherry picked from commit e3c9fc2)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
eirsep pushed a commit that referenced this pull request Oct 21, 2024
…me-series indices that contain docs within timeframe of range query filter in search input (#1701) (#1712)

* optimize bucket level monitor to resolve alias to query only those time-series indices that contain docs within timeframe of range query filter in search input



* add tests to verify alias based optimziation scenarios



* fix tests to verify aggregation query on alias optimziation with indices being skipped and not skipped



* null check addded



---------


(cherry picked from commit e3c9fc2)

Signed-off-by: Surya Sashank Nistala <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
eirsep pushed a commit that referenced this pull request Oct 21, 2024
…me-series indices that contain docs within timeframe of range query filter in search input (#1701) (#1713)

* optimize bucket level monitor to resolve alias to query only those time-series indices that contain docs within timeframe of range query filter in search input



* add tests to verify alias based optimziation scenarios



* fix tests to verify aggregation query on alias optimziation with indices being skipped and not skipped



* null check addded



---------


(cherry picked from commit e3c9fc2)

Signed-off-by: Surya Sashank Nistala <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
eirsep pushed a commit that referenced this pull request Oct 21, 2024
…me-series indices that contain docs within timeframe of range query filter in search input (#1701) (#1711)

* optimize bucket level monitor to resolve alias to query only those time-series indices that contain docs within timeframe of range query filter in search input



* add tests to verify alias based optimziation scenarios



* fix tests to verify aggregation query on alias optimziation with indices being skipped and not skipped



* null check addded



---------


(cherry picked from commit e3c9fc2)

Signed-off-by: Surya Sashank Nistala <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants