指标设置默认值

This commit is contained in:
Liujian
2022-12-22 21:15:23 +08:00
parent 549f7ca13a
commit 4f8e88e88a
2 changed files with 10 additions and 2 deletions

View File

@@ -43,7 +43,11 @@ func ReadProxy(ctx http_context.IHttpContext) []IPoint {
"node": globalLabels["node_id"],
}
for key, label := range labels {
labelMetrics[key] = ctx.GetLabel(label)
value := ctx.GetLabel(label)
if value == "" {
value = "-"
}
labelMetrics[key] = value
}
for _, key := range proxyRequestMetrics {