LabelValues returns label values present in the head for the specific label name that are within the time range mint to maxt. If matchers are specified the returned result set is reduced to label values of metrics matching the matchers.
(ctx context.Context, name string, hints *storage.LabelHints, matchers ...*labels.Matcher)
| 85 | // If matchers are specified the returned result set is reduced |
| 86 | // to label values of metrics matching the matchers. |
| 87 | func (h *headIndexReader) LabelValues(ctx context.Context, name string, hints *storage.LabelHints, matchers ...*labels.Matcher) ([]string, error) { |
| 88 | if h.maxt < h.head.MinTime() || h.mint > h.head.MaxTime() { |
| 89 | return []string{}, nil |
| 90 | } |
| 91 | |
| 92 | if len(matchers) == 0 { |
| 93 | return h.head.postings.LabelValues(ctx, name, hints), nil |
| 94 | } |
| 95 | |
| 96 | return labelValuesWithMatchers(ctx, h, name, hints, matchers...) |
| 97 | } |
| 98 | |
| 99 | // LabelNames returns all the unique label names present in the head |
| 100 | // that are within the time range mint to maxt. |
no test coverage detected