From 83189c5e546229bebedbedcb6b168fde200d80c5 Mon Sep 17 00:00:00 2001 From: Kyle Allan Date: Fri, 1 Jul 2022 03:20:07 -0400 Subject: [PATCH] use the metric's ValueType (#162) Signed-off-by: Kyle Allan Co-authored-by: Kyle Allan --- exporter/collector.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exporter/collector.go b/exporter/collector.go index 0e588f5e..d7ba92a2 100644 --- a/exporter/collector.go +++ b/exporter/collector.go @@ -59,7 +59,7 @@ func (mc JSONMetricCollector) Collect(ch chan<- prometheus.Metric) { ch <- prometheus.MustNewConstMetric( m.Desc, - prometheus.UntypedValue, + m.ValueType, floatValue, extractLabels(mc.Logger, mc.Data, m.LabelsJSONPaths)..., ) @@ -92,7 +92,7 @@ func (mc JSONMetricCollector) Collect(ch chan<- prometheus.Metric) { if floatValue, err := SanitizeValue(value); err == nil { ch <- prometheus.MustNewConstMetric( m.Desc, - prometheus.UntypedValue, + m.ValueType, floatValue, extractLabels(mc.Logger, jdata, m.LabelsJSONPaths)..., )