All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good
See: - https://sentry.in.nuonet.fr/share/issue/972e100ea22d44759c44b6cfad8be7b2/ - https://pkg.go.dev/net/http#:~:text=ErrAbortHandler%20is%20a%20sentinel%20panic%20value%20to%20abort%20a%20handler.%20While%20any%20panic%20from%20ServeHTTP%20aborts%20the%20response%20to%20the%20client%2C%20panicking%20with%20ErrAbortHandler%20also%20suppresses%20logging%20of%20a%20stack%20trace%20to%20the%20server%27s%20error%20log.
44 lines
1.7 KiB
Go
44 lines
1.7 KiB
Go
package config
|
|
|
|
import "time"
|
|
|
|
// Sentry configuration
|
|
// See https://pkg.go.dev/github.com/getsentry/sentry-go?utm_source=godoc#ClientOptions
|
|
type SentryConfig struct {
|
|
DSN InterpolatedString `yaml:"dsn"`
|
|
Debug InterpolatedBool `yaml:"debug"`
|
|
FlushTimeout *InterpolatedDuration `yaml:"flushTimeout"`
|
|
AttachStacktrace InterpolatedBool `yaml:"attachStacktrace"`
|
|
SampleRate InterpolatedFloat `yaml:"sampleRate"`
|
|
EnableTracing InterpolatedBool `yaml:"enableTracing"`
|
|
TracesSampleRate InterpolatedFloat `yaml:"tracesSampleRate"`
|
|
ProfilesSampleRate InterpolatedFloat `yaml:"profilesSampleRate"`
|
|
IgnoreErrors InterpolatedStringSlice `yaml:"ignoreErrors"`
|
|
SendDefaultPII InterpolatedBool `yaml:"sendDefaultPII"`
|
|
ServerName InterpolatedString `yaml:"serverName"`
|
|
Environment InterpolatedString `yaml:"environment"`
|
|
MaxBreadcrumbs InterpolatedInt `yaml:"maxBreadcrumbs"`
|
|
MaxSpans InterpolatedInt `yaml:"maxSpans"`
|
|
MaxErrorDepth InterpolatedInt `yaml:"maxErrorDepth"`
|
|
}
|
|
|
|
func NewDefaultSentryConfig() SentryConfig {
|
|
return SentryConfig{
|
|
DSN: "",
|
|
Debug: false,
|
|
FlushTimeout: NewInterpolatedDuration(2 * time.Second),
|
|
AttachStacktrace: true,
|
|
SampleRate: 1,
|
|
EnableTracing: false,
|
|
TracesSampleRate: 0.1,
|
|
ProfilesSampleRate: 0.1,
|
|
IgnoreErrors: []string{"context canceled", "net/http: abort"},
|
|
SendDefaultPII: false,
|
|
ServerName: "",
|
|
Environment: "",
|
|
MaxBreadcrumbs: 0,
|
|
MaxSpans: 1000,
|
|
MaxErrorDepth: 10,
|
|
}
|
|
}
|