From b5685ec072e29f1115fbe91893c3dc88c72517b8 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 14 Dec 2021 11:50:31 +0100 Subject: [PATCH] outposts: set sentry-trace on API requests to match them to the outer transaction Signed-off-by: Jens Langhammer --- internal/outpost/ak/http_tracing.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/outpost/ak/http_tracing.go b/internal/outpost/ak/http_tracing.go index 16b30c10e..fb73ec176 100644 --- a/internal/outpost/ak/http_tracing.go +++ b/internal/outpost/ak/http_tracing.go @@ -20,6 +20,7 @@ func NewTracingTransport(ctx context.Context, inner http.RoundTripper) *tracingT func (tt *tracingTransport) RoundTrip(r *http.Request) (*http.Response, error) { span := sentry.StartSpan(tt.ctx, "authentik.go.http_request") + r.Header.Set("sentry-trace", span.ToSentryTrace()) span.Description = fmt.Sprintf("%s %s", r.Method, r.URL.String()) span.SetTag("url", r.URL.String()) span.SetTag("method", r.Method)