perf: 合并targets_up指标为一个ident,减少资源利用。 (#915)

This commit is contained in:
qzh 2022-04-15 21:17:16 +08:00 committed by GitHub
parent 6033a0a743
commit 5732c4403b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ func pushMetrics() {
common.AppendLabels(pt, target) common.AppendLabels(pt, target)
} }
writer.Writers.PushSample(active, pt) writer.Writers.PushSample("default_ident_target_up", pt)
} }
// 把actives传给TargetCache看看除了active的部分还有别的target么有的话返回设置target_up = 0 // 把actives传给TargetCache看看除了active的部分还有别的target么有的话返回设置target_up = 0
@ -193,6 +193,6 @@ func pushMetrics() {
}) })
common.AppendLabels(pt, dead) common.AppendLabels(pt, dead)
writer.Writers.PushSample(ident, pt) writer.Writers.PushSample("default_ident_target_up", pt)
} }
} }