feat(alloydb): add support for advanced query insights (observability_config) (#3856)
* Implemented advanced query insight in alloydb module * Implemented readme example and test * Fix TOC
This commit is contained in:
committed by
GitHub
parent
8b2fb39efe
commit
55a847c008
@@ -247,7 +247,7 @@ resource "google_alloydb_instance" "primary" {
|
||||
}
|
||||
|
||||
dynamic "query_insights_config" {
|
||||
for_each = var.query_insights_config != null ? [""] : []
|
||||
for_each = var.query_insights_config != null && !try(var.observability_config.enabled, false) ? [""] : []
|
||||
content {
|
||||
query_string_length = var.query_insights_config.query_string_length
|
||||
record_application_tags = var.query_insights_config.record_application_tags
|
||||
@@ -255,6 +255,21 @@ resource "google_alloydb_instance" "primary" {
|
||||
query_plans_per_minute = var.query_insights_config.query_plans_per_minute
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "observability_config" {
|
||||
for_each = try(var.observability_config.enabled, false) ? [""] : []
|
||||
content {
|
||||
enabled = var.observability_config.enabled
|
||||
preserve_comments = var.observability_config.preserve_comments
|
||||
track_wait_events = var.observability_config.track_wait_events
|
||||
max_query_string_length = var.observability_config.max_query_string_length
|
||||
record_application_tags = var.observability_config.record_application_tags
|
||||
query_plans_per_minute = var.observability_config.query_plans_per_minute
|
||||
track_active_queries = var.observability_config.track_active_queries
|
||||
# track_client_address = var.observability_config.track_client_address # There is a PR to add this feature to the provider. Tracking it here: https://github.com/GoogleCloudPlatform/magic-modules/pull/17067
|
||||
assistive_experiences_enabled = var.observability_config.assistive_experiences_enabled
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "google_alloydb_cluster" "secondary" {
|
||||
@@ -510,7 +525,7 @@ resource "google_alloydb_instance" "read_pool_primary" {
|
||||
}
|
||||
|
||||
dynamic "query_insights_config" {
|
||||
for_each = each.value.query_insights_config != null ? [""] : []
|
||||
for_each = each.value.query_insights_config != null && !try(each.value.observability_config.enabled, false) ? [""] : []
|
||||
content {
|
||||
query_string_length = each.value.query_insights_config.query_string_length
|
||||
record_application_tags = each.value.query_insights_config.record_application_tags
|
||||
@@ -519,6 +534,21 @@ resource "google_alloydb_instance" "read_pool_primary" {
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "observability_config" {
|
||||
for_each = try(each.value.observability_config.enabled, false) ? [""] : []
|
||||
content {
|
||||
enabled = each.value.observability_config.enabled
|
||||
preserve_comments = each.value.observability_config.preserve_comments
|
||||
track_wait_events = each.value.observability_config.track_wait_events
|
||||
max_query_string_length = each.value.observability_config.max_query_string_length
|
||||
record_application_tags = each.value.observability_config.record_application_tags
|
||||
query_plans_per_minute = each.value.observability_config.query_plans_per_minute
|
||||
track_active_queries = each.value.observability_config.track_active_queries
|
||||
# track_client_address = each.value.observability_config.track_client_address # There is a PR to add this feature to the provider. Tracking it here: https://github.com/GoogleCloudPlatform/magic-modules/pull/17067
|
||||
assistive_experiences_enabled = each.value.observability_config.assistive_experiences_enabled
|
||||
}
|
||||
}
|
||||
|
||||
depends_on = [google_alloydb_instance.primary]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user