From e3aae0253d79b261a10c1daece18748e9bcd1e87 Mon Sep 17 00:00:00 2001 From: ascrutae Date: Thu, 2 Mar 2017 07:31:22 +0800 Subject: [PATCH] fix operation name of redis span issue --- .../skywalking/plugin/jedis/v2/JedisMethodInterceptor.java | 2 +- .../plugin/jedis/v2/JedisMethodInterceptorTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/src/main/java/com/a/eye/skywalking/plugin/jedis/v2/JedisMethodInterceptor.java b/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/src/main/java/com/a/eye/skywalking/plugin/jedis/v2/JedisMethodInterceptor.java index 8a817875e..b7d795433 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/src/main/java/com/a/eye/skywalking/plugin/jedis/v2/JedisMethodInterceptor.java +++ b/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/src/main/java/com/a/eye/skywalking/plugin/jedis/v2/JedisMethodInterceptor.java @@ -46,7 +46,7 @@ public class JedisMethodInterceptor extends NoCocurrencyAceessObject { this.whenEnter(context, new Runnable() { @Override public void run() { - Span span = ContextManager.INSTANCE.createSpan(interceptorContext.methodName()); + Span span = ContextManager.INSTANCE.createSpan("Jedis/" + interceptorContext.methodName()); Tags.COMPONENT.set(span, REDIS_COMPONENT); Tags.DB_TYPE.set(span, REDIS_COMPONENT); tagPeer(span, context); diff --git a/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/src/test/java/com/a/eye/skywalking/plugin/jedis/v2/JedisMethodInterceptorTest.java b/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/src/test/java/com/a/eye/skywalking/plugin/jedis/v2/JedisMethodInterceptorTest.java index db6df17a7..650d3191e 100644 --- a/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/src/test/java/com/a/eye/skywalking/plugin/jedis/v2/JedisMethodInterceptorTest.java +++ b/skywalking-sniffer/skywalking-sdk-plugin/jedis-2.x-plugin/src/test/java/com/a/eye/skywalking/plugin/jedis/v2/JedisMethodInterceptorTest.java @@ -126,7 +126,7 @@ public class JedisMethodInterceptorTest { } private void assertRedisSpan(Span span) { - assertThat(span.getOperationName(), is("set")); + assertThat(span.getOperationName(), is("Jedis/set")); assertThat(Tags.PEER_HOST.get(span), is("127.0.0.1")); assertThat(Tags.PEER_PORT.get(span), is(6379)); assertThat(Tags.COMPONENT.get(span), is("Redis")); @@ -136,7 +136,7 @@ public class JedisMethodInterceptorTest { } private void assertRedisSpan(Span span, String exceptedPeerHosts){ - assertThat(span.getOperationName(), is("set")); + assertThat(span.getOperationName(), is("Jedis/set")); assertThat(Tags.PEERS.get(span), is(exceptedPeerHosts)); assertThat(Tags.COMPONENT.get(span), is("Redis")); assertThat(Tags.DB_STATEMENT.get(span), is("set OperationKey"));