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

[Bug fix] Fix default exporter settings #234

Merged

Conversation

ansjcy
Copy link
Member

@ansjcy ansjcy commented Jan 31, 2025

Description

The default settings for exporters were changed in #217, but when we start OpenSearch with query insights and run queries, there's no data exported to local index.

This PR fixes the issue by deeply refactoring the related logic.

Issues Resolved

Closes #232

Testing

  • Run OpenSearch with query-insights, create document and do searches
  • Wait for 5 minutes (default window)
  • Check local indices
curl -X GET "localhost:9200/_cat/indices"
yellow open my-index-0                   ih6DMkwqQsKurHlwu5kDZA 1 1 1 0    5kb    5kb
yellow open top_queries-2025.01.31-62142 VPP6qMsQQgm3-oUj1PHUdA 1 1 2 4 48.6kb 48.6kb
  • Disable local index exporter
curl -X PUT 'localhost:9200/_cluster/settings' -H 'Content-Type: application/json' -d'
{
    "persistent" : {
        "search.insights.top_queries.exporter.type" : "none"
    }
}'
  • Check local indices
curl -X GET "localhost:9200/_cat/indices"
yellow open my-index-0 ih6DMkwqQsKurHlwu5kDZA 1 1 1 0 5kb 5kb
  • Reenable it
curl -X PUT 'localhost:9200/_cluster/settings' -H 'Content-Type: application/json' -d'
{
    "persistent" : {
        "search.insights.top_queries.exporter.type" : "local_index"
    }
}'
  • do search, wait for 5 minutes
  • check local indices
curl -X GET "localhost:9200/_cat/indices"
yellow open my-index-0                   ih6DMkwqQsKurHlwu5kDZA 1 1 1 0    5kb    5kb
yellow open top_queries-2025.01.31-62142 xyZmoWOvTreNVlVaosBWJA 1 1 1 2 24.3kb 24.3kb
  • set local index to debug and check local index
curl -X GET "localhost:9200/_cat/indices"
yellow open my-index-0 ih6DMkwqQsKurHlwu5kDZA 1 1 1 0 5kb 5kb

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.

@ansjcy ansjcy force-pushed the fix-default-exporter-settings branch from d5e8c5e to e7398b3 Compare January 31, 2025 02:40
@ansjcy ansjcy changed the title Fix default exporter settings [Bug fix] Fix default exporter settings Jan 31, 2025
@ansjcy ansjcy force-pushed the fix-default-exporter-settings branch 4 times, most recently from 4ea0d19 to fee9dc3 Compare January 31, 2025 04:48
Signed-off-by: Chenyang Ji <cyji@amazon.com>
@ansjcy ansjcy force-pushed the fix-default-exporter-settings branch from fee9dc3 to a1057d9 Compare January 31, 2025 19:18
@ansjcy ansjcy merged commit fdca619 into opensearch-project:main Jan 31, 2025
12 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 31, 2025
Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit fdca619)
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 Jan 31, 2025
Signed-off-by: Chenyang Ji <cyji@amazon.com>
(cherry picked from commit fdca619)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ansjcy pushed a commit that referenced this pull request Jan 31, 2025
(cherry picked from commit fdca619)

Signed-off-by: Chenyang Ji <cyji@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>
ansjcy pushed a commit that referenced this pull request Jan 31, 2025
(cherry picked from commit fdca619)

Signed-off-by: Chenyang Ji <cyji@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>
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.

[BUG] Local index default setting is not working
2 participants