2023-07-05 20:05:30 +02:00
|
|
|
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,
|
2024-09-23 10:12:42 +02:00
|
|
|
SampleRate: 0.2,
|
2023-07-05 20:05:30 +02:00
|
|
|
EnableTracing: true,
|
|
|
|
TracesSampleRate: 0.2,
|
2024-09-23 10:12:42 +02:00
|
|
|
ProfilesSampleRate: 0.2,
|
2023-07-05 20:05:30 +02:00
|
|
|
IgnoreErrors: []string{},
|
|
|
|
SendDefaultPII: false,
|
|
|
|
ServerName: "",
|
|
|
|
Environment: "",
|
|
|
|
MaxBreadcrumbs: 0,
|
|
|
|
MaxSpans: 1000,
|
|
|
|
MaxErrorDepth: 10,
|
|
|
|
}
|
|
|
|
}
|