From b7b33182b76ebe9385e3529547f131ea43949218 Mon Sep 17 00:00:00 2001 From: aexel90 Date: Mon, 28 Dec 2020 12:16:51 +0100 Subject: [PATCH] numeric boolean label values --- collector/collector.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/collector/collector.go b/collector/collector.go index ed88e4b..3fa3869 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -182,6 +182,11 @@ func getLabelValues(labelNames []string, result map[string]interface{}) ([]strin labelValues := []string{} for _, labelname := range labelNames { labelValue := fmt.Sprintf("%v", result[labelname]) + if labelValue == "true" { + labelValue = "1" + } else if labelValue == "false" { + labelValue = "0" + } if labelname != "Name" { labelValue = strings.ToLower(labelValue) }