-
Notifications
You must be signed in to change notification settings - Fork 425
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
contrib/go-redis/redis.v8: support wrapping a go-redis v8 client #808
Conversation
In general, we can only add the info we can get from the client. If host/port aren't available (or don't have a useful value) then we should skip adding them.
Yes, Let's add the list of them as a tag, unless you can think of a more useful way to tag them.
I am ok exposing any differences that are present. We don't need to (or even want to) make it appear that all clients are the same. We should expose as much useful information as we can get from any of the clients. We can even expose the type of client as a tag, if you think that will be useful. |
I've made the tags specific to each client. I ended up sticking with what was there originally - |
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.
Looks mostly good. I have some style nits and one request about testing.
…lients Adds a WrapClient method which takes an already consructed redis.UniversalClient and adds a tracing hook
Consolidate the addition of a hook to a Redis client via WrapClient
8963c22
to
ee850cd
Compare
ee850cd
to
0b36536
Compare
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.
LGTM
Introduce a new function, WrapClient, in the go-redis.v8 integration. This is similar to the older go-redis integration in allowing a user to supply an already configured Redis client and have the tracing added to that rather than having the library build and return a client. Fixes #803
Fixes #803
Introduce a new method,
WrapClient
, in the go-redis.v8 integration. This is similar to the older go-redis integration in allowing a user to supply an already configured Redis client and have the tracing added to that rather than having the library build and return a client.redis.NewUniversalClient
can return aClient
,FailoverClient
, orClusterClient
instance. The important difference for this integration is the way that Redis addresses are available from a build client. AClient
instance has aAddr
field set to what's passed in to the constructor (e.g.127.0.0.1:6379
),FailoverClient
setsAddr
toFailoverClient
andClusterCleint
doesn't make this available at all. This is important becauseAddr
is currently what's being used to sethost
andport
tags on traces.host
andport
tags for the client types that don't have a useful value?ClusterClient
has a list of addresses available. Should we / can we add all of them as tags?I've left the
host
andport
tags as they were until we decide what the approach for each should be. These are also currently excluded from the test.