forked from raystack/siren
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e0254a
commit 2a025e6
Showing
45 changed files
with
158 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 0 additions & 54 deletions
54
assets/files/default_alert_template_body-d865b56363471a2d45e7a21b65b110c3.goyaml
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
assets/files/default_alert_template_body-e65168e2ff7d3d88655690240e64a4e3.goyaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{{- define "__alert_severity_prefix_emoji" -}} | ||
{{if ne .Data.status "firing" -}} | ||
:white_check_mark: | ||
{{- else if eq .Data.severity "CRITICAL" -}} | ||
:fire: | ||
{{- else if eq .Data.severity "WARNING" -}} | ||
:warning: | ||
{{- else -}} | ||
:question: | ||
{{- end}} | ||
{{- end}} | ||
{{- define "slack.pretext" -}} | ||
{{- template "__alert_severity_prefix_emoji" . }} ({{ .Data.status | toUpper }}{{ if eq .Data.status "firing" }}:{{ .Data.num_alerts_firing }}{{ end }}) | ||
{{- if eq .Data.status "resolved" }} ~({{ .Data.severity | toUpper }})~ | ||
{{- else }} *({{ .Data.severity | toUpper }})* | ||
{{- end}} {{ if .Data.alert_name }}{{.Data.alert_name}}{{else}}{{.Data.alertname}}{{end}} | ||
{{- end }} | ||
{{- define "slack.color" -}} | ||
{{- if eq .Data.status "firing" -}} | ||
{{if eq .Data.severity "WARNING" -}} | ||
warning | ||
{{- else if eq .Data.severity "CRITICAL" -}} | ||
danger | ||
{{- else -}} | ||
#439FE0 | ||
{{- end -}} | ||
{{else -}} | ||
good | ||
{{- end}} | ||
{{- end}} | ||
{{- define "slack.body"}} | ||
{{- .Data.summary}} | ||
{{ end}} | ||
{{- define "slack.dashboard"}} | ||
{{- if .Data.dashboard}}{{.Data.dashboard}}{{else}}{{.Data.defaultDashboard}}{{end}} | ||
{{- end -}} | ||
{{- define "slack.runbook"}} | ||
{{- if .Data.playbook}}{{.Data.playbook}}{{end}} | ||
{{- end -}} | ||
username: "Siren" | ||
icon_emoji: ":eagle:" | ||
attachments: | ||
- title: "" | ||
pretext: "{{template "slack.pretext" . }}" | ||
text: | | ||
{{.Data.summary | indent 6}} | ||
color: "{{template "slack.color" . }}" | ||
actions: | ||
- type: button | ||
text: "Runbook :books:" | ||
url: "{{template "slack.runbook" . }}" | ||
- type: button | ||
text: 'Dashboard :bar_chart:' | ||
url: "{{template "slack.dashboard" . }}" |
23 changes: 0 additions & 23 deletions
23
assets/files/default_alert_template_body_v1-4029dc49cf8b324bd4aff10e4c53cc04.goyaml
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
assets/files/default_alert_template_body_v1-4484a2a192e97ed50b378513107ec9c4.goyaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{{- define "pagerduty.event_type" -}} | ||
{{if eq .Data.status "firing" -}} | ||
trigger | ||
{{- else if eq .Data.status "resolved" -}} | ||
resolve | ||
{{- else -}} | ||
unknown | ||
{{- end}} | ||
{{- end}} | ||
event_type: "{{template "pagerduty.event_type" . }}" | ||
{{if .Data.id}}incident_key: "{{.UniqueKey}}"{{ end }} | ||
description: ({{ .Data.status | toUpper }}{{ if eq .Data.status "firing" }}:{{ .Data.num_alerts_firing }}{{ end }}) | ||
{{- if eq .Data.status "resolved" }} ~({{ .Data.severity | toUpper }})~ | ||
{{- else }} *({{ .Data.severity | toUpper }})* | ||
{{- end}} {{ if .Data.alert_name }}{{.Data.alert_name}}{{else}}{{.Data.alertname}}{{end}} | ||
client: Siren | ||
details: | ||
Labels: | ||
{{ range $index, $element := .Labels }}- "{{ $index }} = {{ $element }}" | ||
{{ end }} | ||
Annotations: | ||
{{ range $index, $element := .Data }}- "{{ $index }} = {{ $element }}" | ||
{{ end }} |
Oops, something went wrong.