Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Nightingale
提交
0e88f007
N
Nightingale
项目概览
jobily
/
Nightingale
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
Nightingale
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0e88f007
编写于
12月 08, 2021
作者:
U
Ulric Qin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add recover_time
上级
2bfc6768
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
19 addition
and
7 deletion
+19
-7
docker/initsql/n9e.sql
docker/initsql/n9e.sql
+1
-0
etc/template/dingtalk.tpl
etc/template/dingtalk.tpl
+2
-2
etc/template/feishu.tpl
etc/template/feishu.tpl
+2
-2
etc/template/mailbody.tpl
etc/template/mailbody.tpl
+9
-0
etc/template/wecom.tpl
etc/template/wecom.tpl
+2
-2
src/models/alert_cur_event.go
src/models/alert_cur_event.go
+2
-1
src/models/alert_his_event.go
src/models/alert_his_event.go
+1
-0
未找到文件。
docker/initsql/n9e.sql
浏览文件 @
0e88f007
...
...
@@ -318,6 +318,7 @@ CREATE TABLE `alert_his_event` (
`target_note`
varchar
(
191
)
not
null
default
''
comment
'target note'
,
`trigger_time`
bigint
not
null
,
`trigger_value`
varchar
(
255
)
not
null
,
`recover_time`
bigint
not
null
default
0
,
`tags`
varchar
(
1024
)
not
null
default
''
comment
'merge data_tags rule_tags, split by ,,'
,
PRIMARY
KEY
(
`id`
),
KEY
(
`hash`
),
...
...
etc/template/dingtalk.tpl
浏览文件 @
0e88f007
...
...
@@ -2,5 +2,5 @@
规则名称: {{.RuleName}}{
{
if
.
RuleNote
}
}
规则备注: {{.RuleNote}}{
{
end
}
}
监控指标: {{.TagsJSON}}
触发时间: {
{
timeformat
.
TriggerTime
}
}
触发时值: {{.TriggerValue}}
\ No newline at end of file
{
{
if
.
IsRecovered
}
}恢复时间:{
{
timeformat
.
LastEvalTime
}
}{
{
else
}
}触发时间: {
{
timeformat
.
TriggerTime
}
}
触发时值: {{.TriggerValue}}{
{
end
}
}
\ No newline at end of file
etc/template/feishu.tpl
浏览文件 @
0e88f007
...
...
@@ -2,5 +2,5 @@
规则名称: {{.RuleName}}{
{
if
.
RuleNote
}
}
规则备注: {{.RuleNote}}{
{
end
}
}
监控指标: {{.TagsJSON}}
触发时间: {
{
timeformat
.
TriggerTime
}
}
触发时值: {{.TriggerValue}}
\ No newline at end of file
{
{
if
.
IsRecovered
}
}恢复时间:{
{
timeformat
.
LastEvalTime
}
}{
{
else
}
}触发时间: {
{
timeformat
.
TriggerTime
}
}
触发时值: {{.TriggerValue}}{
{
end
}
}
\ No newline at end of file
etc/template/mailbody.tpl
浏览文件 @
0e88f007
...
...
@@ -162,6 +162,13 @@
<th>
监控指标:
</th>
<td>
{{.TagsJSON}}
</td>
</tr>
{
{
if
.
IsRecovered
}
}
<tr>
<th>
恢复时间:
</th>
<td>
{
{
timeformat
.
LastEvalTime
}
}
</td>
</tr>
{
{
else
}
}
<tr>
<th>
触发时值:
</th>
<td>
{{.TriggerValue}}
</td>
...
...
@@ -172,6 +179,8 @@
{
{
timeformat
.
TriggerTime
}
}
</td>
</tr>
{
{
end
}
}
<tr>
<th>
PromQL:
</th>
<td>
...
...
etc/template/wecom.tpl
浏览文件 @
0e88f007
...
...
@@ -2,5 +2,5 @@
**规则标题**: {{.RuleName}}{
{
if
.
RuleNote
}
}
**规则备注**: {{.RuleNote}}{
{
end
}
}
**监控指标**: {{.TagsJSON}}
**触发时间**: {
{
timeformat
.
TriggerTime
}
}
**触发时值**: {{.TriggerValue}}
\ No newline at end of file
{
{
if
.
IsRecovered
}
}**恢复时间**:{
{
timeformat
.
LastEvalTime
}
}{
{
else
}
}**触发时间**: {
{
timeformat
.
TriggerTime
}
}
**触发时值**: {{.TriggerValue}}{
{
end
}
}
\ No newline at end of file
src/models/alert_cur_event.go
浏览文件 @
0e88f007
...
...
@@ -37,7 +37,7 @@ type AlertCurEvent struct {
TagsMap
map
[
string
]
string
`json:"-" gorm:"-"`
// for internal usage
IsRecovered
bool
`json:"is_recovered" gorm:"-"`
// for notify.py
NotifyUsersObj
[]
*
User
`json:"notify_users_obj" gorm:"-"`
// for notify.py
LastEvalTime
int64
`json:"last_eval_time" gorm:"-"`
// for
internal usage
LastEvalTime
int64
`json:"last_eval_time" gorm:"-"`
// for
notify.py
}
func
(
e
*
AlertCurEvent
)
TableName
()
string
{
...
...
@@ -80,6 +80,7 @@ func (e *AlertCurEvent) ToHis() *AlertHisEvent {
TriggerTime
:
e
.
TriggerTime
,
TriggerValue
:
e
.
TriggerValue
,
Tags
:
e
.
Tags
,
RecoverTime
:
e
.
LastEvalTime
,
}
}
...
...
src/models/alert_his_event.go
浏览文件 @
0e88f007
...
...
@@ -31,6 +31,7 @@ type AlertHisEvent struct {
TargetNote
string
`json:"target_note"`
TriggerTime
int64
`json:"trigger_time"`
TriggerValue
string
`json:"trigger_value"`
RecoverTime
int64
`json:"recover_time"`
Tags
string
`json:"-"`
TagsJSON
[]
string
`json:"tags" gorm:"-"`
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录