about summary refs log tree commit diff stats
path: root/internal/server/server.go
diff options
context:
space:
mode:
authorAlan Pearce2024-06-11 09:22:32 +0200
committerAlan Pearce2024-06-11 09:22:32 +0200
commite89fbd7ef3e418629ea2533cf4fa9707fe51950f (patch)
tree1c90d4ab8a283fcc9c299fddedada8747ab9a2f8 /internal/server/server.go
parenta9337d346ca6d82bbe203d50b176af9b7c146db0 (diff)
downloadwebsite-e89fbd7ef3e418629ea2533cf4fa9707fe51950f.tar.lz
website-e89fbd7ef3e418629ea2533cf4fa9707fe51950f.tar.zst
website-e89fbd7ef3e418629ea2533cf4fa9707fe51950f.zip
server: remove sentry
Diffstat (limited to 'internal/server/server.go')
-rw-r--r--internal/server/server.go28
1 files changed, 3 insertions, 25 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index 61d5790..31db347 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -6,7 +6,6 @@ import (
 	"net"
 	"net/http"
 	"net/url"
-	"os"
 	"slices"
 	"time"
 
@@ -14,8 +13,6 @@ import (
 	"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 @@ func New(runtimeConfig *Config) (*Server, error) {
 
 	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 @@ func New(runtimeConfig *Config) (*Server, error) {
 			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,