Skip to content

Commit

Permalink
Move sentry init to separate sentry package
Browse files Browse the repository at this point in the history
  • Loading branch information
monstermunchkin committed Sep 11, 2024
1 parent 8a2d51e commit f60a04c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
13 changes: 0 additions & 13 deletions maintenance/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,13 @@ package tracing
import (
"fmt"
"net/http"
"os"

"github.com/getsentry/sentry-go"
"github.com/pace/bricks/maintenance/log"
"github.com/pace/bricks/maintenance/util"
"github.com/zenazn/goji/web/mutil"
)

func init() {
err := sentry.Init(sentry.ClientOptions{
Dsn: os.Getenv("SENTRY_DSN"),
Environment: os.Getenv("ENVIRONMENT"),
EnableTracing: true,
TracesSampleRate: 1.0,
})
if err != nil {
log.Fatalf("sentry.Init: %v", err)
}
}

type traceHandler struct {
next http.Handler
}
Expand Down
20 changes: 20 additions & 0 deletions sentry/sentry.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package sentry

import (
"log"
"os"

"github.com/getsentry/sentry-go"
)

func init() {
err := sentry.Init(sentry.ClientOptions{
Dsn: os.Getenv("SENTRY_DSN"),
Environment: os.Getenv("ENVIRONMENT"),
EnableTracing: true,
TracesSampleRate: 1.0,
})
if err != nil {
log.Fatalf("sentry.Init: %v", err)
}
}

0 comments on commit f60a04c

Please sign in to comment.