server: remove sentry
Alan Pearce alan@alanpearce.eu
Tue, 11 Jun 2024 09:22:32 +0200
6 files changed, 3 insertions(+), 37 deletions(-)
M go.mod → go.mod
@@ -14,7 +14,6 @@ github.com/benpate/digit v0.12.0 github.com/crewjam/csp v0.0.2 github.com/deckarep/golang-set/v2 v2.6.0 github.com/fatih/structtag v1.2.0 - github.com/getsentry/sentry-go v0.27.0 github.com/otiai10/copy v1.14.0 github.com/pkg/errors v0.9.1 github.com/snabb/sitemap v1.0.4
M go.sum → go.sum
@@ -40,10 +40,6 @@ github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= -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/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-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -68,8 +64,6 @@ github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAqyUSM= -github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= -github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
M internal/server/server.go → internal/server/server.go
@@ -6,7 +6,6 @@ "fmt" "net" "net/http" "net/url" - "os" "slices" "time" @@ -14,8 +13,6 @@ cfg "website/internal/config" "website/internal/log" "website/internal/website" - "github.com/getsentry/sentry-go" - sentryhttp "github.com/getsentry/sentry-go/http" "github.com/pkg/errors" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" @@ -72,26 +69,9 @@ } listenAddress := net.JoinHostPort(runtimeConfig.ListenAddress, runtimeConfig.Port) - env := "development" - if runtimeConfig.Production { - env = "production" - } else { + if !runtimeConfig.Production { applyDevModeOverrides(config, listenAddress) } - err = sentry.Init(sentry.ClientOptions{ - EnableTracing: true, - TracesSampleRate: 1.0, - Dsn: os.Getenv("SENTRY_DSN"), - Release: CommitSHA, - Environment: env, - }) - if err != nil { - return nil, errors.WithMessage(err, "could not set up sentry") - } - defer sentry.Flush(2 * time.Second) - sentryHandler := sentryhttp.New(sentryhttp.Options{ - Repanic: true, - }) top := http.NewServeMux() mux, err := website.NewMux(config, runtimeConfig.Root) @@ -117,10 +97,8 @@ &http.Server{ Addr: listenAddress, ReadHeaderTimeout: 1 * time.Minute, Handler: http.MaxBytesHandler(h2c.NewHandler( - sentryHandler.Handle( - serverHeaderHandler( - wrapHandlerWithLogging(top), - ), + serverHeaderHandler( + wrapHandlerWithLogging(top), ), &http2.Server{ IdleTimeout: 15 * time.Minute,
M nix/gomod2nix.toml → nix/gomod2nix.toml
@@ -59,9 +59,6 @@ hash = "sha256-ni1XK75Q8iBBmxgoyZTedP4RmrUPzFC4978xB4HKdfs=" [mod."github.com/fatih/structtag"] version = "v1.2.0" hash = "sha256-Y2pjiEmMsxfUH8LONU2/f8k1BibOHeLKJmi4uZm/SSU=" - [mod."github.com/getsentry/sentry-go"] - version = "v0.27.0" - hash = "sha256-PTkTzVNogqFA/5rc6INLY6RxK5uR1AoJFOO+pOPdE7Q=" [mod."github.com/golang/groupcache"] version = "v0.0.0-20210331224755-41bb18bfe9da" hash = "sha256-7Gs7CS9gEYZkbu5P4hqPGBpeGZWC64VDwraSKFF+VR0="