https://github.com/01walid/echosentry
A sentry (raven-go) middleware for echo micro web framework
https://github.com/01walid/echosentry
echo error-log error-monitoring error-reporting golang middleware raven sentry sentry-client
Last synced: 5 months ago
JSON representation
A sentry (raven-go) middleware for echo micro web framework
- Host: GitHub
- URL: https://github.com/01walid/echosentry
- Owner: 01walid
- License: mit
- Created: 2015-11-14T23:15:39.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-05-05T17:33:37.000Z (over 7 years ago)
- Last Synced: 2025-05-07T02:03:48.231Z (5 months ago)
- Topics: echo, error-log, error-monitoring, error-reporting, golang, middleware, raven, sentry, sentry-client
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 16
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# echosentry
[](https://godoc.org/github.com/01walid/echosentry)A sentry ([raven-go](https://github.com/getsentry/raven-go)) middleware for [echo](https://github.com/labstack/echo) (v2) micro web framework.
**Note**: this support echo with the standard http engine (no fasthttp support yet)
# Usage
```go
echosentry.SetDSN("https://:@app.getsentry.com/")
e.Use(echosentry.Middleware())```
By default, the middleware logs the HTTP context and sends it along with the stacktrace, this adds info about the user's browser, URL, OS, device, interface_type ..etc.
You can disable HTTP context as follow:
```go
echosentry.WithContext(false)
```## Additional tags
You can append additional tags to be captured by Sentry. Tags content can be extracted from the current request context or just static tags, e.g. tags["app_version"] = appVersion.
```go
echosentry.SetTags(func(c echo.Context) map[string]string {
return map[string]string{
"endpoint": c.Request().URL.String(),
"http_interface": c.Request().Proto,
"app_version": appVersion,
}
})
```# TODO
- Log the user info (user context)
- Expose more options# License
MIT License. A copy is included with the source.