mirror of
https://github.com/prometheus-community/json_exporter
synced 2024-12-22 06:30:11 +00:00
use the metric's ValueType (#162)
Signed-off-by: Kyle Allan <kallan357@gmail.com> Co-authored-by: Kyle Allan <kallan@singularity6.com>
This commit is contained in:
parent
0d37fabd21
commit
83189c5e54
@ -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)...,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user