diff --git a/cmd/server/main.go b/cmd/server/main.go index 97a74558f..53fef6dbb 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -41,7 +41,7 @@ func main() { err := sentry.Init(sentry.ClientOptions{ Dsn: config.G.ErrorReporting.DSN, AttachStacktrace: true, - TracesSampleRate: 0.6, + TracesSampleRate: config.G.ErrorReporting.SampleRate, Release: fmt.Sprintf("authentik@%s", constants.VERSION), Environment: config.G.ErrorReporting.Environment, }) diff --git a/internal/config/config.go b/internal/config/config.go index 8425a4bac..ee5e2b5b6 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -24,8 +24,9 @@ func DefaultConfig() { }, LogLevel: "info", ErrorReporting: ErrorReportingConfig{ - Enabled: false, - DSN: "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8", + Enabled: false, + DSN: "https://a579bb09306d4f8b8d8847c052d3a1d3@sentry.beryju.org/8", + SampleRate: 1, }, } } diff --git a/internal/config/struct.go b/internal/config/struct.go index 359df5f64..e102fe8d3 100644 --- a/internal/config/struct.go +++ b/internal/config/struct.go @@ -42,4 +42,5 @@ type ErrorReportingConfig struct { Environment string `yaml:"environment" env:"AUTHENTIK_ERROR_REPORTING__ENVIRONMENT"` SendPII bool `yaml:"send_pii" env:"AUTHENTIK_ERROR_REPORTING__SEND_PII"` DSN string + SampleRate float64 `yaml:"sample_rate" env:"AUTHENTIK_ERROR_REPORTING__SAMPLE_RATE"` }