outposts: don't use custom environment

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-12-16 19:12:05 +01:00
parent e38ee9c580
commit 03da87991f
1 changed files with 3 additions and 5 deletions

View File

@ -1,7 +1,6 @@
package ak package ak
import ( import (
"fmt"
"net/http" "net/http"
"os" "os"
"strings" "strings"
@ -37,16 +36,15 @@ func doGlobalSetup(outpost api.Outpost, globalConfig api.Config) {
log.WithField("logger", "authentik.outpost").WithField("hash", constants.BUILD()).WithField("version", constants.VERSION).Info("Starting authentik outpost") log.WithField("logger", "authentik.outpost").WithField("hash", constants.BUILD()).WithField("version", constants.VERSION).Info("Starting authentik outpost")
if globalConfig.ErrorReporting.Enabled { if globalConfig.ErrorReporting.Enabled {
sentryEnv := fmt.Sprintf("%s-outpost-%s", globalConfig.ErrorReporting.Environment, outpost.Type)
dsn := "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8" dsn := "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8"
log.WithField("env", sentryEnv).Debug("Error reporting enabled") log.WithField("env", globalConfig.ErrorReporting.Environment).Debug("Error reporting enabled")
err := sentry.Init(sentry.ClientOptions{ err := sentry.Init(sentry.ClientOptions{
Dsn: dsn, Dsn: dsn,
Environment: sentryEnv, Environment: globalConfig.ErrorReporting.Environment,
TracesSampleRate: float64(globalConfig.ErrorReporting.TracesSampleRate), TracesSampleRate: float64(globalConfig.ErrorReporting.TracesSampleRate),
}) })
if err != nil { if err != nil {
log.WithField("env", sentryEnv).WithError(err).Warning("Failed to initialise sentry") log.WithField("env", globalConfig.ErrorReporting.Environment).WithError(err).Warning("Failed to initialise sentry")
} }
} }
} }