From 24f8b19e9106dfa02d224570b2b744dc51bb54b8 Mon Sep 17 00:00:00 2001 From: Kaviraj Kanagaraj Date: Fri, 6 May 2022 20:14:00 +0200 Subject: [PATCH] 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 --- pkg/distributor/distributor.go | 10 ---------- pkg/ingester/ingester.go | 9 --------- 2 files changed, 19 deletions(-) diff --git a/pkg/distributor/distributor.go b/pkg/distributor/distributor.go index 369fe7a6b6334..577101438b9fd 100644 --- a/pkg/distributor/distributor.go +++ b/pkg/distributor/distributor.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 { diff --git a/pkg/ingester/ingester.go b/pkg/ingester/ingester.go index c6444d0c13c79..cb7cb70cca512 100644 --- a/pkg/ingester/ingester.go +++ b/pkg/ingester/ingester.go @@ -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