优化告警格式,增加 监控对象 (#918)

This commit is contained in:
zheng 2022-04-19 15:05:07 +08:00 committed by GitHub
parent ee4a918fc7
commit 5333fb8eab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 7 deletions

View File

@ -4,8 +4,8 @@
- **规则标题**: {{.RuleName}}{{if .RuleNote}} - **规则标题**: {{.RuleName}}{{if .RuleNote}}
- **规则备注**: {{.RuleNote}}{{end}} - **规则备注**: {{.RuleNote}}{{end}}
{{if not .IsRecovered}}- **触发时值**: {{.TriggerValue}}{{end}}
{{if .TargetIdent}}- **监控对象**: {{.TargetIdent}}{{end}}
- **监控指标**: {{.TagsJSON}} - **监控指标**: {{.TagsJSON}}
- {{if .IsRecovered}}**恢复时间**{{timeformat .LastEvalTime}}{{else}}**触发时间**: {{timeformat .TriggerTime}} - {{if .IsRecovered}}**恢复时间**: {{timeformat .LastEvalTime}}{{else}}**触发时间**: {{timeformat .TriggerTime}}{{end}}
- **触发时值**: {{.TriggerValue}}{{end}}
- **发送时间**: {{timestamp}} - **发送时间**: {{timestamp}}

View File

@ -162,6 +162,19 @@
<th>设备备注:</th> <th>设备备注:</th>
<td>{{.TargetNote}}</td> <td>{{.TargetNote}}</td>
</tr> </tr>
{{if not .IsRecovered}}
<tr>
<th>触发时值:</th>
<td>{{.TriggerValue}}</td>
</tr>
{{end}}
{{if .TargetIdent}}
<tr>
<th>监控对象:</th>
<td>{{.TargetIdent}}</td>
</tr>
{{end}}
<tr> <tr>
<th>监控指标:</th> <th>监控指标:</th>
<td>{{.TagsJSON}}</td> <td>{{.TagsJSON}}</td>
@ -173,10 +186,6 @@
<td>{{timeformat .LastEvalTime}}</td> <td>{{timeformat .LastEvalTime}}</td>
</tr> </tr>
{{else}} {{else}}
<tr>
<th>触发时值:</th>
<td>{{.TriggerValue}}</td>
</tr>
<tr> <tr>
<th>触发时间:</th> <th>触发时间:</th>
<td> <td>