Add basic observability example to classic dataset (#3697)

* Add basic observability example to classic dataset

* Add boilerplate and observability schema

* Lint fix

* Add observability schema to project-factory module

* Extend duplicate-diff

* Fix tests

* Remove unused schemas
This commit is contained in:
Julio Castillo
2026-02-10 15:35:13 +01:00
committed by GitHub
parent 4e7b44e184
commit ddab73d03f
11 changed files with 981 additions and 12 deletions

View File

@@ -135,7 +135,7 @@ resource "google_monitoring_alert_policy" "alerts" {
# first try to get a channel created by this module
google_monitoring_notification_channel.channels[x].name,
# otherwise check the context
var.context.notification_channels[x],
local.ctx.notification_channels[x],
# if nothing else, use the provided channel as is
x
)

View File

@@ -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.
@@ -71,7 +71,7 @@ resource "google_logging_metric" "metrics" {
disabled = each.value.disabled
bucket_name = try(
# first try to check the context
var.context.log_buckets[each.value.bucket_name],
local.ctx.log_buckets[each.value.bucket_name],
# if nothing else, use the provided channel as is
each.value.bucket_name
)

View File

@@ -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.
@@ -45,8 +45,16 @@ resource "google_monitoring_notification_channel" "channels" {
description = each.value.description
display_name = each.value.display_name
enabled = each.value.enabled
labels = each.value.labels
user_labels = each.value.user_labels
labels = each.value.labels == null ? null : {
for k, v in each.value.labels :
# allow interpolation of email addresses and pubsub topics
k => try(
local.ctx.email_addresses[v],
local.ctx.pubsub_topics[v],
v
)
}
user_labels = each.value.user_labels
dynamic "sensitive_labels" {
for_each = each.value.sensitive_labels[*]
content {