1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: upgrade dependencies

This commit is contained in:
Ferdinand Mütsch
2023-01-26 16:49:35 +01:00
parent a6ce6725db
commit 83ecf43d90
3 changed files with 22 additions and 16 deletions

View File

@@ -111,24 +111,20 @@ func initSentry(config sentryConfig, debug bool) {
Dsn: config.Dsn,
Debug: debug,
AttachStacktrace: true,
TracesSampler: sentry.TracesSamplerFunc(func(ctx sentry.SamplingContext) sentry.Sampled {
if !config.EnableTracing {
return sentry.SampledFalse
}
EnableTracing: config.EnableTracing,
TracesSampler: func(ctx sentry.SamplingContext) float64 {
hub := sentry.GetHubFromContext(ctx.Span.Context())
txName := hub.Scope().Transaction()
for _, ex := range excludedRoutes {
if strings.HasPrefix(txName, ex) {
return sentry.SampledFalse
return 0.0
}
}
if txName == "POST /api/heartbeat" {
return sentry.UniformTracesSampler(config.SampleRateHeartbeats).Sample(ctx)
return float64(config.SampleRateHeartbeats)
}
return sentry.UniformTracesSampler(config.SampleRate).Sample(ctx)
}),
return float64(config.SampleRate)
},
BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {
if hint.Context != nil {
if req, ok := hint.Context.Value(sentry.RequestContextKey).(*http.Request); ok {