Skip to content

Commit c67b64a

Browse files
committed
buildkitd: add grpc.health.v1.Health service
buildkitd now supports a health service: $ grpcurl -plaintext localhost:1234 list ... grpc.health.v1.Health ... Which can be used to implement a lightweight health check on the running server: $ grpcurl -plaintext localhost:1234 grpc.health.v1.Health/Check { "status": "SERVING" } Signed-off-by: Justin Chadwell <[email protected]>
1 parent f47a9da commit c67b64a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmd/buildkitd/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ import (
6767
tracev1 "go.opentelemetry.io/proto/otlp/collector/trace/v1"
6868
"golang.org/x/sync/errgroup"
6969
"google.golang.org/grpc"
70+
"google.golang.org/grpc/health"
71+
healthv1 "google.golang.org/grpc/health/grpc_health_v1"
7072
"google.golang.org/grpc/reflection"
7173
)
7274

@@ -309,6 +311,7 @@ func main() {
309311
}
310312
defer controller.Close()
311313

314+
healthv1.RegisterHealthServer(server, health.NewServer())
312315
controller.Register(server)
313316
reflection.Register(server)
314317

0 commit comments

Comments
 (0)