@@ -234,13 +234,15 @@ func (q *distributorQuerier) LabelValues(ctx context.Context, name string, hints
234
234
partialDataEnabled := q .partialDataEnabled (ctx )
235
235
236
236
if q .streamingMetadata {
237
- lvs , err = q .labelsWithRetry (func () ([]string , error ) {
238
- return q .distributor .LabelValuesForLabelNameStream (ctx , model .Time (q .mint ), model .Time (q .maxt ), model .LabelName (name ), hints , partialDataEnabled , matchers ... )
239
- }, q .ingesterQueryMaxAttempts )
237
+ lvs , err = q .distributor .LabelValuesForLabelNameStream (ctx , model .Time (q .mint ), model .Time (q .maxt ), model .LabelName (name ), hints , partialDataEnabled , matchers ... )
238
+ //lvs, err = q.labelsWithRetry(func() ([]string, error) {
239
+ // return q.distributor.LabelValuesForLabelNameStream(ctx, model.Time(q.mint), model.Time(q.maxt), model.LabelName(name), hints, partialDataEnabled, matchers...)
240
+ //}, q.ingesterQueryMaxAttempts)
240
241
} else {
241
- lvs , err = q .labelsWithRetry (func () ([]string , error ) {
242
- return q .distributor .LabelValuesForLabelName (ctx , model .Time (q .mint ), model .Time (q .maxt ), model .LabelName (name ), hints , partialDataEnabled , matchers ... )
243
- }, q .ingesterQueryMaxAttempts )
242
+ lvs , err = q .distributor .LabelValuesForLabelName (ctx , model .Time (q .mint ), model .Time (q .maxt ), model .LabelName (name ), hints , partialDataEnabled , matchers ... )
243
+ //lvs, err = q.labelsWithRetry(func() ([]string, error) {
244
+ // return q.distributor.LabelValuesForLabelName(ctx, model.Time(q.mint), model.Time(q.maxt), model.LabelName(name), hints, partialDataEnabled, matchers...)
245
+ //}, q.ingesterQueryMaxAttempts)
244
246
}
245
247
246
248
if partialdata .IsPartialDataError (err ) {
@@ -267,13 +269,15 @@ func (q *distributorQuerier) LabelNames(ctx context.Context, hints *storage.Labe
267
269
)
268
270
269
271
if q .streamingMetadata {
270
- ln , err = q .labelsWithRetry (func () ([]string , error ) {
271
- return q .distributor .LabelNamesStream (ctx , model .Time (q .mint ), model .Time (q .maxt ), hints , partialDataEnabled , matchers ... )
272
- }, q .ingesterQueryMaxAttempts )
272
+ ln , err = q .distributor .LabelNamesStream (ctx , model .Time (q .mint ), model .Time (q .maxt ), hints , partialDataEnabled , matchers ... )
273
+ //ln, err = q.labelsWithRetry(func() ([]string, error) {
274
+ // return q.distributor.LabelNamesStream(ctx, model.Time(q.mint), model.Time(q.maxt), hints, partialDataEnabled, matchers...)
275
+ //}, q.ingesterQueryMaxAttempts)
273
276
} else {
274
- ln , err = q .labelsWithRetry (func () ([]string , error ) {
275
- return q .distributor .LabelNames (ctx , model .Time (q .mint ), model .Time (q .maxt ), hints , partialDataEnabled , matchers ... )
276
- }, q .ingesterQueryMaxAttempts )
277
+ ln , err = q .distributor .LabelNames (ctx , model .Time (q .mint ), model .Time (q .maxt ), hints , partialDataEnabled , matchers ... )
278
+ //ln, err = q.labelsWithRetry(func() ([]string, error) {
279
+ // return q.distributor.LabelNames(ctx, model.Time(q.mint), model.Time(q.maxt), hints, partialDataEnabled, matchers...)
280
+ //}, q.ingesterQueryMaxAttempts)
277
281
}
278
282
279
283
if partialdata .IsPartialDataError (err ) {
@@ -284,20 +288,20 @@ func (q *distributorQuerier) LabelNames(ctx context.Context, hints *storage.Labe
284
288
return ln , nil , err
285
289
}
286
290
287
- func (q * distributorQuerier ) labelsWithRetry (labelsFunc func () ([]string , error ), retryAttempt int ) ([]string , error ) {
288
- var result []string
289
- var err error
290
-
291
- for i := 0 ; i < retryAttempt ; i ++ {
292
- result , err = labelsFunc ()
293
-
294
- if err == nil || ! q .isRetryableError (err ) {
295
- return result , err
296
- }
297
- }
298
-
299
- return result , err
300
- }
291
+ // func (q *distributorQuerier) labelsWithRetry(labelsFunc func() ([]string, error), retryAttempt int) ([]string, error) {
292
+ // var result []string
293
+ // var err error
294
+ //
295
+ // for i := 0; i < retryAttempt; i++ {
296
+ // result, err = labelsFunc()
297
+ //
298
+ // if err == nil || !q.isRetryableError(err) {
299
+ // return result, err
300
+ // }
301
+ // }
302
+ //
303
+ // return result, err
304
+ // }
301
305
302
306
// labelNamesWithMatchers performs the LabelNames call by calling ingester's MetricsForLabelMatchers method
303
307
func (q * distributorQuerier ) labelNamesWithMatchers (ctx context.Context , hints * storage.LabelHints , partialDataEnabled bool , matchers ... * labels.Matcher ) ([]string , annotations.Annotations , error ) {
0 commit comments