We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 658fa03 + 5dfcaaa commit ed37310Copy full SHA for ed37310
pkg/util/extract/extract.go
@@ -22,10 +22,8 @@ func MetricNameFromLabelPairs(labels []client.LabelPair) ([]byte, error) {
22
23
// MetricNameFromMetric extract the metric name from a model.Metric
24
func MetricNameFromMetric(m model.Metric) (model.LabelValue, error) {
25
- for name, value := range m {
26
- if name == model.MetricNameLabel {
27
- return value, nil
28
- }
+ if value, found := m[model.MetricNameLabel]; found {
+ return value, nil
29
}
30
return "", fmt.Errorf("no MetricNameLabel for chunk")
31
0 commit comments