-
Notifications
You must be signed in to change notification settings - Fork 806
Expand file tree
/
Copy pathdefault-wecom-post.tmpl
More file actions
52 lines (52 loc) · 2.03 KB
/
default-wecom-post.tmpl
File metadata and controls
52 lines (52 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{"msgtype": "markdown","markdown": {"content": "
{{- $StatusURL := "https://pkg.go.dev/github.com/linkedin/Burrow/core/protocol#StatusConstant"}}
{{- $FormatString := "2006-01-02 15:04:05"}}
# Kafka: {{.Cluster}}
ConsumerGroup: {{.Group}}{{- with .Result.Status}}
{{- if eq . 0}}NotFound{{end}}
{{- if eq . 1}}<font color=\"info\">normal</font>{{end}}
{{- if eq . 2}}<font color=\"warning\">lagging</font>{{end}}
{{- if eq . 3}}<font color=\"comment\">abnormal</font>{{end}}
{{- end}}
**Status:** Total(Partitions={{.Result.TotalPartitions}},Lag={{.Result.TotalLag}})[{{- with .Result.Status}}
{{- if eq . 0}}NotFound{{end}}
{{- if eq . 1}}<font color=\"info\">{{.}}</font>{{end}}
{{- if eq . 2}}<font color=\"warning\">{{.}}</font>{{end}}
{{- if eq . 3}}<font color=\"comment\">{{.}}</font>{{end}}
{{- end}}]({{$StatusURL}}){{printf "%.2f" .Result.Complete}}
{{- if .Result.Maxlag|maxlag}}
**MaxLagDetails:**
{{- with .Result.Maxlag}}
{{.Topic}}[{{.Status.String}}](){{printf "%.2f" .Complete}}
{{- if .Owner}}\n\tConsumerHost={{.Owner}}{{end}}
{{- if .ClientID}}\n\tConsumerClientID={{.ClientID}}{{end}}
\tCurrentLag={{.CurrentLag}}
\tPartition={{.Partition}}
{{- end}}
{{- end}}
{{- $TotalErrors := len .Result.Partitions}}
{{- if $TotalErrors}}
### <font color=\"comment\">{{$TotalErrors}} partitions have problems</font>
>**CountPartitions:**
{{- range $k,$v := .Result.Partitions|partitioncounts}}
{{- if ne $v 0}}\n\t{{$k}}={{$v}}{{end}}
{{- end}}
**TopicsByStatus:**
{{- range $k,$v := .Result.Partitions|topicsbystatus}}
\t{{$k}}={{$v}}
{{- end}}
**PartitionDetails:**
{{- range .Result.Partitions}}
{{.Topic}}[{{.Status.String}}](){{printf "%.2f" .Complete}}
{{- if .Owner}}\n\tConsumerHost={{.Owner}}{{end}}
{{- if .ClientID}}\n\tConsumerClientID={{.ClientID}}{{end}}
\tCurrentLag={{.CurrentLag}}
\tPartition={{.Partition}}
\tStart={{formattimestamp .Start.Timestamp $FormatString}}
\t\tOffset={{.Start.Offset}}\tLag={{.Start.Lag.Value}}
\tEnd={{formattimestamp .End.Timestamp $FormatString}}
\t\tOffset={{.End.Offset}}\tLag={{.End.Lag.Value}}
{{- end}}
{{- end}}
"
}}