// the find
grpc-ecosystem/go-grpc-middleware
Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.
A collection of gRPC interceptors for Go covering auth, logging, retry, rate limiting, panic recovery, and validation. This is v2, a significant redesign of a well-established library that's been around since 2015. The target is anyone building Go microservices with gRPC who doesn't want to write the same boilerplate twelve times.
The split into core interceptors and separate provider modules is smart — you don't pull in Prometheus if you only want logging. The logging interceptor takes an adapter function instead of a concrete logger, so it works with slog, zap, zerolog, logrus, or anything else without the library forcing a dependency on you. The selector interceptor solves a real annoyance: applying an interceptor to every route except health checks is a two-liner instead of a mess of method-name string matching. The working example in the README shows trace ID correlation across metrics, logs, and auth in one coherent server setup, which is genuinely useful documentation.
The multi-module layout (main v2 module plus separate provider modules with independent versioning) creates real friction — your go.mod ends up with version pinning across multiple paths, and the versioning story between them is opaque. The rate limit interceptor requires you to implement the Limiter interface yourself; there's no bundled token bucket or sliding window, so you still need a third-party package to get anything working. Client-side timeout interceptor is a thin wrapper around context.WithTimeout that adds almost nothing over just doing it yourself. The retry interceptor's README explicitly warns that grpc-go now has native retries with richer policies, making this interceptor somewhat redundant for greenfield projects.