MCPcopy
hub / github.com/prometheus/prometheus / LabelNames

Method LabelNames

tsdb/querier.go:86–97  ·  view source on GitHub ↗
(ctx context.Context, hints *storage.LabelHints, matchers ...*labels.Matcher)

Source from the content-addressed store, hash-verified

84}
85
86func (q *blockBaseQuerier) LabelNames(ctx context.Context, hints *storage.LabelHints, matchers ...*labels.Matcher) ([]string, annotations.Annotations, error) {
87 res, err := q.index.LabelNames(ctx, matchers...)
88 if err != nil {
89 return nil, nil, err
90 }
91
92 if hints != nil && hints.Limit > 0 && len(res) > hints.Limit {
93 res = res[:hints.Limit]
94 }
95
96 return res, nil, nil
97}
98
99// SearchLabelNames implements storage.Searcher.
100func (q *blockBaseQuerier) SearchLabelNames(ctx context.Context, hints *storage.SearchHints, matchers ...*labels.Matcher) storage.SearchResultSet {

Callers 1

Calls 1

LabelNamesMethod · 0.65

Tested by 1