LabelValuesForLabelName returns all the label values that are associated with a given label name.
(ctx context.Context, from, to model.Time, labelName model.LabelName, hint *storage.LabelHints, partialDataEnabled bool, matchers ...*labels.Matcher)
| 1377 | |
| 1378 | // LabelValuesForLabelName returns all the label values that are associated with a given label name. |
| 1379 | func (d *Distributor) LabelValuesForLabelName(ctx context.Context, from, to model.Time, labelName model.LabelName, hint *storage.LabelHints, partialDataEnabled bool, matchers ...*labels.Matcher) ([]string, error) { |
| 1380 | return d.LabelValuesForLabelNameCommon(ctx, from, to, labelName, hint, func(ctx context.Context, rs ring.ReplicationSet, req *ingester_client.LabelValuesRequest, queryLimiter *limiter.QueryLimiter) ([]any, error) { |
| 1381 | return d.ForReplicationSet(ctx, rs, d.cfg.ZoneResultsQuorumMetadata, partialDataEnabled, func(ctx context.Context, client ingester_client.IngesterClient) (any, error) { |
| 1382 | resp, err := client.LabelValues(ctx, req) |
| 1383 | if err != nil { |
| 1384 | return nil, err |
| 1385 | } |
| 1386 | if err := queryLimiter.AddDataBytes(resp.Size()); err != nil { |
| 1387 | return nil, validation.LimitError(err.Error()) |
| 1388 | } |
| 1389 | return resp.LabelValues, nil |
| 1390 | }) |
| 1391 | }, matchers...) |
| 1392 | } |
| 1393 | |
| 1394 | // LabelValuesForLabelNameStream returns all the label values that are associated with a given label name. |
| 1395 | func (d *Distributor) LabelValuesForLabelNameStream(ctx context.Context, from, to model.Time, labelName model.LabelName, hint *storage.LabelHints, partialDataEnabled bool, matchers ...*labels.Matcher) ([]string, error) { |
nothing calls this directly
no test coverage detected