-
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.
✨ Update Dev Branch with new changes (#56)
* 🔧 Update configuration for Slack Alert Manager (#54) * ✨ Introduce Rate limiting for Coingecko integration (#55)
- Loading branch information
Showing
5 changed files
with
243 additions
and
71 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
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
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,58 @@ | ||
{{/* Slack alert title */}} | ||
{{ define "slack.title" -}} | ||
[{{ .Status | toUpper }}{{if eq .Status "firing"}}:{{ .Alerts.Firing | len }}{{end}}] | ||
{{ if eq .Status "firing" -}} | ||
{{- if eq .CommonLabels.severity "critical" }}🔥 | ||
{{- else if eq .CommonLabels.severity "warning" }}⚠️ | ||
{{- else }}ℹ️ | ||
{{- end }} | ||
{{- else -}} | ||
✅ | ||
{{- end }} | ||
{{ .CommonLabels.alertname }} | ||
{{- end }} | ||
|
||
{{/* Slack attachment color */}} | ||
{{ define "slack.color" -}} | ||
{{- if eq .Status "firing" -}} | ||
{{- if eq .CommonLabels.severity "critical" -}} | ||
danger | ||
{{- else if eq .CommonLabels.severity "warning" -}} | ||
warning | ||
{{- else -}} | ||
#439FE0 | ||
{{- end -}} | ||
{{- else -}} | ||
good | ||
{{- end -}} | ||
{{- end }} | ||
|
||
{{/* Slack icon emoji */}} | ||
{{ define "slack.icon_emoji" -}} | ||
:alert: | ||
{{- end }} | ||
|
||
{{/* Main alert text */}} | ||
{{ define "slack.text" -}} | ||
{{- range .Alerts -}} | ||
*Alert Details:* | ||
{{- if .Annotations.summary }} | ||
• *Summary:* {{ .Annotations.summary }} | ||
{{- end }} | ||
{{- if .Annotations.description }} | ||
• *Description:* {{ .Annotations.description }} | ||
{{- end }} | ||
|
||
*Additional Information:* | ||
• *Network:* {{ .Labels.network }} | ||
• *Publisher:* {{ .Labels.publisher }} | ||
• *Severity:* {{ .Labels.severity | toUpper }} | ||
• *Type:* {{ .Labels.type }} | ||
• *Started:* {{ .StartsAt | since }} | ||
|
||
{{- if .Labels.pair }} | ||
• *Trading Pair:* {{ .Labels.pair }} | ||
{{- end }} | ||
--- | ||
{{ end }} | ||
{{- end }} |
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
Oops, something went wrong.