From c21c1757de46312550f4dfe2b28c2d0faff58abb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Dec 2022 12:20:41 +0100 Subject: [PATCH] core: bump github.com/getsentry/sentry-go from 0.15.0 to 0.16.0 (#4179) * core: bump github.com/getsentry/sentry-go from 0.15.0 to 0.16.0 Bumps [github.com/getsentry/sentry-go](https://github.com/getsentry/sentry-go) from 0.15.0 to 0.16.0. - [Release notes](https://github.com/getsentry/sentry-go/releases) - [Changelog](https://github.com/getsentry/sentry-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-go/compare/v0.15.0...v0.16.0) --- updated-dependencies: - dependency-name: github.com/getsentry/sentry-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * update custom tracer Signed-off-by: Jens Langhammer Signed-off-by: dependabot[bot] Signed-off-by: Jens Langhammer Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jens Langhammer --- cmd/server/main.go | 1 + go.mod | 2 +- go.sum | 4 ++-- internal/outpost/ak/global.go | 1 + internal/utils/sentry/sentry.go | 10 +++++----- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 1d8af6d6e..7b9700fd2 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -40,6 +40,7 @@ func main() { err := sentry.Init(sentry.ClientOptions{ Dsn: config.Get().ErrorReporting.SentryDSN, AttachStacktrace: true, + EnableTracing: true, TracesSampler: sentryutils.SamplerFunc(config.Get().ErrorReporting.SampleRate), Release: fmt.Sprintf("authentik@%s", constants.VERSION), Environment: config.Get().ErrorReporting.Environment, diff --git a/go.mod b/go.mod index 3dd3fd3f7..c765c563f 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.18 require ( github.com/Netflix/go-env v0.0.0-20210215222557-e437a7e7f9fb github.com/coreos/go-oidc v2.2.1+incompatible - github.com/getsentry/sentry-go v0.15.0 + github.com/getsentry/sentry-go v0.16.0 github.com/go-http-utils/etag v0.0.0-20161124023236-513ea8f21eb1 github.com/go-ldap/ldap/v3 v3.4.4 github.com/go-openapi/runtime v0.25.0 diff --git a/go.sum b/go.sum index ab5a44865..5b2c790e0 100644 --- a/go.sum +++ b/go.sum @@ -76,8 +76,8 @@ github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8S github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/garyburd/redigo v1.6.2 h1:yE/pwKCrbLpLpQICzYTeZ7JsTA/C53wFTJHaEtRqniM= github.com/garyburd/redigo v1.6.2/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/getsentry/sentry-go v0.15.0 h1:CP9bmA7pralrVUedYZsmIHWpq/pBtXTSew7xvVpfLaA= -github.com/getsentry/sentry-go v0.15.0/go.mod h1:RZPJKSw+adu8PBNygiri/A98FqVr2HtRckJk9XVxJ9I= +github.com/getsentry/sentry-go v0.16.0 h1:owk+S+5XcgJLlGR/3+3s6N4d+uKwqYvh/eS0AIMjPWo= +github.com/getsentry/sentry-go v0.16.0/go.mod h1:ZXCloQLj0pG7mja5NK6NPf2V4A88YJ4pNlc2mOHwh6Y= github.com/go-asn1-ber/asn1-ber v1.5.4 h1:vXT6d/FNDiELJnLb6hGNa309LMsrCoYFvpwHDF0+Y1A= github.com/go-asn1-ber/asn1-ber v1.5.4/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= diff --git a/internal/outpost/ak/global.go b/internal/outpost/ak/global.go index d9c05b126..fbe9fb98d 100644 --- a/internal/outpost/ak/global.go +++ b/internal/outpost/ak/global.go @@ -51,6 +51,7 @@ func doGlobalSetup(outpost api.Outpost, globalConfig *api.Config) { err := sentry.Init(sentry.ClientOptions{ Dsn: globalConfig.ErrorReporting.SentryDsn, Environment: globalConfig.ErrorReporting.Environment, + EnableTracing: true, TracesSampler: sentryutils.SamplerFunc(float64(globalConfig.ErrorReporting.TracesSampleRate)), Release: fmt.Sprintf("authentik@%s", constants.VERSION), HTTPTransport: webutils.NewUserAgentTransport(constants.OutpostUserAgent(), http.DefaultTransport), diff --git a/internal/utils/sentry/sentry.go b/internal/utils/sentry/sentry.go index fb3f04d01..a9bc4b718 100644 --- a/internal/utils/sentry/sentry.go +++ b/internal/utils/sentry/sentry.go @@ -23,12 +23,12 @@ func SentryNoSampleMiddleware(h http.Handler) http.Handler { }) } -func SamplerFunc(defaultRate float64) sentry.TracesSamplerFunc { - return sentry.TracesSamplerFunc(func(ctx sentry.SamplingContext) sentry.Sampled { +func SamplerFunc(defaultRate float64) sentry.TracesSampler { + return func(ctx sentry.SamplingContext) float64 { data, ok := ctx.Span.Context().Value(contextSentryNoSample{}).(bool) if data && ok { - return sentry.SampledFalse + return 0 } - return sentry.UniformTracesSampler(defaultRate).Sample(ctx) - }) + return defaultRate + } }