Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.
| Date | Stars |
|---|---|
| 2026-07-24 | 6760 |
| 2026-07-25 | 6760 |
| 2026-07-28 | 6760 |
| 2026-07-30 | 6760 |
| 2026-08-06 | 6760 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Go gRPC Middleware [](https://github.com/grpc-ecosystem/go-grpc-middleware/actions?query=branch%3Av2) [](https://goreportcard.com/report/github.com/grpc-ecosystem/go-grpc-middleware) [](https://godoc.org/github.com/grpc-ecosystem/go-grpc-middleware/v2) [](LICENSE) [](https://gophers.slack.com/archives/CNJL30P4P) This repository holds [gRPC Go](https://github.com/grpc/grpc-go) Middlewares: interceptors, helpers and utilities. ## Middleware [gRPC Go](https://github.com/grpc/grpc-go) has support for "interceptors", i.e. [middleware](https://medium.com/@matryer/writing-middleware-in-golang-and-how-go-makes-it-so-much-fun-4375c1246e81#.gv7tdlghs) that is executed either on the gRPC Server before the request is passed onto the user's application logic, or on the gRPC client either around the user call. It is a perfect way to implement common patterns: auth, logging, tracing, metrics, validation, retries, rate limiting and more, which can be a great generic building blocks that make it easy to build multiple microservices easily. Especially for observability signals (logging, tracing, metrics) interceptors offers semi-auto-instrumentation that improves consistency of your observability and allows great correlation techniques (e.g. exemplars and trace ID in logs). Demo-ed in [examples](examples). This repository offers ready-to-use middlewares that implements gRPC interceptors with examples. In some cases dedicated projects offer great interceptors, so this repository skips those, and we link them in the [interceptors](#interceptors) list. > NOTE: Some middlewares are quite simple to write, so feel free to use this repo as template if you need. It's ok to copy some simpler interceptors if you need more flexibility. This repo can't support all the edge cases you might have. Additional great feature of interceptors is the fact we can chain those. For example below you can find example server side chain of interceptors with full observabiliy correlation, auth and panic recovery: ```go mdox-exec="sed -n '143,163p' examples/server/main.go" grpcSrv := grpc.NewServer( grpc.StatsHandler(otelgrpc.NewServerHandler()), grpc.ChainUnaryInterceptor( srvMetrics.UnaryServerInterceptor( grpcprom.WithExemplarFromContext(exemplarFromContext), grpcprom.WithLabelsFromContext(labelsFromContext), ), logging.UnaryServerInterceptor(interceptorLogger(rpcLogger), logging.WithFieldsFromContext(logTraceID)), selector.UnaryServerInterceptor(auth.UnaryServerInterceptor(authFn), selector.MatchFunc(allButHealthZ)), recovery.UnaryServerInterceptor(recovery.WithRecoveryHandler(grpcPanicRecoveryHandler)), ), grpc.ChainStreamInterceptor( srvMetrics.StreamServerInterceptor( grpcprom.WithExemplarFromContext(exemplarFromContext), grpcprom.WithLabelsFromContext(labelsFromContext), ), logging.StreamServerInterceptor(interceptorLogger(rpcLogger), logging.WithFieldsFromContext(logTraceID)), selector.StreamServerInterceptor(auth.StreamServerInterceptor(authFn), selector.MatchFunc(allButHealthZ)), recovery.StreamServerInterceptor(recovery.WithRecoveryHandler(grpcPanicRecoveryHandler)), ), ) ``` This pattern offers clean and explicit shared functionality for all your gRPC methods. Full, buildable examples can be found in [examples](examples) directory. ## Interceptors This list covers known interceptors that users use for their Go microservices (both in this repo and external). Click on each to see extended examples in `examples_test.go` (also available in [pkg.go.dev](https://godoc.org/github.com/grpc-ecosystem/
Excerpt of 12,764 characters
Read on GitHubDominic Green · United Kingdom
28
Bartlomiej Plotka · Google · United Kingdom
24
Matthieu MOREL · France
15
9
9
8
Mikhail Mazurskiy · @gitlabhq
8
8
Dmitry Savintsev · @Yahoo · Germany
7
6
aimuz
6
4
4
4
Till Knuesting
3
Sam Xie · @splunk
3
3
3
Junpei Kawamoto · Slovakia
3
3
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:937ac42ef282f889, topic:testing