Skip to content

Commit

Permalink
try reusing trace
Browse files Browse the repository at this point in the history
  • Loading branch information
fritterhoff committed Nov 25, 2024
1 parent 2e56fb9 commit 885e553
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cas/sectigocas/sectigocas.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,17 @@ func sentryInterceptor(ctx context.Context,

operationName := defaultClientOperationName

span := sentry.StartSpan(ctx, operationName, sentry.WithDescription(method))
trace, okTrace := ctx.Value(sentryTrace{}).(string)
baggage, okBaggage := ctx.Value(sentryBaggage{}).(string)

options := []sentry.SpanOption{sentry.WithDescription(method)}
if okTrace && okBaggage {
options = append(options, sentry.ContinueFromHeaders(trace, baggage))
}

span := sentry.StartSpan(ctx, operationName, options...)
span.SetData("grpc.request.method", method)

ctx = span.Context()
md, ok := metadata.FromOutgoingContext(ctx)
if ok {
Expand Down

0 comments on commit 885e553

Please sign in to comment.