diff --git a/dp-terraform/helm/rhacs-terraform/charts/observability/templates/01-operator-03-secret-alertmanager.yaml b/dp-terraform/helm/rhacs-terraform/charts/observability/templates/01-operator-03-secret-alertmanager.yaml index e6f743feab..f66edfa7d8 100644 --- a/dp-terraform/helm/rhacs-terraform/charts/observability/templates/01-operator-03-secret-alertmanager.yaml +++ b/dp-terraform/helm/rhacs-terraform/charts/observability/templates/01-operator-03-secret-alertmanager.yaml @@ -8,23 +8,34 @@ stringData: global: resolve_timeout: 5m route: - receiver: default-receiver + receiver: managed-rhacs-pagerduty repeat_interval: 12h routes: - - receiver: managed-rhacs-pagerduty - match: - observability: managed-rhacs - severity: critical - receiver: managed-rhacs-deadmanssnitch repeat_interval: 5m match: alertname: DeadMansSwitch observability: managed-rhacs receivers: - - name: default-receiver - name: managed-rhacs-pagerduty pagerduty_configs: - - service_key: {{ .Values.pagerduty.key | quote }} + - routing_key: {{ .Values.pagerduty.key | quote }} + {{- /* + We want the severity to be based on the severity label coming from the + alert itself. If there is no severity label common to the group of + alerts, then default to info. That looks like: + `or .GroupLabels.severity "info"` + in Go templating. To properly escape for Helm templating, the Helm + templating engine needs to output the literal string `{{`, since + Alertmanager templating syntax is the same as Helm. To do that, + the expression `{{` is used inside the double bracket syntax for + evaluating Go template expressions. Thus: `{{ "{{" }}`. + + The inner double quotes work because Helm evaluates the expression + that includes the inner double quotes before the document is parsed + as yaml. + */}} + severity: "{{ "{{" }} or .GroupLabels.severity \"info\" }}" - name: managed-rhacs-deadmanssnitch webhook_configs: - url: {{ .Values.deadMansSwitch.url | quote }} diff --git a/dp-terraform/helm/rhacs-terraform/terraform_cluster.sh b/dp-terraform/helm/rhacs-terraform/terraform_cluster.sh index fe6595ce7d..2b99b1dc1e 100755 --- a/dp-terraform/helm/rhacs-terraform/terraform_cluster.sh +++ b/dp-terraform/helm/rhacs-terraform/terraform_cluster.sh @@ -156,7 +156,7 @@ invoke_helm "${SCRIPT_DIR}" rhacs-terraform \ --set observability.observatorium.gateway="${OBSERVABILITY_OBSERVATORIUM_GATEWAY}" \ --set observability.observatorium.metricsClientId="${OBSERVABILITY_OBSERVATORIUM_METRICS_CLIENT_ID}" \ --set observability.observatorium.metricsSecret="${OBSERVABILITY_OBSERVATORIUM_METRICS_SECRET}" \ - --set observability.pagerduty.key="${OBSERVABILITY_PAGERDUTY_SERVICE_KEY}" \ + --set observability.pagerduty.key="${OBSERVABILITY_PAGERDUTY_ROUTING_KEY}" \ --set observability.deadMansSwitch.url="${OBSERVABILITY_DEAD_MANS_SWITCH_URL}" # To uninstall an existing release: