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

Function createSeriesRequest

pkg/querier/blocks_store_queryable.go:1069–1110  ·  view source on GitHub ↗
(minT, maxT, limit int64, matchers []storepb.LabelMatcher, selectHints *storage.SelectHints, shardingInfo *storepb.ShardInfo, skipChunks bool, blockIDs []ulid.ULID, aggrs []storepb.Aggr, batchSize int64)

Source from the content-addressed store, hash-verified

1067}
1068
1069func createSeriesRequest(minT, maxT, limit int64, matchers []storepb.LabelMatcher, selectHints *storage.SelectHints, shardingInfo *storepb.ShardInfo, skipChunks bool, blockIDs []ulid.ULID, aggrs []storepb.Aggr, batchSize int64) (*storepb.SeriesRequest, error) {
1070 // Selectively query only specific blocks.
1071 hints := &hintspb.SeriesRequestHints{
1072 BlockMatchers: []storepb.LabelMatcher{
1073 {
1074 Type: storepb.LabelMatcher_RE,
1075 Name: block.BlockIDLabel,
1076 Value: strings.Join(convertULIDsToString(blockIDs), "|"),
1077 },
1078 },
1079 EnableQueryStats: true,
1080 }
1081
1082 anyHints, err := types.MarshalAny(hints)
1083 if err != nil {
1084 return nil, errors.Wrapf(err, "failed to marshal series request hints")
1085 }
1086
1087 req := &storepb.SeriesRequest{
1088 MinTime: minT,
1089 MaxTime: maxT,
1090 Limit: limit,
1091 Matchers: matchers,
1092 PartialResponseStrategy: storepb.PartialResponseStrategy_ABORT,
1093 Hints: anyHints,
1094 SkipChunks: skipChunks,
1095 ShardInfo: shardingInfo,
1096 // TODO: support more downsample levels when downsampling is supported.
1097 Aggregates: aggrs,
1098 MaxResolutionWindow: downsample.ResLevel0,
1099 ResponseBatchSize: batchSize,
1100 }
1101
1102 if selectHints != nil {
1103 req.QueryHints = &storepb.QueryHints{
1104 ProjectionLabels: selectHints.ProjectionLabels,
1105 ProjectionInclude: selectHints.ProjectionInclude,
1106 }
1107 }
1108
1109 return req, nil
1110}
1111
1112func createLabelNamesRequest(minT, maxT, limit int64, blockIDs []ulid.ULID, matchers []storepb.LabelMatcher) (*storepb.LabelNamesRequest, error) {
1113 req := &storepb.LabelNamesRequest{

Callers 1

fetchSeriesFromStoresMethod · 0.85

Calls 2

convertULIDsToStringFunction · 0.85
JoinMethod · 0.80

Tested by

no test coverage detected