From 4f8e88e88ab036da8b6201ccffb8da034e1c3348 Mon Sep 17 00:00:00 2001 From: Liujian <824010343@qq.com> Date: Thu, 22 Dec 2022 21:15:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=BE=E7=BD=AE=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- monitor-entry/proxy-reader.go | 6 +++++- monitor-entry/request-reader.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/monitor-entry/proxy-reader.go b/monitor-entry/proxy-reader.go index 5a711d69..e0a204ce 100644 --- a/monitor-entry/proxy-reader.go +++ b/monitor-entry/proxy-reader.go @@ -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 { diff --git a/monitor-entry/request-reader.go b/monitor-entry/request-reader.go index 53668ae2..24a563d9 100644 --- a/monitor-entry/request-reader.go +++ b/monitor-entry/request-reader.go @@ -38,7 +38,11 @@ func ReadRequest(ctx http_context.IHttpContext) []IPoint { } for key, label := range labels { - tags[key] = ctx.GetLabel(label) + value := ctx.GetLabel(label) + if value == "" { + value = "-" + } + tags[key] = value } for _, metrics := range requestMetrics { f, has := request[metrics]