SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
add basic support for sentry error reporting (#5410)
Nikita Korolev953f57134903
diff --git a/go.mod b/go.modindex f0ebfb4f89..7cfb01a5cb 100644--- a/go.mod+++ b/go.mod@@ -30,7 +30,7 @@ require (github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirectgithub.com/fclairamb/ftpserverlib v0.24.0github.com/fsnotify/fsnotify v1.7.0 // indirect- github.com/go-errors/errors v1.1.1 // indirect+ github.com/go-errors/errors v1.4.2 // indirectgithub.com/go-redis/redis/v8 v8.11.5github.com/go-redsync/redsync/v4 v4.11.0github.com/go-sql-driver/mysql v1.8.0@@ -226,6 +226,7 @@ require (github.com/flynn/noise v1.0.1 // indirectgithub.com/gabriel-vasile/mimetype v1.4.3 // indirectgithub.com/geoffgarside/ber v1.1.0 // indirect+ github.com/getsentry/sentry-go v0.27.0 // indirectgithub.com/go-chi/chi/v5 v5.0.11 // indirectgithub.com/go-logr/logr v1.4.1 // indirectgithub.com/go-logr/stdr v1.2.2 // indirectdiff --git a/go.sum b/go.sumindex ffc0f77181..9951fbbe66 100644--- a/go.sum+++ b/go.sum@@ -325,6 +325,8 @@ github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqgithub.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=github.com/geoffgarside/ber v1.1.0 h1:qTmFG4jJbwiSzSXoNJeHcOprVzZ8Ulde2Rrrifu5U9w=github.com/geoffgarside/ber v1.1.0/go.mod h1:jVPKeCbj6MvQZhwLYsGwaGI52oUorHoHKNecGT85ZCc=+github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps=+github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=@@ -334,6 +336,8 @@ github.com/go-chi/chi/v5 v5.0.11 h1:BnpYbFZ3T3S1WMpD79r7R5ThWX40TaFB7L31Y8xqSwA=github.com/go-chi/chi/v5 v5.0.11/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=github.com/go-errors/errors v1.1.1 h1:ljK/pL5ltg3qoN+OtN6yCv9HWSfMwxSx90GJCZQxYNg=github.com/go-errors/errors v1.1.1/go.mod h1:psDX2osz5VnTOnFWbDeWwS7yejl+uV3FEWEp4lssFEs=+github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=+github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=diff --git a/weed/weed.go b/weed/weed.goindex 773d862749..a821cd72f1 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 = 5flag.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}