Skip to content

Revert "fix(redisotel): fix the situation of reporting spans multiple times (#3168)" #3433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Preview

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
Preview

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