MCPcopy Create free account
hub / github.com/cortexproject/cortex / MetricNameFromLabels

Function MetricNameFromLabels

pkg/util/extract/extract.go:72–78  ·  view source on GitHub ↗

MetricNameFromLabels extracts the metric name from a list of Prometheus Labels.

(lbls labels.Labels)

Source from the content-addressed store, hash-verified

70
71// MetricNameFromLabels extracts the metric name from a list of Prometheus Labels.
72func MetricNameFromLabels(lbls labels.Labels) (metricName string, err error) {
73 metricName = lbls.Get(model.MetricNameLabel)
74 if metricName == "" {
75 err = errNoMetricNameLabel
76 }
77 return
78}

Callers 5

ExpireSeriesMethod · 0.92
PreCreationMethod · 0.92
PostCreationMethod · 0.92
PostDeletionMethod · 0.92
convertV2RequestToV1Function · 0.92

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected