-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -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...)) | ||||
|
||||
rdb.OnNewNode(func(rdb *redis.Client) { | ||||
opt := rdb.Options() | ||||
opts = addServerAttributes(opts, opt.Addr) | ||||
|
@@ -38,6 +40,8 @@ func InstrumentTracing(rdb redis.UniversalClient, opts ...TracingOption) error { | |||
}) | ||||
return nil | ||||
case *redis.Ring: | ||||
rdb.AddHook(newTracingHook("", opts...)) | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||
|
||||
rdb.OnNewNode(func(rdb *redis.Client) { | ||||
opt := rdb.Options() | ||||
opts = addServerAttributes(opts, opt.Addr) | ||||
|
There was a problem hiding this comment.
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.