Skip to content

Commit

Permalink
remove bugsnag, add sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel van Gils committed Jul 10, 2017
1 parent 33c5a7d commit f644b0b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
27 changes: 20 additions & 7 deletions main.go
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/cloud66/habitus/configuration"
"github.com/cloud66/habitus/api"
"github.com/op/go-logging"

"github.com/bugsnag/bugsnag-go"
"github.com/getsentry/raven-go"
"runtime"
)

var prettyFormat = logging.MustStringFormatter(
Expand All @@ -31,17 +31,15 @@ var (
)

func init() {
bugsnag.Configure(bugsnag.Configuration{
APIKey: "ba9d7ae6b333e27971d86e5bf7abe996",
AppVersion: VERSION,
})
//sentry DSN setup
raven.SetDSN("https://c5b047b41b3f4de38fc93cb3df75fd43:c94164f03aba4ded84de1fa5894e6544@sentry.io/187936")
}

const DEFAULT_DOCKER_HOST = "unix:///var/run/docker.sock"

func main() {
args := os.Args[1:]
defer bugsnag.AutoNotify()
defer recoverPanic()

var log = logging.MustGetLogger("habitus")
logging.SetFormatter(plainFormat)
Expand Down Expand Up @@ -158,3 +156,18 @@ func main() {
log.Errorf("Error during build %s", err.Error())
}
}


func recoverPanic() {
if VERSION != "dev" {
raven.CapturePanicAndWait(func() {
if rec := recover(); rec != nil {
panic(rec)
}
}, map[string]string{
"Version": VERSION,
"Platform": runtime.GOOS,
"Architecture": runtime.GOARCH,
"goversion": runtime.Version()})
}
}
12 changes: 12 additions & 0 deletions vendor/vendor.json
Expand Up @@ -62,6 +62,12 @@
"revision": "aa7703c9414b36d4e9b2e42e6c704d0bfae7db64",
"revisionTime": "2016-09-12T15:55:06Z"
},
{
"checksumSHA1": "0hWqEc//bdHUtnxlAo/UPkHSIS0=",
"path": "github.com/certifi/gocertifi",
"revision": "a9c833d2837d3b16888d55d5aafa9ffe9afb22b0",
"revisionTime": "2017-04-17T19:39:30Z"
},
{
"checksumSHA1": "pXA0VXOMBMY18/4WFJjqnsT51jo=",
"path": "github.com/dchest/uniuri",
Expand Down Expand Up @@ -254,6 +260,12 @@
"revision": "50724541fde5c77c754caf1d65d3c57e3e91883b",
"revisionTime": "2017-02-15T13:24:27Z"
},
{
"checksumSHA1": "v80i7OW4AhVGbebGd7oTyfpV/Oc=",
"path": "github.com/getsentry/raven-go",
"revision": "d175f85701dfbf44cb0510114c9943e665e60907",
"revisionTime": "2017-03-30T19:40:04Z"
},
{
"checksumSHA1": "b8F628srIitj5p7Y130xc9k0QWs=",
"path": "github.com/hashicorp/go-cleanhttp",
Expand Down

0 comments on commit f644b0b

Please sign in to comment.