Skip to content

夜莺回调数据中hash字段代表什么? #1172

Answered by UlricQin
LiangYang1018 asked this question in Q&A
Discussion options

You must be logged in to vote

hash字段的生成由两部分决定,一个是告警规则的ID,另一个是通过promql查询返回的vector的标签集。比如你配置了一条告警规则(规则ID假设是33):

mem_used_percent > 80

如果有两个机器都触发了阈值,拿着这个 promql 去查询就会返回两条数据:

mem_used_percent{ident="10.2.3.4", region="bj"} 89
mem_used_percent{ident="10.2.3.5", region="bj"} 86

此时会产生两条告警事件,每个告警事件对应一个hash值,姑且可以这么理解:

hash1=md5(33+mem_used_percent{ident="10.2.3.4", region="bj"})
hash2=md5(33+mem_used_percent{ident="10.2.3.5", region="bj"})

如果未来10.2.3.4这个机器告警恢复了,hash值不会变,可以追踪到这个机器历史上所有的内存告警事件和内存恢复事件

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by UlricQin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants