opensearch-project / terraform-provider-opensearch

https://registry.terraform.io/providers/opensearch-project/opensearch
Apache License 2.0
74 stars 57 forks source link

[FEATURE] Configure Cluster Search Request Slow Logs #209

Open ironf1st opened 3 weeks ago

ironf1st commented 3 weeks ago

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 commented 2 weeks ago

[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