rabbitmq告警未提供具体实例信息

Viewed 38

采集方式:categraf prometheus插件采集rabbitmq prometheus插件接口提供的指标。

级别状态: S2 Triggered
规则标题: [RabbitMQ] Unroutable Messages
规则备注: There were unroutable message within the last 5 minutes in RabbitMQ cluster
监控指标: [rulename=[RabbitMQ] Unroutable Messages]
触发时值: 82
首次触发时间: 2023-10-12 17:48:40
持续时长: 0s
发送时间: 2023-10-12 17:48:40

rabbitmq_channel_messages_unroutable_dropped_total{Public_Ip="xxx.xxx.xxx.xxx", Region="DeYang", busigroup="Default", ident="x.x.x.x", instance="http://x.x.0.x:15692/metrics", region="Deyang"}

2 Answers

可以看看你的指标数据吗,从结果来看,模版渲染时少了TargetIdent,而TargetIdent又源于ident标签,所以我觉得是数据没有ident标签导致的

//part1
{{if .TargetIdent}}- **监控对象**: {{.TargetIdent}}{{end}}
//part2
ident, has := p.tagsMap["ident"]

#夜莺查询出的结果
rabbitmq_channel_messages_unroutable_dropped_total{Public_Ip="xxx.xxx.xxx.xxx", Region="DeYang", busigroup="Default", ident="x.x.x.x", instance="http://x.x.0.x:15692/metrics", region="Deyang"}

#下面是通过curl指标页面过滤的指标


# HELP rabbitmq_channel_messages_unroutable_returned_total Total number of messages published as mandatory into an exchange and returned to the publisher as uroutable
rabbitmq_channel_messages_unroutable_returned_total 0
# TYPE rabbitmq_channel_messages_unroutable_dropped_total counter
# HELP rabbitmq_channel_messages_unroutable_dropped_total Total number of messages published as non-mandatory into an exchange and dropped as unroutable
rabbitmq_channel_messages_unroutable_dropped_total 5715
# TYPE rabbitmq_global_messages_unroutable_dropped_total counter
# HELP rabbitmq_global_messages_unroutable_dropped_total Total number of messages published as non-mandatory into an exchange and dropped as unroutable
rabbitmq_global_messages_unroutable_dropped_total{protocol="amqp091"} 39524
# TYPE rabbitmq_global_messages_unroutable_returned_total counter
# HELP rabbitmq_global_messages_unroutable_returned_total Total number of messages published as mandatory into an exchange and returned to the publisher as unroutable
rabbitmq_global_messages_unroutable_returned_total{protocol="amqp091"} 0

方便看你的告警规则不,导出告警规则。以及触发告警时n9e相关日志,例如关键字: DEBUG process/process.go:309 rule_eval