Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public void getClusterConnection() {}

/**
* Intercepts calls to {@link RedisConnectionFactory#getConnection()} (and related), wrapping the
* outcome in a {@link TracingRedisConnection}
* outcome in a {@link TracingRedisConnection} or a {@link TracingRedisClusterConnection}
*
* @param pjp the intercepted join point
* @return a new {@link TracingRedisConnection} wrapping the result of the joint point
* @return a new {@link TracingRedisConnection} or {@link TracingRedisClusterConnection} wrapping the result of the joint point
*/
@Around("getConnection() && connectionFactory()")
public Object aroundGetConnection(final ProceedingJoinPoint pjp) throws Throwable {
Expand All @@ -70,6 +70,9 @@ public Object aroundGetConnection(final ProceedingJoinPoint pjp) throws Throwabl
.withSpanNameProvider(RedisSpanNameProvider.PREFIX_OPERATION_NAME(prefixOperationName))
.build();

if(connection instanceof RedisClusterConnection) {
return new TracingRedisClusterConnection((RedisClusterConnection) connection, tracingConfiguration);
}
return new TracingRedisConnection(connection, tracingConfiguration);
}

Expand Down