Skip to content

Add support for cluster client in go-redis client tracing library. #3004

Open
@sfc-gh-jlai

Description

@sfc-gh-jlai

The official go-redis client exposes a ClusterClient which is exposed via NewClusterClient. However, this tracing library only exposes the UniversalClient:

func NewClient(opt *redis.Options, opts ...ClientOption) redis.UniversalClient {

This is problematic, as the implementation of the UniversalClient is entirely dependent on the length of addresses sent under the Addrs key of UniversalClient:

https://github.com/redis/go-redis/blob/e63669e1706936ac794277340c51a51c5facca70/universal.go#L243-L250

However, when using AWS ElastiCache for Redis, their implementation only exposes a single "configuration endpoint":

Once your cluster is “available,” it is ready for use. You can connect to the cluster using the Configuration Endpoint listed in the AWS Management Console.

This single address is used to connect into the cluster. Therefore, the go-redis UniversalClient will assume single-node mode, and fail to connect to the cluster. Therefore, when using AWS ElastiCache for Redis and go-redis, the ClusterClient must be manually specified.

Therefore, this request is to expose ClusterClient in this tracing pacakge.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions