Add query filtering to the tailer (#5969)

* Add some comments

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>

* Use deletes in tail

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>

* Change error message

Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
pull/5979/head
Michel Hollands 4 years ago committed by GitHub
parent 7299e3bdcd
commit ef56b73758
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      pkg/querier/querier.go
  2. 2
      pkg/storage/stores/shipper/compactor/deletion/request_handler.go

@ -369,6 +369,11 @@ func (q *SingleTenantQuerier) Tail(ctx context.Context, req *logproto.TailReques
return nil, err
}
deletes, err := q.deletesForUser(ctx, req.Start, time.Now())
if err != nil {
return nil, err
}
histReq := logql.SelectLogParams{
QueryRequest: &logproto.QueryRequest{
Selector: req.Query,
@ -376,6 +381,7 @@ func (q *SingleTenantQuerier) Tail(ctx context.Context, req *logproto.TailReques
End: time.Now(),
Limit: req.Limit,
Direction: logproto.BACKWARD,
Deletes: deletes,
},
}

@ -77,7 +77,7 @@ func (dm *DeleteRequestHandler) AddDeleteRequestHandler(w http.ResponseWriter, r
}
if endTime > int64(model.Now()) {
http.Error(w, "deletes in future not allowed", http.StatusBadRequest)
http.Error(w, "deletes in the future are not allowed", http.StatusBadRequest)
return
}
}

Loading…
Cancel
Save