[Bugfix]修复Prometheus中Group部分指标缺少的问题(#756)

This commit is contained in:
zengqiao
2022-11-14 10:58:01 +08:00
committed by EricZeng
parent 7661826ea5
commit 8ffe7e7101

View File

@@ -139,11 +139,21 @@ public abstract class AbstractMonitorSinkService implements ApplicationListener<
for(GroupMetrics g : groupMetrics){
if(g.isBGroupMetric()){
// Group 指标
Map<String, Object> tagsMap = new HashMap<>();
tagsMap.put(CLUSTER_ID.getName(), g.getClusterPhyId());
tagsMap.put(CONSUMER_GROUP.getName(), g.getGroup());
pointList.addAll(genSinkPoint("Group", g.getMetrics(), g.getTimestamp(), tagsMap));
} else {
// Group + Topic + Partition指标
Map<String, Object> tagsMap = new HashMap<>();
tagsMap.put(CLUSTER_ID.getName(), g.getClusterPhyId());
tagsMap.put(CONSUMER_GROUP.getName(), g.getGroup());
tagsMap.put(TOPIC.getName(), g.getTopic());
tagsMap.put(PARTITION_ID.getName(), g.getPartitionId());
pointList.addAll(genSinkPoint("Group_Topic_Partition", g.getMetrics(), g.getTimestamp(), tagsMap));
}
}