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

Function createLabelNamesRequest

pkg/querier/blocks_store_queryable.go:1112–1139  ·  view source on GitHub ↗
(minT, maxT, limit int64, blockIDs []ulid.ULID, matchers []storepb.LabelMatcher)

Source from the content-addressed store, hash-verified

1110}
1111
1112func createLabelNamesRequest(minT, maxT, limit int64, blockIDs []ulid.ULID, matchers []storepb.LabelMatcher) (*storepb.LabelNamesRequest, error) {
1113 req := &storepb.LabelNamesRequest{
1114 Start: minT,
1115 End: maxT,
1116 Limit: limit,
1117 Matchers: matchers,
1118 }
1119
1120 // Selectively query only specific blocks.
1121 hints := &hintspb.LabelNamesRequestHints{
1122 BlockMatchers: []storepb.LabelMatcher{
1123 {
1124 Type: storepb.LabelMatcher_RE,
1125 Name: block.BlockIDLabel,
1126 Value: strings.Join(convertULIDsToString(blockIDs), "|"),
1127 },
1128 },
1129 }
1130
1131 anyHints, err := types.MarshalAny(hints)
1132 if err != nil {
1133 return nil, errors.Wrapf(err, "failed to marshal label names request hints")
1134 }
1135
1136 req.Hints = anyHints
1137
1138 return req, nil
1139}
1140
1141func createLabelValuesRequest(minT, maxT, limit int64, label string, blockIDs []ulid.ULID, matchers ...*labels.Matcher) (*storepb.LabelValuesRequest, error) {
1142 req := &storepb.LabelValuesRequest{

Callers 1

Calls 2

convertULIDsToStringFunction · 0.85
JoinMethod · 0.80

Tested by

no test coverage detected