LabelNames returns all the label names.
(ctx context.Context, from, to model.Time, hint *storage.LabelHints, partialDataEnabled bool, matchers ...*labels.Matcher)
| 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) { |
| 1495 | return d.LabelNamesCommon(ctx, from, to, hint, func(ctx context.Context, rs ring.ReplicationSet, req *ingester_client.LabelNamesRequest, queryLimiter *limiter.QueryLimiter) ([]any, error) { |
| 1496 | return d.ForReplicationSet(ctx, rs, d.cfg.ZoneResultsQuorumMetadata, partialDataEnabled, func(ctx context.Context, client ingester_client.IngesterClient) (any, error) { |
| 1497 | resp, err := client.LabelNames(ctx, req) |
| 1498 | if err != nil { |
| 1499 | return nil, err |
| 1500 | } |
| 1501 | if err := queryLimiter.AddDataBytes(resp.Size()); err != nil { |
| 1502 | return nil, validation.LimitError(err.Error()) |
| 1503 | } |
| 1504 | |
| 1505 | return resp.LabelNames, nil |
| 1506 | }) |
| 1507 | }, matchers...) |
| 1508 | } |
| 1509 | |
| 1510 | // MetricsForLabelMatchers gets the metrics that match said matchers |
| 1511 | func (d *Distributor) MetricsForLabelMatchers(ctx context.Context, from, through model.Time, hint *storage.SelectHints, partialDataEnabled bool, matchers ...*labels.Matcher) ([]labels.Labels, error) { |
nothing calls this directly
no test coverage detected