@@ -1177,8 +1177,8 @@ func getErrorStatus(err error) string {
11771177}
11781178
11791179// ForReplicationSet runs f, in parallel, for all ingesters in the input replication set.
1180- func (d * Distributor ) ForReplicationSet (ctx context.Context , replicationSet ring.ReplicationSet , zoneResultsQuorum bool , f func (context.Context , ingester_client.IngesterClient ) (interface {}, error )) ([]interface {}, error ) {
1181- return replicationSet .Do (ctx , d .cfg .ExtraQueryDelay , zoneResultsQuorum , func (ctx context.Context , ing * ring.InstanceDesc ) (interface {}, error ) {
1180+ func (d * Distributor ) ForReplicationSet (ctx context.Context , replicationSet ring.ReplicationSet , zoneResultsQuorum bool , partialDataEnabled bool , f func (context.Context , ingester_client.IngesterClient ) (interface {}, error )) ([]interface {}, error ) {
1181+ return replicationSet .Do (ctx , d .cfg .ExtraQueryDelay , zoneResultsQuorum , partialDataEnabled , func (ctx context.Context , ing * ring.InstanceDesc ) (interface {}, error ) {
11821182 client , err := d .ingesterPool .GetClientFor (ing .Addr )
11831183 if err != nil {
11841184 return nil , err
@@ -1228,9 +1228,9 @@ func (d *Distributor) LabelValuesForLabelNameCommon(ctx context.Context, from, t
12281228}
12291229
12301230// LabelValuesForLabelName returns all the label values that are associated with a given label name.
1231- func (d * Distributor ) LabelValuesForLabelName (ctx context.Context , from , to model.Time , labelName model.LabelName , hint * storage.LabelHints , matchers ... * labels.Matcher ) ([]string , error ) {
1231+ func (d * Distributor ) LabelValuesForLabelName (ctx context.Context , from , to model.Time , labelName model.LabelName , hint * storage.LabelHints , partialDataEnabled bool , matchers ... * labels.Matcher ) ([]string , error ) {
12321232 return d .LabelValuesForLabelNameCommon (ctx , from , to , labelName , hint , func (ctx context.Context , rs ring.ReplicationSet , req * ingester_client.LabelValuesRequest ) ([]interface {}, error ) {
1233- return d .ForReplicationSet (ctx , rs , d .cfg .ZoneResultsQuorumMetadata , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
1233+ return d .ForReplicationSet (ctx , rs , d .cfg .ZoneResultsQuorumMetadata , partialDataEnabled , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
12341234 resp , err := client .LabelValues (ctx , req )
12351235 if err != nil {
12361236 return nil , err
@@ -1241,9 +1241,9 @@ func (d *Distributor) LabelValuesForLabelName(ctx context.Context, from, to mode
12411241}
12421242
12431243// LabelValuesForLabelNameStream returns all the label values that are associated with a given label name.
1244- func (d * Distributor ) LabelValuesForLabelNameStream (ctx context.Context , from , to model.Time , labelName model.LabelName , hint * storage.LabelHints , matchers ... * labels.Matcher ) ([]string , error ) {
1244+ func (d * Distributor ) LabelValuesForLabelNameStream (ctx context.Context , from , to model.Time , labelName model.LabelName , hint * storage.LabelHints , partialDataEnabled bool , matchers ... * labels.Matcher ) ([]string , error ) {
12451245 return d .LabelValuesForLabelNameCommon (ctx , from , to , labelName , hint , func (ctx context.Context , rs ring.ReplicationSet , req * ingester_client.LabelValuesRequest ) ([]interface {}, error ) {
1246- return d .ForReplicationSet (ctx , rs , d .cfg .ZoneResultsQuorumMetadata , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
1246+ return d .ForReplicationSet (ctx , rs , d .cfg .ZoneResultsQuorumMetadata , partialDataEnabled , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
12471247 stream , err := client .LabelValuesStream (ctx , req )
12481248 if err != nil {
12491249 return nil , err
@@ -1307,9 +1307,9 @@ func (d *Distributor) LabelNamesCommon(ctx context.Context, from, to model.Time,
13071307 return r , nil
13081308}
13091309
1310- func (d * Distributor ) LabelNamesStream (ctx context.Context , from , to model.Time , hints * storage.LabelHints , matchers ... * labels.Matcher ) ([]string , error ) {
1310+ func (d * Distributor ) LabelNamesStream (ctx context.Context , from , to model.Time , hints * storage.LabelHints , partialDataEnabled bool , matchers ... * labels.Matcher ) ([]string , error ) {
13111311 return d .LabelNamesCommon (ctx , from , to , hints , func (ctx context.Context , rs ring.ReplicationSet , req * ingester_client.LabelNamesRequest ) ([]interface {}, error ) {
1312- return d .ForReplicationSet (ctx , rs , d .cfg .ZoneResultsQuorumMetadata , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
1312+ return d .ForReplicationSet (ctx , rs , d .cfg .ZoneResultsQuorumMetadata , partialDataEnabled , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
13131313 stream , err := client .LabelNamesStream (ctx , req )
13141314 if err != nil {
13151315 return nil , err
@@ -1333,9 +1333,9 @@ func (d *Distributor) LabelNamesStream(ctx context.Context, from, to model.Time,
13331333}
13341334
13351335// LabelNames returns all the label names.
1336- func (d * Distributor ) LabelNames (ctx context.Context , from , to model.Time , hint * storage.LabelHints , matchers ... * labels.Matcher ) ([]string , error ) {
1336+ func (d * Distributor ) LabelNames (ctx context.Context , from , to model.Time , hint * storage.LabelHints , partialDataEnabled bool , matchers ... * labels.Matcher ) ([]string , error ) {
13371337 return d .LabelNamesCommon (ctx , from , to , hint , func (ctx context.Context , rs ring.ReplicationSet , req * ingester_client.LabelNamesRequest ) ([]interface {}, error ) {
1338- return d .ForReplicationSet (ctx , rs , d .cfg .ZoneResultsQuorumMetadata , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
1338+ return d .ForReplicationSet (ctx , rs , d .cfg .ZoneResultsQuorumMetadata , partialDataEnabled , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
13391339 resp , err := client .LabelNames (ctx , req )
13401340 if err != nil {
13411341 return nil , err
@@ -1346,9 +1346,9 @@ func (d *Distributor) LabelNames(ctx context.Context, from, to model.Time, hint
13461346}
13471347
13481348// MetricsForLabelMatchers gets the metrics that match said matchers
1349- func (d * Distributor ) MetricsForLabelMatchers (ctx context.Context , from , through model.Time , hint * storage.SelectHints , matchers ... * labels.Matcher ) ([]model.Metric , error ) {
1349+ func (d * Distributor ) MetricsForLabelMatchers (ctx context.Context , from , through model.Time , hint * storage.SelectHints , partialDataEnabled bool , matchers ... * labels.Matcher ) ([]model.Metric , error ) {
13501350 return d .metricsForLabelMatchersCommon (ctx , from , through , hint , func (ctx context.Context , rs ring.ReplicationSet , req * ingester_client.MetricsForLabelMatchersRequest , metrics * map [model.Fingerprint ]model.Metric , mutex * sync.Mutex , queryLimiter * limiter.QueryLimiter ) error {
1351- _ , err := d .ForReplicationSet (ctx , rs , false , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
1351+ _ , err := d .ForReplicationSet (ctx , rs , false , partialDataEnabled , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
13521352 resp , err := client .MetricsForLabelMatchers (ctx , req )
13531353 if err != nil {
13541354 return nil , err
@@ -1375,9 +1375,9 @@ func (d *Distributor) MetricsForLabelMatchers(ctx context.Context, from, through
13751375 }, matchers ... )
13761376}
13771377
1378- func (d * Distributor ) MetricsForLabelMatchersStream (ctx context.Context , from , through model.Time , hint * storage.SelectHints , matchers ... * labels.Matcher ) ([]model.Metric , error ) {
1378+ func (d * Distributor ) MetricsForLabelMatchersStream (ctx context.Context , from , through model.Time , hint * storage.SelectHints , partialDataEnabled bool , matchers ... * labels.Matcher ) ([]model.Metric , error ) {
13791379 return d .metricsForLabelMatchersCommon (ctx , from , through , hint , func (ctx context.Context , rs ring.ReplicationSet , req * ingester_client.MetricsForLabelMatchersRequest , metrics * map [model.Fingerprint ]model.Metric , mutex * sync.Mutex , queryLimiter * limiter.QueryLimiter ) error {
1380- _ , err := d .ForReplicationSet (ctx , rs , false , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
1380+ _ , err := d .ForReplicationSet (ctx , rs , false , partialDataEnabled , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
13811381 stream , err := client .MetricsForLabelMatchersStream (ctx , req )
13821382 if err != nil {
13831383 return nil , err
@@ -1453,7 +1453,7 @@ func (d *Distributor) MetricsMetadata(ctx context.Context) ([]scrape.MetricMetad
14531453
14541454 req := & ingester_client.MetricsMetadataRequest {}
14551455 // TODO(gotjosh): We only need to look in all the ingesters if shardByAllLabels is enabled.
1456- resps , err := d .ForReplicationSet (ctx , replicationSet , d .cfg .ZoneResultsQuorumMetadata , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
1456+ resps , err := d .ForReplicationSet (ctx , replicationSet , d .cfg .ZoneResultsQuorumMetadata , false , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
14571457 return client .MetricsMetadata (ctx , req )
14581458 })
14591459 if err != nil {
@@ -1495,7 +1495,7 @@ func (d *Distributor) UserStats(ctx context.Context) (*ingester.UserStats, error
14951495 replicationSet .MaxErrors = 0
14961496
14971497 req := & ingester_client.UserStatsRequest {}
1498- resps , err := d .ForReplicationSet (ctx , replicationSet , false , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
1498+ resps , err := d .ForReplicationSet (ctx , replicationSet , false , false , func (ctx context.Context , client ingester_client.IngesterClient ) (interface {}, error ) {
14991499 return client .UserStats (ctx , req )
15001500 })
15011501 if err != nil {
0 commit comments