From df61c9f143a2e74a0a34c7d79d8a44399881d74c Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Mon, 7 Nov 2022 15:19:14 +0100 Subject: [PATCH] Review feedback --- interfaces.go | 2 +- tracing.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/interfaces.go b/interfaces.go index c082ab38f..9658e7022 100644 --- a/interfaces.go +++ b/interfaces.go @@ -223,7 +223,7 @@ const ( // SDKMetaData is a struct to stash data which is needed at some point in the SDK's event processing pipeline // but which shouldn't get send to Sentry. -type SDKMetaData = struct { +type SDKMetaData struct { DynamicSamplingContextKey DynamicSamplingContext } diff --git a/tracing.go b/tracing.go index bab1bbdd4..b5a4e1997 100644 --- a/tracing.go +++ b/tracing.go @@ -230,8 +230,8 @@ func (s *Span) ToSentryTrace() string { } func (s *Span) ToBaggage() string { - if dsc := s.dynamicSamplingContext; len(dsc.Entries) > 0 { - return dsc.String() + if len(s.dynamicSamplingContext.Entries) > 0 { + return s.dynamicSamplingContext.String() } return "" @@ -612,7 +612,7 @@ func ContinueFromRequest(r *http.Request) SpanOption { // ContinueFromHeaders returns a span option that updates the span to continue // an existing TraceID and propagates the Dynamic Sampling context. -func ContinueFromHeaders(trace string, baggage string) SpanOption { +func ContinueFromHeaders(trace, baggage string) SpanOption { return func(s *Span) { if trace != "" { s.updateFromSentryTrace([]byte(trace))