-
Notifications
You must be signed in to change notification settings - Fork 10
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
Top N indices auto deletion config & functionality #172
Conversation
fabc26c
to
e910208
Compare
Have we done tests on the actual delete functionalities? Since the min value allowed for |
src/main/java/org/opensearch/plugin/insights/core/exporter/LocalIndexExporter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/plugin/insights/core/service/QueryInsightsService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/plugin/insights/core/service/TopQueriesService.java
Show resolved
Hide resolved
src/main/java/org/opensearch/plugin/insights/core/exporter/LocalIndexExporter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/plugin/insights/core/exporter/LocalIndexExporter.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/plugin/insights/core/exporter/LocalIndexExporter.java
Show resolved
Hide resolved
src/main/java/org/opensearch/plugin/insights/core/service/TopQueriesService.java
Show resolved
Hide resolved
src/test/java/org/opensearch/plugin/insights/core/exporter/LocalIndexExporterTests.java
Show resolved
Hide resolved
e910208
to
4299935
Compare
I manually tested with 1 min rollover & 5-10 min retention. It worked as expected. |
5c84a92
to
7c7e726
Compare
Signed-off-by: David Zane <davizane@amazon.com>
src/main/java/org/opensearch/plugin/insights/core/service/QueryInsightsService.java
Show resolved
Hide resolved
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.
LGTM. Nice work on the data retention change.
Signed-off-by: David Zane <davizane@amazon.com> (cherry picked from commit 90ead0c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: David Zane <davizane@amazon.com> (cherry picked from commit 90ead0c) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 90ead0c) Signed-off-by: David Zane <davizane@amazon.com> 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>
Description
This PR introduces two features related to the retention of Top N historical data:
search.insights.top_queries.delete_after_days
Details:
search.insights.top_queries.delete_after_days
: This integer setting determines the retention period in days for Top N indices. Default value is 7 days. Acceptable range is 1 to 180 days.exporter.type
islocal_index
delete_after_days
setting is updated and once per day, in line with the top_queries index rollover period (1 day). Looks for indices that match the naming patterntop_queries-YYYY.MM.dd-xxxxx
exporter.type
is changed fromlocal_index
, all existing local indices are deleted. This is so that indices do not linger when sink type is notlocal_index
.Testing
search.insights.top_queries.delete_after_days
validation:Issues Resolved
Resolves #165
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.