提交 b64a08b4 编写于 作者: C coder-yqj 提交者: wu-sheng

修改 JedisShardInfo 方式创建 jedis客户端时,无法拦截的bug (#1290)

上级 7cf67ffa
......@@ -34,6 +34,7 @@ import static org.apache.skywalking.apm.agent.core.plugin.match.NameMatch.byName
public class JedisInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
private static final String HOST_AND_PORT_ARG_TYPE_NAME = "redis.clients.jedis.HostAndPort";
private static final String JEDIS_SHARD_INFO_ARG_TYPE_NAME = "redis.clients.jedis.JedisShardInfo";
private static final String ENHANCE_CLASS = "redis.clients.jedis.Jedis";
private static final String CONSTRUCTOR_WITH_STRING_ARG_INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.jedis.v2.JedisConstructorWithStringArgInterceptor";
private static final String CONSTRUCTOR_WITH_SHARD_INFO_ARG_INTERCEPT_CLASS = "org.apache.skywalking.apm.plugin.jedis.v2.JedisConstructorWithShardInfoArgInterceptor";
......@@ -70,6 +71,17 @@ public class JedisInstrumentation extends ClassInstanceMethodsEnhancePluginDefin
return CONSTRUCTOR_WITH_SHARD_INFO_ARG_INTERCEPT_CLASS;
}
},
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
return takesArgumentWithType(0, JEDIS_SHARD_INFO_ARG_TYPE_NAME);
}
@Override
public String getConstructorInterceptor() {
return CONSTRUCTOR_WITH_SHARD_INFO_ARG_INTERCEPT_CLASS;
}
},
new ConstructorInterceptPoint() {
@Override
public ElementMatcher<MethodDescription> getConstructorMatcher() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册