Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions extra/redisotel/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ func InstrumentTracing(rdb redis.UniversalClient, opts ...TracingOption) error {
rdb.AddHook(newTracingHook(connString, opts...))
return nil
case *redis.ClusterClient:
rdb.AddHook(newTracingHook("", opts...))
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a default tracing hook with empty connection string followed by OnNewNode hooks will result in duplicate spans for the same operations. The original PR #3168 that this reverts was specifically fixing this multiple span reporting issue. This revert reintroduces the same problem it was meant to solve.

Copilot uses AI. Check for mistakes.


rdb.OnNewNode(func(rdb *redis.Client) {
opt := rdb.Options()
opts = addServerAttributes(opts, opt.Addr)
Expand All @@ -38,6 +40,8 @@ func InstrumentTracing(rdb redis.UniversalClient, opts ...TracingOption) error {
})
return nil
case *redis.Ring:
rdb.AddHook(newTracingHook("", opts...))
Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a default tracing hook with empty connection string followed by OnNewNode hooks will result in duplicate spans for the same operations. The original PR #3168 that this reverts was specifically fixing this multiple span reporting issue. This revert reintroduces the same problem it was meant to solve.

Suggested change
rdb.AddHook(newTracingHook("", opts...))

Copilot uses AI. Check for mistakes.


rdb.OnNewNode(func(rdb *redis.Client) {
opt := rdb.Options()
opts = addServerAttributes(opts, opt.Addr)
Expand Down
Loading