Skip to content

Commit db98e77

Browse files
committed
Vendor in health protobuf stuff
1 parent 003d6b9 commit db98e77

File tree

6 files changed

+234
-19
lines changed

6 files changed

+234
-19
lines changed

Gopkg.lock

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/distributor/distributor.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
ingester_client "github.com/weaveworks/cortex/pkg/ingester/client"
2929
"github.com/weaveworks/cortex/pkg/ring"
3030
"github.com/weaveworks/cortex/pkg/util"
31+
"google.golang.org/grpc/health/grpc_health_v1"
3132
)
3233

3334
var errIngestionRateLimitExceeded = errors.New("ingestion rate limit exceeded")
@@ -222,8 +223,8 @@ func (d *Distributor) healthCheckAndRemoveIngester(addr string, client client.In
222223
ctx, cancel := context.WithTimeout(context.Background(), d.cfg.RemoteTimeout)
223224
defer cancel()
224225
ctx = user.InjectOrgID(ctx, "0")
225-
resp, err := client.Check(ctx, &ingester_client.HealthCheckRequest{})
226-
if err != nil || resp.Status != ingester_client.SERVING {
226+
resp, err := client.Check(ctx, &grpc_health_v1.HealthCheckRequest{})
227+
if err != nil || resp.Status != grpc_health_v1.HealthCheckResponse_SERVING {
227228
level.Warn(util.Logger).Log("msg", "removing ingester client failing healthcheck", "addr", addr, "reason", err)
228229

229230
d.clientsMtx.Lock()

pkg/ingester/client/cortex.proto

+2-14
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package cortex;
55
option go_package = "client";
66

77
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
8+
import "google.golang.org/grpc/health/grpc_health_v1/health.proto";
89

910
option (gogoproto.marshaler_all) = true;
1011
option (gogoproto.unmarshaler_all) = true;
@@ -18,7 +19,7 @@ service Ingester {
1819

1920
// TransferChunks allows leaving ingester (client) to stream chunks directly to joining ingesters (server).
2021
rpc TransferChunks(stream TimeSeriesChunk) returns (TransferChunksResponse) {};
21-
rpc Check(HealthCheckRequest) returns (HealthCheckResponse);
22+
rpc Check(grpc.health.v1.HealthCheckRequest) returns (grpc.health.v1.HealthCheckResponse);
2223
}
2324

2425
message WriteRequest {
@@ -123,16 +124,3 @@ message LabelMatcher {
123124
string name = 2;
124125
string value = 3;
125126
}
126-
127-
message HealthCheckRequest {
128-
string service = 1;
129-
}
130-
131-
message HealthCheckResponse {
132-
enum ServingStatus {
133-
UNKNOWN = 0;
134-
SERVING = 1;
135-
NOT_SERVING = 2;
136-
}
137-
ServingStatus status = 1;
138-
}

pkg/ingester/ingester.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111

1212
// Needed for gRPC compatibility.
1313
old_ctx "golang.org/x/net/context"
14+
"google.golang.org/grpc/health/grpc_health_v1"
1415

1516
"github.com/go-kit/kit/log/level"
1617
"github.com/prometheus/client_golang/prometheus"
@@ -473,8 +474,8 @@ func (i *Ingester) UserStats(ctx old_ctx.Context, req *client.UserStatsRequest)
473474
}
474475

475476
// Check implements the grpc healthcheck
476-
func (i *Ingester) Check(ctx old_ctx.Context, req *client.HealthCheckRequest) (*client.HealthCheckResponse, error) {
477-
return &client.HealthCheckResponse{Status: client.SERVING}, nil
477+
func (i *Ingester) Check(ctx old_ctx.Context, req *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) {
478+
return &grpc_health_v1.HealthCheckResponse{Status: grpc_health_v1.HealthCheckResponse_SERVING}, nil
478479
}
479480

480481
// Describe implements prometheus.Collector.

vendor/google.golang.org/grpc/health/grpc_health_v1/health.pb.go

+190
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/google.golang.org/grpc/health/grpc_health_v1/health.proto

+34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)