1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-29 17:41:15 +03:00

otel: add RemoteAddr

This commit is contained in:
Vladimir Mihailenco
2020-09-28 15:35:57 +03:00
parent 9e4063ab5a
commit 566840fe27
4 changed files with 26 additions and 13 deletions

View File

@ -293,9 +293,9 @@ func newConnPool(opt *Options) *pool.ConnPool {
return pool.NewConnPool(&pool.Options{
Dialer: func(ctx context.Context) (net.Conn, error) {
var conn net.Conn
err := internal.WithSpan(ctx, "dialer", func(ctx context.Context) error {
err := internal.WithSpan(ctx, "dialer", func(ctx context.Context, span trace.Span) error {
var err error
trace.SpanFromContext(ctx).SetAttributes(
span.SetAttributes(
label.String("redis.network", opt.Network),
label.String("redis.addr", opt.Addr),
)