renamed google-chat to gchat
This commit is contained in:
parent
7b1947acd4
commit
ae79eda745
5 changed files with 13 additions and 13 deletions
|
|
@ -20,9 +20,9 @@ module "datasource" {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Alert Receiver / Contact Point
|
# Alert Receiver / Contact Point
|
||||||
module "google-chat-contact-point" {
|
module "gchat-contact-point" {
|
||||||
source = "git::https://commerce-platform.git.onstackit.cloud/commerce-platform-public/terraform-modules//grafana/contact-point-gchat?ref=main"
|
source = "git::https://commerce-platform.git.onstackit.cloud/commerce-platform-public/terraform-modules//grafana/contact-point-gchat?ref=main"
|
||||||
google-chat-url = var.google_chat_url
|
gchat-url = var.google_chat_url
|
||||||
contact-point-name = "gchat"
|
contact-point-name = "gchat"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,11 +45,11 @@ module "message-templates" {
|
||||||
module "notification-policy" {
|
module "notification-policy" {
|
||||||
source = "git::https://commerce-platform.git.onstackit.cloud/commerce-platform-public/terraform-modules//grafana/notification-policy?ref=main"
|
source = "git::https://commerce-platform.git.onstackit.cloud/commerce-platform-public/terraform-modules//grafana/notification-policy?ref=main"
|
||||||
|
|
||||||
default_contact_point_uid = module.google-chat-contact-point.contact_name
|
default_contact_point_uid = module.gchat-contact-point.contact_name
|
||||||
group_by = ["alertname"]
|
group_by = ["alertname"]
|
||||||
|
|
||||||
folder_policies = {
|
folder_policies = {
|
||||||
"Alerts" = module.google-chat-contact-point.contact_name
|
"Alerts" = module.gchat-contact-point.contact_name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,7 +59,7 @@ module "alerting" {
|
||||||
|
|
||||||
alerts_dir = "alerts"
|
alerts_dir = "alerts"
|
||||||
default_datasource_uid = module.datasource.datasource_uid
|
default_datasource_uid = module.datasource.datasource_uid
|
||||||
default_receiver = module.google-chat-contact-point.contact_name
|
default_receiver = module.gchat-contact-point.contact_name
|
||||||
default_folder_uid = module.alert-folder.folder_uid
|
default_folder_uid = module.alert-folder.folder_uid
|
||||||
default_interval_seconds = 60
|
default_interval_seconds = 60
|
||||||
disable_provenance = true
|
disable_provenance = true
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ resource "grafana_contact_point" "this" {
|
||||||
name = var.contact-point-name
|
name = var.contact-point-name
|
||||||
|
|
||||||
googlechat {
|
googlechat {
|
||||||
url = var.google-chat-url
|
url = var.gchat-url
|
||||||
message = "{{ template \"google-chat-body-template\" . }}"
|
message = "{{ template \"gchat-body-template\" . }}"
|
||||||
title = "{{ template \"google-chat-title-template\" . }}"
|
title = "{{ template \"gchat-title-template\" . }}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
# Grafana contact point
|
# Grafana contact point
|
||||||
variable "google-chat-url" {
|
variable "gchat-url" {
|
||||||
description = "google-chat-webhook url"
|
description = "gchat-webhook url"
|
||||||
type = string
|
type = string
|
||||||
sensitive = true
|
sensitive = true
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "contact-point-name" {
|
variable "contact-point-name" {
|
||||||
description = "google-chat-contact-point-name"
|
description = "gchat-contact-point-name"
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{{ define "google-chat-body-template" -}}
|
{{ define "gchat-body-template" -}}
|
||||||
{{- $alerts := .Alerts }}
|
{{- $alerts := .Alerts }}
|
||||||
{{- if not $alerts }}{{ $alerts = . }}{{ end }}
|
{{- if not $alerts }}{{ $alerts = . }}{{ end }}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{{ define "google-chat-title-template" -}}
|
{{ define "gchat-title-template" -}}
|
||||||
{{- if eq .Status "firing" -}}
|
{{- if eq .Status "firing" -}}
|
||||||
🔥 Firing:
|
🔥 Firing:
|
||||||
{{- else if eq .Status "resolved" -}}
|
{{- else if eq .Status "resolved" -}}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue