mirror of
https://github.com/pushbits/server.git
synced 2025-06-12 15:42:14 +02:00
fix typos
This commit is contained in:
parent
101db63649
commit
9fecabf1f7
1 changed files with 8 additions and 8 deletions
|
@ -8,17 +8,17 @@ type AlertmanagerWebhook struct {
|
||||||
Receiver string `json:"receiver"`
|
Receiver string `json:"receiver"`
|
||||||
GroupLabels map[string]string `json:"groupLabels"`
|
GroupLabels map[string]string `json:"groupLabels"`
|
||||||
CommonLabels map[string]string `json:"commonLabels"`
|
CommonLabels map[string]string `json:"commonLabels"`
|
||||||
CommonAnnotations map[string]string `json:"commonAnnotiations"`
|
CommonAnnotations map[string]string `json:"commonAnnotations"`
|
||||||
ExternalURL string `json:"externalURL"`
|
ExternalURL string `json:"externalURL"`
|
||||||
Alerts []AlertmanagerAlert `json:"alerts"`
|
Alerts []AlertmanagerAlert `json:"alerts"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AlertmanagerAlert struct {
|
type AlertmanagerAlert struct {
|
||||||
Labels map[string]string `json:"labels"`
|
Labels map[string]string `json:"labels"`
|
||||||
Annotiations map[string]string `json:"annotiations"`
|
Annotations map[string]string `json:"annotations"`
|
||||||
StartsAt string `json:"startsAt"`
|
StartsAt string `json:"startsAt"`
|
||||||
EndsAt string `json:"endsAt"`
|
EndsAt string `json:"endsAt"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (alert *AlertmanagerAlert) ToNotification(titleAnnotation, messageAnnotation string) Notification {
|
func (alert *AlertmanagerAlert) ToNotification(titleAnnotation, messageAnnotation string) Notification {
|
||||||
|
@ -35,7 +35,7 @@ func (alert *AlertmanagerAlert) ToNotification(titleAnnotation, messageAnnotatio
|
||||||
message.WriteString(alert.Status)
|
message.WriteString(alert.Status)
|
||||||
message.WriteString("\n\n")
|
message.WriteString("\n\n")
|
||||||
|
|
||||||
if titleString, ok := alert.Annotiations[titleAnnotation]; ok {
|
if titleString, ok := alert.Annotations[titleAnnotation]; ok {
|
||||||
title.WriteString(titleString)
|
title.WriteString(titleString)
|
||||||
} else if titleString, ok := alert.Labels[titleAnnotation]; ok {
|
} else if titleString, ok := alert.Labels[titleAnnotation]; ok {
|
||||||
title.WriteString(titleString)
|
title.WriteString(titleString)
|
||||||
|
@ -43,7 +43,7 @@ func (alert *AlertmanagerAlert) ToNotification(titleAnnotation, messageAnnotatio
|
||||||
title.WriteString("Unknown Title")
|
title.WriteString("Unknown Title")
|
||||||
}
|
}
|
||||||
|
|
||||||
if messageString, ok := alert.Annotiations[messageAnnotation]; ok {
|
if messageString, ok := alert.Annotations[messageAnnotation]; ok {
|
||||||
message.WriteString(messageString)
|
message.WriteString(messageString)
|
||||||
} else if messageString, ok := alert.Labels[messageAnnotation]; ok {
|
} else if messageString, ok := alert.Labels[messageAnnotation]; ok {
|
||||||
message.WriteString(messageString)
|
message.WriteString(messageString)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue