normalizeFloatsInLabelValues ensures that values of the "le" labels of classic histograms and "quantile" labels of summaries follow OpenMetrics formatting rules.
(t model.MetricType, l, v string)
| 772 | // normalizeFloatsInLabelValues ensures that values of the "le" labels of classic histograms and "quantile" labels |
| 773 | // of summaries follow OpenMetrics formatting rules. |
| 774 | func normalizeFloatsInLabelValues(t model.MetricType, l, v string) string { |
| 775 | if (t == model.MetricTypeSummary && l == model.QuantileLabel) || (t == model.MetricTypeHistogram && l == model.BucketLabel) { |
| 776 | f, err := strconv.ParseFloat(v, 64) |
| 777 | if err == nil { |
| 778 | return labels.FormatOpenMetricsFloat(f) |
| 779 | } |
| 780 | } |
| 781 | return v |
| 782 | } |
no test coverage detected
searching dependent graphs…