connectrpc/grpchealth-go

gRPC-compatible health checks for any net/http server.

96

stars

94

commits

Go

primary language

Aug 13, 2026

updated

connectrpc.com
connectrpc
go
grpc
protobuf
rpc
Browse cluster: gRPC and RPC frameworks

README

grpchealth

Build Report Card GoDoc

connectrpc.com/grpchealth adds support for gRPC-style health checks to any net/http server — including those built with Connect. By polling this API, load balancers, container orchestrators, and other infrastructure systems can respond to changes in your HTTP server's health.

The exposed health checking API is wire compatible with Google's gRPC implementations, so it works with grpcurl, grpc-health-probe, and Kubernetes gRPC liveness probes.

For more on Connect, see the announcement blog post, the documentation on connectrpc.com (especially the Getting Started guide for Go), the Connect repo, or the demo service.

Example

package main

import (
  "net/http"

  "connectrpc.com/grpchealth"
)

func main() {
  mux := http.NewServeMux()
  checker := grpchealth.NewStaticChecker(
    "acme.user.v1.UserService",
    "acme.group.v1.GroupService",
    // protoc-gen-connect-go generates package-level constants
    // for these fully-qualified protobuf service names, so you'd more likely
    // reference userv1.UserServiceName and groupv1.GroupServiceName.
  )
  mux.Handle(grpchealth.NewHandler(checker))
  // If you don't need to support HTTP/2 without TLS (h2c), you can use
  // http.ListenAndServeTLS instead.
  protocols := new(http.Protocols)
  protocols.SetHTTP1(true)
  protocols.SetUnencryptedHTTP2(true)
  server := &http.Server{
    Addr:      ":8080",
    Handler:   mux,
    Protocols: protocols,
  }
  server.ListenAndServe()
}

Status: Stable

This module is stable. It supports:

  • The two most recent major releases of Go (the same version of Go that continue to eceive security patches).
  • APIv2 of Protocol Buffers in Go (google.golang.org/protobuf).

Within those parameters, grpchealth follows semantic versioning. We will not make breaking changes in the 1.x series of releases.

Offered under the Apache 2 license.

Contributors

akshayjshah

50 commits

dependabot[bot]

15 commits

jhump

8 commits

rubensf

4 commits

connectrpc/grpchealth-go

gRPC-compatible health checks for any net/http server.

96

stars

94

commits

Go

primary language

Aug 13, 2026

updated

connectrpc.com
connectrpc
go
grpc
protobuf
rpc
Browse cluster: gRPC and RPC frameworks

README

grpchealth

Build Report Card GoDoc

connectrpc.com/grpchealth adds support for gRPC-style health checks to any net/http server — including those built with Connect. By polling this API, load balancers, container orchestrators, and other infrastructure systems can respond to changes in your HTTP server's health.

The exposed health checking API is wire compatible with Google's gRPC implementations, so it works with grpcurl, grpc-health-probe, and Kubernetes gRPC liveness probes.

For more on Connect, see the announcement blog post, the documentation on connectrpc.com (especially the Getting Started guide for Go), the Connect repo, or the demo service.

Example

package main

import (
  "net/http"

  "connectrpc.com/grpchealth"
)

func main() {
  mux := http.NewServeMux()
  checker := grpchealth.NewStaticChecker(
    "acme.user.v1.UserService",
    "acme.group.v1.GroupService",
    // protoc-gen-connect-go generates package-level constants
    // for these fully-qualified protobuf service names, so you'd more likely
    // reference userv1.UserServiceName and groupv1.GroupServiceName.
  )
  mux.Handle(grpchealth.NewHandler(checker))
  // If you don't need to support HTTP/2 without TLS (h2c), you can use
  // http.ListenAndServeTLS instead.
  protocols := new(http.Protocols)
  protocols.SetHTTP1(true)
  protocols.SetUnencryptedHTTP2(true)
  server := &http.Server{
    Addr:      ":8080",
    Handler:   mux,
    Protocols: protocols,
  }
  server.ListenAndServe()
}

Status: Stable

This module is stable. It supports:

  • The two most recent major releases of Go (the same version of Go that continue to eceive security patches).
  • APIv2 of Protocol Buffers in Go (google.golang.org/protobuf).

Within those parameters, grpchealth follows semantic versioning. We will not make breaking changes in the 1.x series of releases.

Offered under the Apache 2 license.

Contributors

akshayjshah

50 commits

dependabot[bot]

15 commits

jhump

8 commits

rubensf

4 commits

Languages

Go

92.2%

Makefile

7.8%