Remove unused grpc health check endpoints (#6113)

We have generic `grpc_healthcheck` endpoint that get registered for all the components
during initialization stage.

Looks like these health checks that are part of actual component's struct itself came from legacy.

Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
pull/6119/head
Kaviraj Kanagaraj 3 years ago committed by GitHub
parent 729bf3fc91
commit 24f8b19e91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      pkg/distributor/distributor.go
  2. 9
      pkg/ingester/ingester.go

@ -19,7 +19,6 @@ import (
"github.com/weaveworks/common/httpgrpc"
"github.com/weaveworks/common/user"
"go.uber.org/atomic"
"google.golang.org/grpc/health/grpc_health_v1"
"github.com/grafana/dskit/tenant"
@ -428,15 +427,6 @@ func (d *Distributor) sendSamplesErr(ctx context.Context, ingester ring.Instance
return err
}
// Check implements the grpc healthcheck
func (d *Distributor) Check(_ context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) {
status := grpc_health_v1.HealthCheckResponse_SERVING
if (d.State() != services.Running) || (d.distributorsLifecycler.GetState() != ring.ACTIVE) {
status = grpc_health_v1.HealthCheckResponse_NOT_SERVING
}
return &grpc_health_v1.HealthCheckResponse{Status: status}, nil
}
func (d *Distributor) parseStreamLabels(vContext validationContext, key string, stream *logproto.Stream) (string, error) {
labelVal, ok := d.labelCache.Get(key)
if ok {

@ -778,15 +778,6 @@ func (i *Ingester) Series(ctx context.Context, req *logproto.SeriesRequest) (*lo
return instance.Series(ctx, req)
}
// Check implements grpc_health_v1.HealthCheck.
func (i *Ingester) Check(ctx context.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) {
status := grpc_health_v1.HealthCheckResponse_SERVING
if (i.State() != services.Running) || (i.lifecycler.GetState() != ring.ACTIVE) {
status = grpc_health_v1.HealthCheckResponse_NOT_SERVING
}
return &grpc_health_v1.HealthCheckResponse{Status: status}, nil
}
// Watch implements grpc_health_v1.HealthCheck.
func (*Ingester) Watch(*grpc_health_v1.HealthCheckRequest, grpc_health_v1.Health_WatchServer) error {
return nil

Loading…
Cancel
Save