(hook redis.DialHook)
| 86 | } |
| 87 | |
| 88 | func (th *tracingHook) DialHook(hook redis.DialHook) redis.DialHook { |
| 89 | return func(ctx context.Context, network, addr string) (net.Conn, error) { |
| 90 | |
| 91 | if th.conf.filterDial { |
| 92 | return hook(ctx, network, addr) |
| 93 | } |
| 94 | |
| 95 | ctx, span := th.conf.tracer.Start(ctx, "redis.dial", th.spanOpts...) |
| 96 | defer span.End() |
| 97 | |
| 98 | conn, err := hook(ctx, network, addr) |
| 99 | if err != nil { |
| 100 | recordError(span, err) |
| 101 | return nil, err |
| 102 | } |
| 103 | return conn, nil |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func (th *tracingHook) ProcessHook(hook redis.ProcessHook) redis.ProcessHook { |
| 108 | return func(ctx context.Context, cmd redis.Cmder) error { |
nothing calls this directly
no test coverage detected