Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

飞书告警模板中的主题背景颜色如何修改? #401

Open
zhangdongdong7 opened this issue Jun 7, 2024 · 1 comment
Open

飞书告警模板中的主题背景颜色如何修改? #401

zhangdongdong7 opened this issue Jun 7, 2024 · 1 comment

Comments

@zhangdongdong7
Copy link

目前告警模板中没有看到这个背景演示修改地方,我的模板如下:
{{ $var := .externalURL}}{{ range $k,$v:=.alerts }}
{{if eq $v.status "resolved"}}
Loki日志恢复信息

【恢复名称】{{$v.labels.alertname}}✅{{if $v.labels.severity}}
【恢复级别】{{if eq $v.labels.severity "0"}}提示{{else if eq $v.labels.severity "1"}}警告{{else if eq $v.labels.severity "2"}}一般严重{{else if eq $v.labels.severity "critical"}}P1{{else if eq $v.labels.severity "4"}}P0{{else}}{{$v.labels.severity}}{{end}}{{end}}
【开始时间】{{GetCSTtime $v.startsAt}}
【结束时间】{{GetCSTtime $v.endsAt}}
【服务名称】{{$v.labels.appname}}
【恢复实例】{{$v.labels.host}}

{{$v.annotations.summary}}
{{else}}
Loki日志告警信息

【告警名称】{{$v.labels.alertname}}🔥{{if $v.labels.severity}}
【告警级别】{{if eq $v.labels.severity "0"}}提示{{else if eq $v.labels.severity "1"}}警告🟡{{else if eq $v.labels.severity "2"}}一般严重🔥{{else if eq $v.labels.severity "critical"}}P1🔥🔥{{else if eq $v.labels.severity "4"}}P0🔥🔥❌{{else}}{{$v.labels.severity}}{{end}}{{end}}
【开始时间】{{GetCSTtime $v.startsAt}}
【服务名称】{{$v.labels.appname}}
【告警实例】{{$v.labels.host}}

{{$v.annotations.summary}}
[ 点我屏蔽该告警 ]
{{end}}
{{ end }}

但是收到的告警,有一个红色的主题背景:
image
请问应该如何修改这个红色的主题背景

@feiyu563
Copy link
Owner

源代码中定义的,可以自行修改后编译下
https://github.com/feiyu563/PrometheusAlert/blob/master/controllers/feishu.go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants