From ee1459d760f84f9aa79cc0c1adc810ce1c1a5b22 Mon Sep 17 00:00:00 2001 From: mountain Date: Fri, 1 Dec 2023 02:34:24 +0900 Subject: [PATCH] =?UTF-8?q?metric=20=EB=93=B1=EB=A1=9D=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/operation.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/operation.go b/client/operation.go index c165cb8..8686c8a 100644 --- a/client/operation.go +++ b/client/operation.go @@ -297,12 +297,11 @@ func (hc *houstonClient) launch(meta *procmeta) error { logger.Println("unmarshal metric failed :", err, string(metricBuffer)) continue } - if index != 0 { - if desc.ConstLabels == nil { - desc.ConstLabels = make(map[string]string) - } - desc.ConstLabels["index"] = fmt.Sprintf("%d", index) + + if desc.ConstLabels == nil { + desc.ConstLabels = make(map[string]string) } + desc.ConstLabels["index"] = fmt.Sprintf("%d", index) metricExporter.RegisterMetric(&desc) } else {