Skip to content

Commit

Permalink
Remove unused grpc health check endpoints (#6113)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kavirajk authored May 6, 2022
1 parent 729bf3f commit 24f8b19
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
10 changes: 0 additions & 10 deletions pkg/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 {
Expand Down
9 changes: 0 additions & 9 deletions pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 24f8b19

Please sign in to comment.