aboutsummaryrefslogtreecommitdiff
path: root/weed/weed.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/weed.go')
-rw-r--r--weed/weed.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/weed/weed.go b/weed/weed.go
index 773d86274..a821cd72f 100644
--- a/weed/weed.go
+++ b/weed/weed.go
@@ -9,6 +9,7 @@ import (
"strings"
"sync"
"text/template"
+ "time"
"unicode"
"unicode/utf8"
@@ -16,6 +17,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util"
flag "github.com/seaweedfs/seaweedfs/weed/util/fla9"
+ "github.com/getsentry/sentry-go"
"github.com/seaweedfs/seaweedfs/weed/command"
"github.com/seaweedfs/seaweedfs/weed/glog"
)
@@ -49,6 +51,19 @@ func main() {
glog.MaxFileCount = 5
flag.Usage = usage
+ err := sentry.Init(sentry.ClientOptions{
+ SampleRate: 0.1,
+ EnableTracing: true,
+ TracesSampleRate: 0.1,
+ ProfilesSampleRate: 0.1,
+ })
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "sentry.Init: %v", err)
+ }
+ // Flush buffered events before the program terminates.
+ // Set the timeout to the maximum duration the program can afford to wait.
+ defer sentry.Flush(2 * time.Second)
+
if command.AutocompleteMain(commands) {
return
}