From c56ee677c786b1a632915ce14f4d631842540426 Mon Sep 17 00:00:00 2001 From: Kenny Leung Date: Wed, 20 Nov 2024 15:30:24 -0800 Subject: [PATCH 1/2] insert squad label to all metrics Signed-off-by: Kenny Leung --- modules/regional-service/main.tf | 2 +- modules/regional-service/otel-config/config.yaml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/regional-service/main.tf b/modules/regional-service/main.tf index e5994ec6..618158e4 100644 --- a/modules/regional-service/main.tf +++ b/modules/regional-service/main.tf @@ -204,7 +204,7 @@ resource "google_cloud_run_v2_service" "this" { args = ["--config=env:OTEL_CONFIG"] env { name = "OTEL_CONFIG" - value = file("${path.module}/otel-config/config.yaml") + value = replace(file("${path.module}/otel-config/config.yaml"), "SQUAD", var.squad) } } diff --git a/modules/regional-service/otel-config/config.yaml b/modules/regional-service/otel-config/config.yaml index 7200c61a..6dcecf67 100644 --- a/modules/regional-service/otel-config/config.yaml +++ b/modules/regional-service/otel-config/config.yaml @@ -21,6 +21,12 @@ receivers: action: drop processors: + attributes: + actions: + - action: insert + key: squad + value: "SQUAD" + batch: # batch metrics before sending to reduce API usage send_batch_max_size: 200 From df4f983a59aa92b050cc3a8ba343826c8f505f0b Mon Sep 17 00:00:00 2001 From: Kenny Leung Date: Wed, 20 Nov 2024 15:41:37 -0800 Subject: [PATCH 2/2] use team Signed-off-by: Kenny Leung --- modules/regional-service/main.tf | 2 +- modules/regional-service/otel-config/config.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/regional-service/main.tf b/modules/regional-service/main.tf index 618158e4..3d374728 100644 --- a/modules/regional-service/main.tf +++ b/modules/regional-service/main.tf @@ -204,7 +204,7 @@ resource "google_cloud_run_v2_service" "this" { args = ["--config=env:OTEL_CONFIG"] env { name = "OTEL_CONFIG" - value = replace(file("${path.module}/otel-config/config.yaml"), "SQUAD", var.squad) + value = replace(file("${path.module}/otel-config/config.yaml"), "REPLACE_ME_TEAM", var.squad) } } diff --git a/modules/regional-service/otel-config/config.yaml b/modules/regional-service/otel-config/config.yaml index 6dcecf67..1fa2a8e3 100644 --- a/modules/regional-service/otel-config/config.yaml +++ b/modules/regional-service/otel-config/config.yaml @@ -24,8 +24,8 @@ processors: attributes: actions: - action: insert - key: squad - value: "SQUAD" + key: team + value: "REPLACE_ME_TEAM" batch: # batch metrics before sending to reduce API usage