The
sentry
middleware is no longer maintained and was superseded by thesentry-go
SDK. Learn more about the project on GitHub and check out the new gin middleware.
See the example
package main
import (
"github.com/getsentry/raven-go"
"github.com/gin-contrib/sentry"
"github.com/gin-gonic/gin"
)
func init() {
raven.SetDSN("https://<key>:<secret>@app.getsentry.com/<project>")
}
func main() {
r := gin.Default()
r.Use(sentry.Recovery(raven.DefaultClient, false))
// only send crash reporting
// r.Use(sentry.Recovery(raven.DefaultClient, true))
r.Run(":8080")
}