From 58b3b2c383c6671bfa8bcba0df40f41131a2adeb Mon Sep 17 00:00:00 2001 From: Andrew Bolyachevets Date: Thu, 14 Nov 2024 10:33:47 -0800 Subject: [PATCH] file type for alert policies (#194) --- .../{request_latency.yml => request_latency.json} | 0 ...sponse_error_counts.yml => response_error_counts.json} | 0 .../{startup_latency.yml => startup_latency.json} | 0 gcp/project_setup/gcp_infra.sh | 8 ++++---- 4 files changed, 4 insertions(+), 4 deletions(-) rename gcp/project_setup/alert_policies/{request_latency.yml => request_latency.json} (100%) rename gcp/project_setup/alert_policies/{response_error_counts.yml => response_error_counts.json} (100%) rename gcp/project_setup/alert_policies/{startup_latency.yml => startup_latency.json} (100%) diff --git a/gcp/project_setup/alert_policies/request_latency.yml b/gcp/project_setup/alert_policies/request_latency.json similarity index 100% rename from gcp/project_setup/alert_policies/request_latency.yml rename to gcp/project_setup/alert_policies/request_latency.json diff --git a/gcp/project_setup/alert_policies/response_error_counts.yml b/gcp/project_setup/alert_policies/response_error_counts.json similarity index 100% rename from gcp/project_setup/alert_policies/response_error_counts.yml rename to gcp/project_setup/alert_policies/response_error_counts.json diff --git a/gcp/project_setup/alert_policies/startup_latency.yml b/gcp/project_setup/alert_policies/startup_latency.json similarity index 100% rename from gcp/project_setup/alert_policies/startup_latency.yml rename to gcp/project_setup/alert_policies/startup_latency.json diff --git a/gcp/project_setup/gcp_infra.sh b/gcp/project_setup/gcp_infra.sh index 68ff61ad..bceef7d6 100755 --- a/gcp/project_setup/gcp_infra.sh +++ b/gcp/project_setup/gcp_infra.sh @@ -18,13 +18,13 @@ bigquery.googleapis.com/projects/${HOST_PROJECT_ID}/datasets/cloud_run_logs_${TA # create alerts ALERT_POLICIES_DIR="alert_policies" -for policy_file in "$ALERT_POLICIES_DIR"/*.yml; do +for policy_file in "$ALERT_POLICIES_DIR"/*.json; do policy_name=$(basename "$policy_file") echo "Processing $policy_name..." - envsubst < "$policy_file" > alert_policy.yml - gcloud alpha monitoring policies create --policy-from-file=alert_policy.yml + envsubst < "$policy_file" > alert_policy.json + gcloud alpha monitoring policies create --policy-from-file=alert_policy.json if [ $? -eq 0 ]; then echo "Successfully created alert policy from $policy_name." @@ -32,6 +32,6 @@ for policy_file in "$ALERT_POLICIES_DIR"/*.yml; do echo "Failed to create alert policy from $policy_name." fi - rm -f alert_policy.yml + rm -f alert_policy.json done