CheckReady determines if the query frontend is ready. Function parameters/return chosen to match the same method in the ingester
(_ context.Context)
| 379 | // CheckReady determines if the query frontend is ready. Function parameters/return |
| 380 | // chosen to match the same method in the ingester |
| 381 | func (f *Frontend) CheckReady(_ context.Context) error { |
| 382 | // if we have more than one querier connected we will consider ourselves ready |
| 383 | connectedClients := f.requestQueue.GetConnectedQuerierWorkersMetric() |
| 384 | if connectedClients > 0 { |
| 385 | return nil |
| 386 | } |
| 387 | |
| 388 | msg := fmt.Sprintf("not ready: number of queriers connected to query-frontend is %d", int64(connectedClients)) |
| 389 | level.Info(f.log).Log("msg", msg) |
| 390 | return errors.New(msg) |
| 391 | } |