@@ -1177,8 +1177,8 @@ func getErrorStatus(err error) string {
1177
1177
}
1178
1178
1179
1179
// 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 ) {
1182
1182
client , err := d .ingesterPool .GetClientFor (ing .Addr )
1183
1183
if err != nil {
1184
1184
return nil , err
@@ -1228,9 +1228,9 @@ func (d *Distributor) LabelValuesForLabelNameCommon(ctx context.Context, from, t
1228
1228
}
1229
1229
1230
1230
// 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 ) {
1232
1232
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 ) {
1234
1234
resp , err := client .LabelValues (ctx , req )
1235
1235
if err != nil {
1236
1236
return nil , err
@@ -1241,9 +1241,9 @@ func (d *Distributor) LabelValuesForLabelName(ctx context.Context, from, to mode
1241
1241
}
1242
1242
1243
1243
// 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 ) {
1245
1245
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 ) {
1247
1247
stream , err := client .LabelValuesStream (ctx , req )
1248
1248
if err != nil {
1249
1249
return nil , err
@@ -1307,9 +1307,9 @@ func (d *Distributor) LabelNamesCommon(ctx context.Context, from, to model.Time,
1307
1307
return r , nil
1308
1308
}
1309
1309
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 ) {
1311
1311
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 ) {
1313
1313
stream , err := client .LabelNamesStream (ctx , req )
1314
1314
if err != nil {
1315
1315
return nil , err
@@ -1333,9 +1333,9 @@ func (d *Distributor) LabelNamesStream(ctx context.Context, from, to model.Time,
1333
1333
}
1334
1334
1335
1335
// 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 ) {
1337
1337
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 ) {
1339
1339
resp , err := client .LabelNames (ctx , req )
1340
1340
if err != nil {
1341
1341
return nil , err
@@ -1346,9 +1346,9 @@ func (d *Distributor) LabelNames(ctx context.Context, from, to model.Time, hint
1346
1346
}
1347
1347
1348
1348
// 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 ) {
1350
1350
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 ) {
1352
1352
resp , err := client .MetricsForLabelMatchers (ctx , req )
1353
1353
if err != nil {
1354
1354
return nil , err
@@ -1375,9 +1375,9 @@ func (d *Distributor) MetricsForLabelMatchers(ctx context.Context, from, through
1375
1375
}, matchers ... )
1376
1376
}
1377
1377
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 ) {
1379
1379
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 ) {
1381
1381
stream , err := client .MetricsForLabelMatchersStream (ctx , req )
1382
1382
if err != nil {
1383
1383
return nil , err
@@ -1453,7 +1453,7 @@ func (d *Distributor) MetricsMetadata(ctx context.Context) ([]scrape.MetricMetad
1453
1453
1454
1454
req := & ingester_client.MetricsMetadataRequest {}
1455
1455
// 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 ) {
1457
1457
return client .MetricsMetadata (ctx , req )
1458
1458
})
1459
1459
if err != nil {
@@ -1495,7 +1495,7 @@ func (d *Distributor) UserStats(ctx context.Context) (*ingester.UserStats, error
1495
1495
replicationSet .MaxErrors = 0
1496
1496
1497
1497
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 ) {
1499
1499
return client .UserStats (ctx , req )
1500
1500
})
1501
1501
if err != nil {
0 commit comments