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

Function FromLabelValuesRequest

pkg/ingester/client/compat.go:191–203  ·  view source on GitHub ↗

FromLabelValuesRequest unpacks a LabelValuesRequest proto

(cache storecache.MatchersCache, req *LabelValuesRequest)

Source from the content-addressed store, hash-verified

189
190// FromLabelValuesRequest unpacks a LabelValuesRequest proto
191func FromLabelValuesRequest(cache storecache.MatchersCache, req *LabelValuesRequest) (string, int64, int64, int, []*labels.Matcher, error) {
192 var err error
193 var matchers []*labels.Matcher
194
195 if req.Matchers != nil {
196 matchers, err = FromLabelMatchers(cache, req.Matchers.Matchers)
197 if err != nil {
198 return "", 0, 0, 0, nil, err
199 }
200 }
201
202 return req.LabelName, req.StartTimestampMs, req.EndTimestampMs, int(req.Limit), matchers, nil
203}
204
205// ToLabelNamesRequest builds a LabelNamesRequest proto
206func ToLabelNamesRequest(from, to model.Time, limit int, matchers []*labels.Matcher) (*LabelNamesRequest, error) {

Callers 1

labelsValuesCommonMethod · 0.92

Calls 1

FromLabelMatchersFunction · 0.85

Tested by

no test coverage detected