Commit 2f25e568 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Group raven setup actions in one place

parent b5990109
...@@ -52,7 +52,6 @@ func main() { ...@@ -52,7 +52,6 @@ func main() {
} }
flag.Parse() flag.Parse()
raven.DefaultClient.SetRelease(Version)
version := fmt.Sprintf("gitlab-workhorse %s", Version) version := fmt.Sprintf("gitlab-workhorse %s", Version)
if *printVersion { if *printVersion {
fmt.Println(version) fmt.Println(version)
...@@ -92,6 +91,11 @@ func main() { ...@@ -92,6 +91,11 @@ func main() {
}() }()
} }
// Use a custom environment variable (not SENTRY_DSN) to prevent
// clashes with gitlab-rails.
raven.SetDSN(os.Getenv("GITLAB_WORKHORSE_SENTRY_DSN"))
raven.DefaultClient.SetRelease(Version)
up := wrapRaven( up := wrapRaven(
upstream.NewUpstream( upstream.NewUpstream(
backendURL, backendURL,
...@@ -107,9 +111,5 @@ func main() { ...@@ -107,9 +111,5 @@ func main() {
} }
func wrapRaven(h http.Handler) http.Handler { func wrapRaven(h http.Handler) http.Handler {
// Use a custom environment variable (not SENTRY_DSN) to prevent
// clashes with gitlab-rails.
raven.SetDSN(os.Getenv("GITLAB_WORKHORSE_SENTRY_DSN"))
return http.HandlerFunc(raven.RecoveryHandler(h.ServeHTTP)) return http.HandlerFunc(raven.RecoveryHandler(h.ServeHTTP))
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment