MCPcopy
hub / github.com/prometheus/prometheus / SortedLabelValues

Method SortedLabelValues

tsdb/block.go:490–506  ·  view source on GitHub ↗
(ctx context.Context, name string, hints *storage.LabelHints, matchers ...*labels.Matcher)

Source from the content-addressed store, hash-verified

488}
489
490func (r blockIndexReader) SortedLabelValues(ctx context.Context, name string, hints *storage.LabelHints, matchers ...*labels.Matcher) ([]string, error) {
491 var st []string
492 var err error
493
494 if len(matchers) == 0 {
495 st, err = r.ir.SortedLabelValues(ctx, name, hints)
496 } else {
497 st, err = r.LabelValues(ctx, name, hints, matchers...)
498 if err == nil {
499 slices.Sort(st)
500 }
501 }
502 if err != nil {
503 return st, fmt.Errorf("block: %s: %w", r.b.Meta().ULID, err)
504 }
505 return st, nil
506}
507
508func (r blockIndexReader) LabelValues(ctx context.Context, name string, hints *storage.LabelHints, matchers ...*labels.Matcher) ([]string, error) {
509 if len(matchers) == 0 {

Callers

nothing calls this directly

Calls 4

LabelValuesMethod · 0.95
SortedLabelValuesMethod · 0.65
MetaMethod · 0.65
SortMethod · 0.45

Tested by

no test coverage detected