Skip to content

Commit

Permalink
Remove skipping span creation by checking parent spans
Browse files Browse the repository at this point in the history
  • Loading branch information
XSAM committed Apr 23, 2024
1 parent f3fe611 commit d8c8ff3
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions extra/redisotel/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ func newTracingHook(connString string, opts ...TracingOption) *tracingHook {

func (th *tracingHook) DialHook(hook redis.DialHook) redis.DialHook {
return func(ctx context.Context, network, addr string) (net.Conn, error) {
if !trace.SpanFromContext(ctx).IsRecording() {
return hook(ctx, network, addr)
}

ctx, span := th.conf.tracer.Start(ctx, "redis.dial", th.spanOpts...)
defer span.End()

Expand All @@ -109,10 +105,6 @@ func (th *tracingHook) DialHook(hook redis.DialHook) redis.DialHook {

func (th *tracingHook) ProcessHook(hook redis.ProcessHook) redis.ProcessHook {
return func(ctx context.Context, cmd redis.Cmder) error {
if !trace.SpanFromContext(ctx).IsRecording() {
return hook(ctx, cmd)
}

fn, file, line := funcFileLine("github.com/redis/go-redis")

attrs := make([]attribute.KeyValue, 0, 8)
Expand Down Expand Up @@ -145,10 +137,6 @@ func (th *tracingHook) ProcessPipelineHook(
hook redis.ProcessPipelineHook,
) redis.ProcessPipelineHook {
return func(ctx context.Context, cmds []redis.Cmder) error {
if !trace.SpanFromContext(ctx).IsRecording() {
return hook(ctx, cmds)
}

fn, file, line := funcFileLine("github.com/redis/go-redis")

attrs := make([]attribute.KeyValue, 0, 8)
Expand Down

0 comments on commit d8c8ff3

Please sign in to comment.