fix: respect query matcher in ingester when getting label values (#10375)

There is a bug when passing a query parameter to the
`/label/:label/values`. Currently the ingester is not respecting this
query string, and so is always returning all label values. This PR fixes
that bug.
pull/10394/head
Trevor Whitney 2 years ago committed by GitHub
parent 145319e5f5
commit 85e2e52279
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      pkg/ingester/ingester.go

@ -1081,7 +1081,7 @@ func (i *Ingester) Label(ctx context.Context, req *logproto.LabelRequest) (*logp
from, through := model.TimeFromUnixNano(start.UnixNano()), model.TimeFromUnixNano(req.End.UnixNano())
var storeValues []string
if req.Values {
storeValues, err = cs.LabelValuesForMetricName(ctx, userID, from, through, "logs", req.Name)
storeValues, err = cs.LabelValuesForMetricName(ctx, userID, from, through, "logs", req.Name, matchers...)
if err != nil {
return nil, err
}

Loading…
Cancel
Save