Skip to content

Commit

Permalink
use the metric's ValueType (#162)
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Allan <[email protected]>

Co-authored-by: Kyle Allan <[email protected]>
  • Loading branch information
KAllan357 and Kyle Allan authored Jul 1, 2022
1 parent 0d37fab commit 83189c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions exporter/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)...,
)
Expand Down Expand Up @@ -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)...,
)
Expand Down

0 comments on commit 83189c5

Please sign in to comment.