Skip to content

Commit

Permalink
Removed details and level info
Browse files Browse the repository at this point in the history
  • Loading branch information
esuwu committed Feb 13, 2024
1 parent 49b4375 commit 6d67dad
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 52 deletions.
12 changes: 6 additions & 6 deletions cmd/bots/internal/common/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,16 +837,16 @@ func executeStateHashTemplate(
}

if statement.FirstGroup.BlockID != statement.SecondGroup.BlockID {
msg, err := executeTemplate("templates/alerts/state_hash_several_chains_alert", statement, extension)
if err != nil {
return "", err
msg, tmplErr := executeTemplate("templates/alerts/state_hash_several_chains_alert", statement, extension)
if tmplErr != nil {
return "", tmplErr
}
return msg, nil
}

msg, err := executeTemplate("templates/alerts/state_hash_alert", statement, extension)
if err != nil {
return "", err
msg, tmplErr := executeTemplate("templates/alerts/state_hash_alert", statement, extension)
if tmplErr != nil {
return "", tmplErr
}
return msg, nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/bots/internal/common/templates/alerts/alert_fixed.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ .PreviousAlert}} issue has been resolved
{{ .PreviousAlert}} issue has been resolved
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<b>Alert type:</b> Base Target
<b>Details:</b> Base target is greater than the threshold value. The threshold value is {{ .Threshold}}
<b>Base Target Alert</b>
Base target is greater than the threshold value. The threshold value is {{ .Threshold}}
{{ with .BaseTargetValues }}
{{range .}}
Node: <code>{{ .Node }}</code>
<code>{{ .Node }}</code>
Base Target: <code>{{ .BaseTarget }}</code>
{{end}}
{{end}}
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
```yaml
Alert type: Base Target

Level: Error ❌

Details: Base target is greater than the threshold value. The threshold value is {{ .Threshold }}
{{ with .BaseTargetValues }}
{{ range . }}
Expand Down
4 changes: 2 additions & 2 deletions cmd/bots/internal/common/templates/alerts/height_alert.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<b>Alert type:</b> Height ❌
<b>Details:</b> Some node(s) are {{ .HeightDifference}} blocks behind
<b>Height Alert</b>
Some node(s) are {{ .HeightDifference}} blocks behind
{{ with .FirstGroup }}
First group with height <code>{{ .Height}}</code>:{{range .Nodes}}
<code>{{.}}</code>{{end}}{{end}}
Expand Down
3 changes: 0 additions & 3 deletions cmd/bots/internal/common/templates/alerts/height_alert.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
```yaml
Alert type: Height ❌

Level: Error ❌

Details: Some node(s) are {{ .HeightDifference}} blocks behind

{{ with .FirstGroup }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<b>Alert type:</b> Incomplete ❔
<b>Details:</b> Incomplete statement for node {{ .Node}} {{ .Version}} at height {{ .Height}}
❗️<b>Incomplete Alert:</b>
Incomplete statement for node {{ .Node}} {{ .Version}} at height {{ .Height}}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
```yaml
Alert type: Incomplete ❔

Level: Warning ❗

Alert type: Incomplete❗️
Details: Incomplete statement for node {{ .Node}} {{ .Version}} at height {{ .Height}}
```
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<b>Alert type:</b> Internal Error ❗️
❗️<b>Internal Error Alert</b>
<b>Details:</b> An internal error has occurred: {{ .Error}}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
```yaml
Alert type: Internal Error ❗️

Level: Warning ❗

Details: An internal error has occurred, {{ .Error}}
```
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<b>Alert type:</b> Invalid Height ❌
<b>Details:</b> Node {{ .Node}} {{ .Version}} has an invalid height {{ .Height}}
<b>Invalid Height Alert</b>
Node {{ .Node}} {{ .Version}} has an invalid height {{ .Height}}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
```yaml
Alert type: Invalid Height ❌

Level: Warning ❗

Details: Node {{ .Node}} {{ .Version}} has an invalid height {{ .Height}}
```
4 changes: 2 additions & 2 deletions cmd/bots/internal/common/templates/alerts/simple_alert.html
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<b>Alert type:</b> Simple Alert ❌
<b>Details:</b> {{ .Description}}
<b>Simple Alert </b>
{{ .Description}}
3 changes: 0 additions & 3 deletions cmd/bots/internal/common/templates/alerts/simple_alert.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
```yaml
Alert type: Simple Alert ❌

Level: Error ❌

Details: {{ .Description}}
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<b>Alert type:</b> Diverging State Hashes
<b>Details:</b> Nodes on the same chain have diverging state hashes at{{ .SameHeight}}
<b>Diverging State Hashes</b>
Nodes on the same chain have diverging state hashes at{{ .SameHeight}}
{{ with .FirstGroup }}
<i>BlockID:</i> <code>{{ .BlockID}}</code>
<i>State Hash:</i> <code>{{ .StateHash}}</code>
Expand Down
3 changes: 0 additions & 3 deletions cmd/bots/internal/common/templates/alerts/state_hash_alert.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
```yaml
Alert type: State Hash ❌

Level: Error ❌

Details: Nodes have different state hashes at the same height {{ .SameHeight}}
{{ with .FirstGroup }}
BlockID (First group): {{ .BlockID}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<b>Alert type:</b> Several Chains Detected
<b>Several Chains Detected</b>
{{ with .FirstGroup }}
<i>BlockID:</i> <code>{{ .BlockID}}</code>{{range .Nodes}}
<code>{{.}}</code>{{end}}{{end}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```yaml
Alert type: Several Chains Detected ❌
Details: Nodes have different state hashes at the same height {{ .SameHeight}}
{{ with .FirstGroup }}
BlockID (First group): {{ .BlockID}}
{{range .Nodes}}
{{.}}
{{end}}
{{end}}
{{ with .SecondGroup }}
BlockID (Second group): {{ .BlockID}}
{{range .Nodes}}
{{.}}
{{end}}
{{end}}
{{ if .LastCommonStateHashExist }}
Last common Block: {{ .ForkBlockID}} at {{ .ForkHeight}}
{{ end }}
```
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<b>Alert type:</b> Unreachable ❌
<b>Details:</b> Node {{ .Node}} is unreachable
<b>Unreachable Alert</b>
Node {{ .Node}} is unreachable
Original file line number Diff line number Diff line change
@@ -1 +1 @@
UnreachableAlert issue has been resolved
UnreachableAlert issue has been resolved
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<b>Alert type:</b> Base Target

<b>Level:</b> Error ❌

<b>Details:</b> Base target is greater than the threshold value. The threshold value is 101
<b>Base Target Alert</b>
Base target is greater than the threshold value. The threshold value is 101


Node: <code>test1</code>
Expand Down

0 comments on commit 6d67dad

Please sign in to comment.