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

[FEATURE] Configure Cluster Search Request Slow Logs #209

Closed
ironf1st opened this issue Aug 21, 2024 · 4 comments
Closed

[FEATURE] Configure Cluster Search Request Slow Logs #209

ironf1st opened this issue Aug 21, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ironf1st
Copy link

ironf1st commented Aug 21, 2024

Is your feature request related to a problem?

As of 2.12, we can configure cluster level search request slow logs. There is no support for this in the provider right now.

What solution would you like?

Add a block to opensearch_cluster_settings for search request slow logs:

resource "opensearch_cluster_settings" "example" {
search_request_slow_logs {
    slowlog_level = "TRACE"
    slowlog_threshold_warn = "10s"
    slowlog_threshold_info = "5s"
    slowlog_threshold_debug = "2s"
    slowlog_threshold_trace = "10ms"
}

What alternatives have you considered?

I do not see an alternative method using this provider. The only other way to achieve this via Terraform is via a script and the external provider, the local-exec provider running a PUT to the cluster, or via the http provider.

Do you have any additional context?

This is a relatively new feature that is by default disabled in the cluster, set to -1.

@prudhvigodithi
Copy link
Member

[Triage]
Hey @ironf1st the settings you mentioned should be part of the https://github.com/opensearch-project/terraform-provider-opensearch/blob/main/provider/resource_opensearch_cluster_settings.go to ensure the provider can CRUD (terraform apply etc) for those settings, can you please take a look and contribute if you can?
Thank you
Adding @rblcoder

@prudhvigodithi
Copy link
Member

Hey @ironf1st something like the following should be even easier for the user.

resource "opensearch_cluster_settings" "slowlog" {
  cluster_max_shards_per_node = 10
  cluster_search_request_slowlog_level            = "WARN"
  cluster_search_request_slowlog_threshold_warn   = "10s"
  cluster_search_request_slowlog_threshold_info   = "5s"
  cluster_search_request_slowlog_threshold_debug  = "2s"
  cluster_search_request_slowlog_threshold_trace  = "100ms"
}

I have a PR open #211 to support the Cluster Search Request Slow Logs.

Thanks
@getsaurabh02 @peterzhuamazon @rblcoder

@prudhvigodithi prudhvigodithi moved this from Backlog to 🏗 In progress in Engineering Effectiveness Board Sep 16, 2024
@prudhvigodithi
Copy link
Member

The terraform provider 2.3.1 is released supporting Search Request Slow Logs, @ironf1st please take a look.
Thanks

@prudhvigodithi
Copy link
Member

Closing this issue since the terraform provider 2.3.1 is released with Cluster Search Request Slow Logs support, please feel free to add a comment or re-open if required.
Thank you
@getsaurabh02

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Engineering Effectiveness Board Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants