Skip to content

Commit

Permalink
✨: Add betterstack alertmanager receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
tmechsner committed Dec 10, 2024
1 parent a510364 commit 7026016
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ config:
)
-}}
{{- end -}}
{{- if .Values.monitoring.prometheus.alertmanager.receivers.betterstack.enabled -}}
{{- $receivers = set $receivers "betterstack" (dict
"webhook_configs" (list
(dict
"url" (printf "https://uptime.betterstack.com/api/v1/prometheus/webhook/%s" (.Values.monitoring.prometheus.alertmanager.receivers.betterstack.webhookKey | required "You need to provide the `.Values.monitoring.prometheus.alertmanager.receivers.betterstack.webhookKey`"))
)
)
)
-}}
{{- end -}}
{{- if and .Values.monitoring.deadMansSwitch.enabled .Values.global.baseDomain .Values.global.clusterName -}}
{{- $receivers = set $receivers "healthchecks.io" (dict
"webhook_configs" (list
Expand All @@ -68,11 +78,14 @@ config:
{{- end }}
receivers: {{- toYaml $receiversList | nindent 4 }}
route: {{- if hasKey $receivers "pagerduty" }}
receiver: pagerduty
- receiver: pagerduty
{{- end }}
{{- if hasKey $receivers "betterstack" }}
- receiver: betterstack
{{- end }}
{{- $routes := list (dict "match" (dict "alertname" "InfoInhibitor") "receiver" "null") -}}
{{- $routes = append $routes (dict "match" (dict "alertname" "Watchdog") "receiver" (hasKey $receivers "healthchecks.io" | ternary "healthchecks.io" "null") "group_interval" "1m" "repeat_interval" "1m") }}
routes: {{- toYaml $routes | nindent 6 }}
routes : {{- toYaml $routes | nindent 6 }}
{{- else }}
enabled: false
{{- end }}
Expand Down
12 changes: 12 additions & 0 deletions charts/base-cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,18 @@
}
},
"additionalProperties": false
},
"betterstack": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"webhookKey": {
"type": "string"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
Expand Down
3 changes: 3 additions & 0 deletions charts/base-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ monitoring:
enabled: false
integrationKey: ""
url: https://events.pagerduty.com/v2/enqueue
betterstack:
enabled: false
webhookKey: ""
ingress:
host: alertmanager
customDomain: ""
Expand Down

0 comments on commit 7026016

Please sign in to comment.