Fix project-factory observability factory (#3695)
This commit is contained in:
@@ -106,6 +106,7 @@ module "projects" {
|
||||
factories_config = {
|
||||
custom_roles = try(each.value.factories_config.custom_roles, null)
|
||||
org_policies = try(each.value.factories_config.org_policies, null)
|
||||
observability = try(each.value.factories_config.observability, null)
|
||||
quotas = try(each.value.factories_config.quotas, null)
|
||||
scc_sha_custom_modules = try(each.value.factories_config.scc_sha_custom_modules, null)
|
||||
tags = try(each.value.factories_config.tags, null)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -79,22 +79,18 @@ locals {
|
||||
rule_group = try(c.condition_prometheus_query_language.rule_group, null)
|
||||
}
|
||||
condition_threshold = !can(c.condition_threshold) ? null : {
|
||||
comparison = c.condition_threshold.comparison
|
||||
duration = c.condition_threshold.duration
|
||||
denominator_filter = try(c.condition_threshold.denominator_filter, null)
|
||||
|
||||
|
||||
comparison = c.condition_threshold.comparison
|
||||
duration = c.condition_threshold.duration
|
||||
denominator_filter = try(c.condition_threshold.denominator_filter, null)
|
||||
evaluation_missing_data = try(c.condition_threshold.evaluation_missing_data, null)
|
||||
filter = try(c.condition_threshold.filter, null)
|
||||
threshold_value = try(c.condition_threshold.threshold_value, null)
|
||||
aggregations = !can(c.condition_threshold.aggregations) ? null : [
|
||||
for a in c.condition_threshold.aggregations : {
|
||||
per_series_aligner = try(a.per_series_aligner, null)
|
||||
group_by_fields = try(a.group_by_fields, null)
|
||||
cross_series_reducer = try(a.cross_series_reducer, null)
|
||||
alignment_period = try(a.alignment_period, null)
|
||||
}
|
||||
]
|
||||
aggregations = !can(c.condition_threshold.aggregations) ? null : {
|
||||
per_series_aligner = try(c.condition_threshold.aggregations.per_series_aligner, null)
|
||||
group_by_fields = try(c.condition_threshold.aggregations.group_by_fields, null)
|
||||
cross_series_reducer = try(c.condition_threshold.aggregations.cross_series_reducer, null)
|
||||
alignment_period = try(c.condition_threshold.aggregations.alignment_period, null)
|
||||
}
|
||||
denominator_aggregations = !can(c.condition_threshold.denominator_aggregations) ? null : {
|
||||
per_series_aligner = try(c.condition_threshold.denominator_aggregations.per_series_aligner, null)
|
||||
group_by_fields = try(c.condition_threshold.denominator_aggregations.group_by_fields, null)
|
||||
@@ -116,7 +112,7 @@ locals {
|
||||
mime_type = try(v.documentation.mime_type, null)
|
||||
subject = try(v.documentation.subject, null)
|
||||
links = !can(v.documentation.links) ? null : [
|
||||
for l in v.documentation.link : {
|
||||
for l in v.documentation.links : {
|
||||
display_name = try(l.display_name, null)
|
||||
url = try(l.url, null)
|
||||
}]
|
||||
@@ -207,9 +203,12 @@ resource "google_monitoring_alert_policy" "alerts" {
|
||||
duration = condition_monitoring_query_language.value.duration
|
||||
query = condition_monitoring_query_language.value.query
|
||||
evaluation_missing_data = condition_monitoring_query_language.value.evaluation_missing_data
|
||||
trigger {
|
||||
count = condition_monitoring_query_language.value.trigger.count
|
||||
percent = condition_monitoring_query_language.value.trigger.percent
|
||||
dynamic "trigger" {
|
||||
for_each = condition_monitoring_query_language.value.trigger[*]
|
||||
content {
|
||||
count = trigger.value.count
|
||||
percent = trigger.value.percent
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -247,9 +246,10 @@ resource "google_monitoring_alert_policy" "alerts" {
|
||||
dynamic "denominator_aggregations" {
|
||||
for_each = condition_threshold.value.denominator_aggregations[*]
|
||||
content {
|
||||
alignment_period = denominator_aggregations.value.alignment_period
|
||||
group_by_fields = denominator_aggregations.value.group_by_fields
|
||||
per_series_aligner = denominator_aggregations.value.per_series_aligner
|
||||
alignment_period = denominator_aggregations.value.alignment_period
|
||||
cross_series_reducer = denominator_aggregations.value.cross_series_reducer
|
||||
group_by_fields = denominator_aggregations.value.group_by_fields
|
||||
per_series_aligner = denominator_aggregations.value.per_series_aligner
|
||||
}
|
||||
}
|
||||
dynamic "forecast_options" {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2025 Google LLC
|
||||
# Copyright 2026 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -7660,6 +7660,7 @@ values:
|
||||
organization: '1234567890'
|
||||
timeouts: null
|
||||
module.organization[0].google_tags_tag_key.default["context"]:
|
||||
allowed_values_regex: null
|
||||
description: Organization-level contexts.
|
||||
parent: organizations/1234567890
|
||||
purpose: null
|
||||
@@ -7667,6 +7668,7 @@ values:
|
||||
short_name: context
|
||||
timeouts: null
|
||||
module.organization[0].google_tags_tag_key.default["environment"]:
|
||||
allowed_values_regex: null
|
||||
description: Organization-level environments.
|
||||
parent: organizations/1234567890
|
||||
purpose: null
|
||||
@@ -7674,6 +7676,7 @@ values:
|
||||
short_name: environment
|
||||
timeouts: null
|
||||
module.organization[0].google_tags_tag_key.default["org-policies"]:
|
||||
allowed_values_regex: null
|
||||
description: Organization policy condition tags.
|
||||
parent: organizations/1234567890
|
||||
purpose: null
|
||||
@@ -8057,15 +8060,10 @@ values:
|
||||
condition_sql: []
|
||||
condition_threshold:
|
||||
- aggregations:
|
||||
- alignment_period: 60s
|
||||
cross_series_reducer: REDUCE_SUM
|
||||
group_by_fields:
|
||||
- metric.label.principal
|
||||
- metric.label.method_name
|
||||
- metric.label.organization_id
|
||||
- metric.label.folder_id
|
||||
- metric.label.project_id
|
||||
per_series_aligner: ALIGN_SUM
|
||||
- alignment_period: null
|
||||
cross_series_reducer: null
|
||||
group_by_fields: null
|
||||
per_series_aligner: null
|
||||
comparison: COMPARISON_GT
|
||||
denominator_aggregations: []
|
||||
denominator_filter: null
|
||||
@@ -8116,13 +8114,10 @@ values:
|
||||
condition_sql: []
|
||||
condition_threshold:
|
||||
- aggregations:
|
||||
- alignment_period: 60s
|
||||
cross_series_reducer: REDUCE_SUM
|
||||
group_by_fields:
|
||||
- metric.label.principal
|
||||
- metric.label.method_name
|
||||
- metric.label.project_id
|
||||
per_series_aligner: ALIGN_SUM
|
||||
- alignment_period: null
|
||||
cross_series_reducer: null
|
||||
group_by_fields: null
|
||||
per_series_aligner: null
|
||||
comparison: COMPARISON_GT
|
||||
denominator_aggregations: []
|
||||
denominator_filter: null
|
||||
@@ -8177,14 +8172,10 @@ values:
|
||||
condition_sql: []
|
||||
condition_threshold:
|
||||
- aggregations:
|
||||
- alignment_period: 60s
|
||||
cross_series_reducer: REDUCE_SUM
|
||||
group_by_fields:
|
||||
- metric.label.principal
|
||||
- metric.label.method_name
|
||||
- metric.label.project_id
|
||||
- metric.label.database_id
|
||||
per_series_aligner: ALIGN_SUM
|
||||
- alignment_period: null
|
||||
cross_series_reducer: null
|
||||
group_by_fields: null
|
||||
per_series_aligner: null
|
||||
comparison: COMPARISON_GT
|
||||
denominator_aggregations: []
|
||||
denominator_filter: null
|
||||
@@ -8231,15 +8222,10 @@ values:
|
||||
condition_sql: []
|
||||
condition_threshold:
|
||||
- aggregations:
|
||||
- alignment_period: 60s
|
||||
cross_series_reducer: REDUCE_SUM
|
||||
group_by_fields:
|
||||
- metric.label.principal
|
||||
- metric.label.method_name
|
||||
- metric.label.organization_id
|
||||
- metric.label.project_id
|
||||
- metric.label.role_name
|
||||
per_series_aligner: ALIGN_SUM
|
||||
- alignment_period: null
|
||||
cross_series_reducer: null
|
||||
group_by_fields: null
|
||||
per_series_aligner: null
|
||||
comparison: COMPARISON_GT
|
||||
denominator_aggregations: []
|
||||
denominator_filter: null
|
||||
@@ -8280,12 +8266,10 @@ values:
|
||||
condition_sql: []
|
||||
condition_threshold:
|
||||
- aggregations:
|
||||
- alignment_period: 60s
|
||||
cross_series_reducer: REDUCE_SUM
|
||||
group_by_fields:
|
||||
- metric.label.principal
|
||||
- metric.label.method_name
|
||||
per_series_aligner: ALIGN_SUM
|
||||
- alignment_period: null
|
||||
cross_series_reducer: null
|
||||
group_by_fields: null
|
||||
per_series_aligner: null
|
||||
comparison: COMPARISON_GT
|
||||
denominator_aggregations: []
|
||||
denominator_filter: null
|
||||
@@ -8327,14 +8311,10 @@ values:
|
||||
condition_sql: []
|
||||
condition_threshold:
|
||||
- aggregations:
|
||||
- alignment_period: 60s
|
||||
cross_series_reducer: REDUCE_SUM
|
||||
group_by_fields:
|
||||
- metric.label.principal
|
||||
- metric.label.method_name
|
||||
- metric.label.project_id
|
||||
- metric.label.firewall_rule_id
|
||||
per_series_aligner: ALIGN_SUM
|
||||
- alignment_period: null
|
||||
cross_series_reducer: null
|
||||
group_by_fields: null
|
||||
per_series_aligner: null
|
||||
comparison: COMPARISON_GT
|
||||
denominator_aggregations: []
|
||||
denominator_filter: null
|
||||
@@ -8375,14 +8355,10 @@ values:
|
||||
condition_sql: []
|
||||
condition_threshold:
|
||||
- aggregations:
|
||||
- alignment_period: 60s
|
||||
cross_series_reducer: REDUCE_SUM
|
||||
group_by_fields:
|
||||
- metric.label.principal
|
||||
- metric.label.method_name
|
||||
- metric.label.project_id
|
||||
- metric.label.network_id
|
||||
per_series_aligner: ALIGN_SUM
|
||||
- alignment_period: null
|
||||
cross_series_reducer: null
|
||||
group_by_fields: null
|
||||
per_series_aligner: null
|
||||
comparison: COMPARISON_GT
|
||||
denominator_aggregations: []
|
||||
denominator_filter: null
|
||||
@@ -8425,14 +8401,10 @@ values:
|
||||
condition_sql: []
|
||||
condition_threshold:
|
||||
- aggregations:
|
||||
- alignment_period: 60s
|
||||
cross_series_reducer: REDUCE_SUM
|
||||
group_by_fields:
|
||||
- metric.label.principal
|
||||
- metric.label.method_name
|
||||
- metric.label.project_id
|
||||
- metric.label.route_id
|
||||
per_series_aligner: ALIGN_SUM
|
||||
- alignment_period: null
|
||||
cross_series_reducer: null
|
||||
group_by_fields: null
|
||||
per_series_aligner: null
|
||||
comparison: COMPARISON_GT
|
||||
denominator_aggregations: []
|
||||
denominator_filter: null
|
||||
@@ -8472,15 +8444,10 @@ values:
|
||||
condition_sql: []
|
||||
condition_threshold:
|
||||
- aggregations:
|
||||
- alignment_period: 60s
|
||||
cross_series_reducer: REDUCE_SUM
|
||||
group_by_fields:
|
||||
- metric.label.principal
|
||||
- metric.label.method_name
|
||||
- metric.label.organization_id
|
||||
- metric.label.folder_id
|
||||
- metric.label.project_id
|
||||
per_series_aligner: ALIGN_SUM
|
||||
- alignment_period: null
|
||||
cross_series_reducer: null
|
||||
group_by_fields: null
|
||||
per_series_aligner: null
|
||||
comparison: COMPARISON_GT
|
||||
denominator_aggregations: []
|
||||
denominator_filter: null
|
||||
@@ -8522,15 +8489,10 @@ values:
|
||||
condition_sql: []
|
||||
condition_threshold:
|
||||
- aggregations:
|
||||
- alignment_period: 60s
|
||||
cross_series_reducer: REDUCE_SUM
|
||||
group_by_fields:
|
||||
- metric.label.principal
|
||||
- metric.label.method_name
|
||||
- metric.label.project_id
|
||||
- metric.label.location
|
||||
- metric.label.bucket_name
|
||||
per_series_aligner: ALIGN_SUM
|
||||
- alignment_period: null
|
||||
cross_series_reducer: null
|
||||
group_by_fields: null
|
||||
per_series_aligner: null
|
||||
comparison: COMPARISON_GT
|
||||
denominator_aggregations: []
|
||||
denominator_filter: null
|
||||
|
||||
Reference in New Issue
Block a user