(ctx context.Context, from, to model.Time, hints *storage.LabelHints, partialDataEnabled bool, matchers ...*labels.Matcher)
| 1463 | } |
| 1464 | |
| 1465 | func (d *Distributor) LabelNamesStream(ctx context.Context, from, to model.Time, hints *storage.LabelHints, partialDataEnabled bool, matchers ...*labels.Matcher) ([]string, error) { |
| 1466 | return d.LabelNamesCommon(ctx, from, to, hints, func(ctx context.Context, rs ring.ReplicationSet, req *ingester_client.LabelNamesRequest, queryLimiter *limiter.QueryLimiter) ([]any, error) { |
| 1467 | return d.ForReplicationSet(ctx, rs, d.cfg.ZoneResultsQuorumMetadata, partialDataEnabled, func(ctx context.Context, client ingester_client.IngesterClient) (any, error) { |
| 1468 | stream, err := client.LabelNamesStream(ctx, req) |
| 1469 | if err != nil { |
| 1470 | return nil, err |
| 1471 | } |
| 1472 | defer stream.CloseSend() //nolint:errcheck |
| 1473 | allLabelNames := []string{} |
| 1474 | for { |
| 1475 | resp, err := stream.Recv() |
| 1476 | if err == io.EOF { |
| 1477 | break |
| 1478 | } else if err != nil { |
| 1479 | return nil, err |
| 1480 | } |
| 1481 | if err := queryLimiter.AddDataBytes(resp.Size()); err != nil { |
| 1482 | return nil, validation.LimitError(err.Error()) |
| 1483 | } |
| 1484 | |
| 1485 | allLabelNames = append(allLabelNames, resp.LabelNames...) |
| 1486 | } |
| 1487 | |
| 1488 | return allLabelNames, nil |
| 1489 | }) |
| 1490 | }, matchers...) |
| 1491 | } |
| 1492 | |
| 1493 | // LabelNames returns all the label names. |
| 1494 | func (d *Distributor) LabelNames(ctx context.Context, from, to model.Time, hint *storage.LabelHints, partialDataEnabled bool, matchers ...*labels.Matcher) ([]string, error) { |
nothing calls this directly
no test coverage detected