Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused grpc health check methods #6113

Merged
merged 1 commit into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit worried that we don't seem to be checking the lifecycler state in our blanket version, but it doesn't look like these are used either.

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