Skip to content

Commit 13e6c50

Browse files
author
youjie_li
committed
support mongo db.instance tag 、db.collection and AggregateOperation: test scenarios
1 parent 12b4b04 commit 13e6c50

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/define/readOperation/AggregateOperationImplInstrumentation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
2727
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
2828

29-
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
29+
import static net.bytebuddy.matcher.ElementMatchers.any;
3030

3131
public class AggregateOperationImplInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
3232

33-
private static final String ENHANCE_CLASS = "com.mongodb.operation.AggregateOperation";
33+
private static final String ENHANCE_CLASS = "com.mongodb.operation.AggregateOperationImpl";
3434

3535
private static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.mongodb.v3.interceptor.operation.OperationNamespaceConstructInterceptor";
3636

@@ -46,7 +46,7 @@ public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
4646

4747
@Override
4848
public ElementMatcher<MethodDescription> getConstructorMatcher() {
49-
return takesArguments(4);
49+
return any();
5050
}
5151

5252
@Override

apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/define/readOperation/AggregateOperationInstrumentation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
2727
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
2828

29-
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
29+
import static net.bytebuddy.matcher.ElementMatchers.any;
3030

3131
public class AggregateOperationInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
3232

33-
private static final String ENHANCE_CLASS = "com.mongodb.operation.AggregateOperationImpl";
33+
private static final String ENHANCE_CLASS = "com.mongodb.operation.AggregateOperation";
3434

3535
private static final String INTERCEPTOR_CLASS = "org.apache.skywalking.apm.plugin.mongodb.v3.interceptor.operation.OperationNamespaceConstructInterceptor";
3636

@@ -46,7 +46,7 @@ public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
4646

4747
@Override
4848
public ElementMatcher<MethodDescription> getConstructorMatcher() {
49-
return takesArguments(5);
49+
return any();
5050
}
5151

5252
@Override

apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/define/readOperation/CountOperationInstrumentation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
2727
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
2828

29-
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
29+
import static net.bytebuddy.matcher.ElementMatchers.any;
3030

3131
public class CountOperationInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
3232

@@ -46,7 +46,7 @@ public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
4646

4747
@Override
4848
public ElementMatcher<MethodDescription> getConstructorMatcher() {
49-
return takesArguments(2);
49+
return any();
5050
}
5151

5252
@Override

apm-sniffer/apm-sdk-plugin/mongodb-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v4/define/readOperation/AggregateOperationImplInstrumentation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
2727
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
2828

29-
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
29+
import static net.bytebuddy.matcher.ElementMatchers.any;
3030

3131
public class AggregateOperationImplInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
3232

@@ -53,7 +53,7 @@ public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
5353

5454
@Override
5555
public ElementMatcher<MethodDescription> getConstructorMatcher() {
56-
return takesArguments(4);
56+
return any();
5757
}
5858

5959
@Override

apm-sniffer/apm-sdk-plugin/mongodb-4.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v4/define/readOperation/AggregateOperationInstrumentation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.apache.skywalking.apm.agent.core.plugin.match.ClassMatch;
2727
import org.apache.skywalking.apm.agent.core.plugin.match.NameMatch;
2828

29-
import static net.bytebuddy.matcher.ElementMatchers.takesArguments;
29+
import static net.bytebuddy.matcher.ElementMatchers.any;
3030

3131
public class AggregateOperationInstrumentation extends ClassInstanceMethodsEnhancePluginDefine {
3232

@@ -53,7 +53,7 @@ public ConstructorInterceptPoint[] getConstructorsInterceptPoints() {
5353

5454
@Override
5555
public ElementMatcher<MethodDescription> getConstructorMatcher() {
56-
return takesArguments(5);
56+
return any();
5757
}
5858

5959
@Override

0 commit comments

Comments
 (0)