https://github.com/johnbellone/grpc-middleware-sentry
gRPC Go middleware for Sentry: server and client interceptors
https://github.com/johnbellone/grpc-middleware-sentry
go golang grpc grpc-go interceptor library middleware sentry
Last synced: 12 months ago
JSON representation
gRPC Go middleware for Sentry: server and client interceptors
- Host: GitHub
- URL: https://github.com/johnbellone/grpc-middleware-sentry
- Owner: johnbellone
- License: apache-2.0
- Created: 2021-01-14T17:17:20.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-18T03:43:14.000Z (about 1 year ago)
- Last Synced: 2025-04-02T07:11:15.752Z (12 months ago)
- Topics: go, golang, grpc, grpc-go, interceptor, library, middleware, sentry
- Language: Go
- Homepage:
- Size: 829 KB
- Stars: 45
- Watchers: 1
- Forks: 17
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# Go gRPC Middleware for Sentry
[gRPC Go middleware][0] for [Sentry][1]: server and client interceptors
## Middleware
``` go
import (
"github.com/getsentry/sentry-go"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_sentry "github.com/johnbellone/grpc-middleware-sentry"
)
func main() {
err = sentry.Init(sentry.ClientOptions{
Dsn: "https://897a3ef46125472da3ab8766deb302fe7fc7ade3@ingest.sentry.io/42",
Debug: false,
Environment: "development",
Release: "my-project@0.1.0",
IgnoreErrors: []string{},
})
defer sentry.Flush(2 * time.Second)
if err != nil {
logger.Fatal(err.Error())
}
s := grpc.NewServer(
grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(
grpc_sentry.StreamServerInterceptor(),
)),
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
grpc_sentry.UnaryServerInterceptor(),
)),
)
}
```
[0]: https://github.com/grpc-ecosystem/go-grpc-middleware
[1]: https://sentry.io