{"id":37139985,"url":"https://github.com/lightstep/go-grpc-middleware","last_synced_at":"2026-01-14T16:24:19.225Z","repository":{"id":57492991,"uuid":"183501956","full_name":"lightstep/go-grpc-middleware","owner":"lightstep","description":"Golang gRPC Middlewares: interceptor chaining, auth, logging, retries and more.","archived":false,"fork":true,"pushed_at":"2019-04-24T00:56:19.000Z","size":13504,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-06-20T10:18:26.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"MatthewDolan/go-grpc-middleware","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightstep.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-25T20:02:32.000Z","updated_at":"2019-04-25T20:02:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lightstep/go-grpc-middleware","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lightstep/go-grpc-middleware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fgo-grpc-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fgo-grpc-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fgo-grpc-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fgo-grpc-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightstep","download_url":"https://codeload.github.com/lightstep/go-grpc-middleware/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fgo-grpc-middleware/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28425705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T16:24:18.461Z","updated_at":"2026-01-14T16:24:19.212Z","avatar_url":"https://github.com/lightstep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go gRPC Middleware\n\n[![Travis Build](https://travis-ci.org/grpc-ecosystem/go-grpc-middleware.svg?branch=master)](https://travis-ci.org/grpc-ecosystem/go-grpc-middleware)\n[![Go Report Card](https://goreportcard.com/badge/github.com/grpc-ecosystem/go-grpc-middleware)](https://goreportcard.com/report/github.com/grpc-ecosystem/go-grpc-middleware)\n[![GoDoc](http://img.shields.io/badge/GoDoc-Reference-blue.svg)](https://godoc.org/github.com/grpc-ecosystem/go-grpc-middleware)\n[![SourceGraph](https://sourcegraph.com/github.com/grpc-ecosystem/go-grpc-middleware/-/badge.svg)](https://sourcegraph.com/github.com/grpc-ecosystem/go-grpc-middleware/?badge)\n[![codecov](https://codecov.io/gh/grpc-ecosystem/go-grpc-middleware/branch/master/graph/badge.svg)](https://codecov.io/gh/grpc-ecosystem/go-grpc-middleware)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n[![quality: production](https://img.shields.io/badge/quality-production-orange.svg)](#status)\n[![Slack](slack.png)](https://join.slack.com/t/improbable-eng/shared_invite/enQtMzQ1ODcyMzQ5MjM4LWY5ZWZmNGM2ODc5MmViNmQ3ZTA3ZTY3NzQwOTBlMTkzZmIxZTIxODk0OWU3YjZhNWVlNDU3MDlkZGViZjhkMjc)\n\n[gRPC Go](https://github.com/grpc/grpc-go) Middleware: interceptors, helpers, utilities.\n\n## Middleware\n\n[gRPC Go](https://github.com/grpc/grpc-go) recently acquired support for\nInterceptors, i.e. [middleware](https://medium.com/@matryer/writing-middleware-in-golang-and-how-go-makes-it-so-much-fun-4375c1246e81#.gv7tdlghs) \nthat 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\ncommon patterns: auth, logging, message, validation, retries or monitoring.\n\nThese are generic building blocks that make it easy to build multiple microservices easily.\nThe purpose of this repository is to act as a go-to point for such reusable functionality. It contains\nsome of them itself, but also will link to useful external repos.\n\n`grpc_middleware` itself provides support for chaining interceptors, here's an example:\n\n```go\nimport \"github.com/grpc-ecosystem/go-grpc-middleware\"\n\nmyServer := grpc.NewServer(\n    grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(\n        grpc_ctxtags.StreamServerInterceptor(),\n        grpc_opentracing.StreamServerInterceptor(),\n        grpc_prometheus.StreamServerInterceptor,\n        grpc_zap.StreamServerInterceptor(zapLogger),\n        grpc_auth.StreamServerInterceptor(myAuthFunction),\n        grpc_recovery.StreamServerInterceptor(),\n    )),\n    grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(\n        grpc_ctxtags.UnaryServerInterceptor(),\n        grpc_opentracing.UnaryServerInterceptor(),\n        grpc_prometheus.UnaryServerInterceptor,\n        grpc_zap.UnaryServerInterceptor(zapLogger),\n        grpc_auth.UnaryServerInterceptor(myAuthFunction),\n        grpc_recovery.UnaryServerInterceptor(),\n    )),\n)\n```\n\n## Interceptors\n\n*Please send a PR to add new interceptors or middleware to this list*\n\n#### Auth\n   * [`grpc_auth`](auth) - a customizable (via `AuthFunc`) piece of auth middleware \n\n#### Logging\n   * [`grpc_ctxtags`](tags/) - a library that adds a `Tag` map to context, with data populated from request body\n   * [`grpc_zap`](logging/zap/) - integration of [zap](https://github.com/uber-go/zap) logging library into gRPC handlers.\n   * [`grpc_logrus`](logging/logrus/) - integration of [logrus](https://github.com/sirupsen/logrus) logging library into gRPC handlers.\n\n\n#### Monitoring\n   * [`grpc_prometheus`⚡](https://github.com/grpc-ecosystem/go-grpc-prometheus) - Prometheus client-side and server-side monitoring middleware\n   * [`otgrpc`⚡](https://github.com/grpc-ecosystem/grpc-opentracing/tree/master/go/otgrpc) - [OpenTracing](http://opentracing.io/) client-side and server-side interceptors\n   * [`grpc_opentracing`](tracing/opentracing) - [OpenTracing](http://opentracing.io/) client-side and server-side interceptors with support for streaming and handler-returned tags\n\n#### Client\n   * [`grpc_retry`](retry/) - a generic gRPC response code retry mechanism, client-side middleware\n\n#### Server\n   * [`grpc_validator`](validator/) - codegen inbound message validation from `.proto` options\n   * [`grpc_recovery`](recovery/) - turn panics into gRPC errors\n\n\n## Status\n\nThis code has been running in *production* since May 2016 as the basis of the gRPC micro services stack at [Improbable](https://improbable.io).\n\nAdditional tooling will be added, and contributions are welcome.\n\n## License\n\n`go-grpc-middleware` is released under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightstep%2Fgo-grpc-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightstep%2Fgo-grpc-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightstep%2Fgo-grpc-middleware/lists"}