mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-22 07:01:49 +00:00
Remove Honeybadger integration.
This commit is contained in:
@@ -10,8 +10,6 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/honeybadger-io/honeybadger-go"
|
||||
|
||||
"github.com/getsentry/sentry-go"
|
||||
sentryhttp "github.com/getsentry/sentry-go/http"
|
||||
sentryslog "github.com/getsentry/sentry-go/slog"
|
||||
@@ -19,15 +17,13 @@ import (
|
||||
slogmulti "github.com/samber/slog-multi"
|
||||
)
|
||||
|
||||
func hasHoneybadger() bool {
|
||||
return os.Getenv("HONEYBADGER_API_KEY") != ""
|
||||
}
|
||||
|
||||
func hasSentry() bool {
|
||||
return os.Getenv("SENTRY_DSN") != ""
|
||||
}
|
||||
|
||||
func InitObservability() {
|
||||
debug.SetPanicOnFault(true)
|
||||
|
||||
environment := "development"
|
||||
if value, ok := os.LookupEnv("ENVIRONMENT"); ok {
|
||||
environment = value
|
||||
@@ -48,13 +44,6 @@ func InitObservability() {
|
||||
log.Println("unknown log format", config.LogFormat)
|
||||
}
|
||||
|
||||
if hasHoneybadger() {
|
||||
honeybadger.Configure(honeybadger.Configuration{
|
||||
Env: environment,
|
||||
})
|
||||
debug.SetPanicOnFault(true)
|
||||
}
|
||||
|
||||
if hasSentry() {
|
||||
enableLogs := false
|
||||
if value, err := strconv.ParseBool(os.Getenv("SENTRY_LOGS")); err == nil {
|
||||
@@ -96,10 +85,6 @@ func FiniObservability() {
|
||||
}
|
||||
|
||||
func ObserveHTTPHandler(handler http.Handler) http.Handler {
|
||||
if hasHoneybadger() {
|
||||
handler = honeybadger.Handler(handler)
|
||||
}
|
||||
|
||||
if hasSentry() {
|
||||
handler = sentryhttp.New(sentryhttp.Options{
|
||||
Repanic: true,
|
||||
|
||||
Reference in New Issue
Block a user