File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
apm-sniffer/apm-sdk-plugin
mysql-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/v5/define
mysql-6.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/v6/define Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ Release Notes.
2323* Support keep trace profiling when cross-thread.
2424* Fix unexpected whitespace of the command catalogs in several Redis plugins.
2525* Fix a thread leak in ` SamplingService ` when updated sampling policy in the runtime.
26+ * Support MySQL plugin tracing SQL parameters when useServerPrepStmts
2627
2728#### Documentation
2829* Update docs of Tracing APIs, reorganize the API docs into six parts.
Original file line number Diff line number Diff line change 1919package org .apache .skywalking .apm .plugin .jdbc .mysql .v5 .define ;
2020
2121import static net .bytebuddy .matcher .ElementMatchers .named ;
22- import static org .apache .skywalking .apm .agent .core .plugin .match .NameMatch .byName ;
2322
2423import org .apache .skywalking .apm .agent .core .plugin .interceptor .ConstructorInterceptPoint ;
2524import org .apache .skywalking .apm .agent .core .plugin .interceptor .InstanceMethodsInterceptPoint ;
2625import org .apache .skywalking .apm .agent .core .plugin .match .ClassMatch ;
26+ import org .apache .skywalking .apm .agent .core .plugin .match .MultiClassNameMatch ;
2727import org .apache .skywalking .apm .plugin .jdbc .mysql .Constants ;
2828
2929import net .bytebuddy .description .method .MethodDescription ;
@@ -38,6 +38,7 @@ public class PreparedStatementInstrumentation extends AbstractMysqlInstrumentati
3838
3939 private static final String SERVICE_METHOD_INTERCEPTOR = Constants .PREPARED_STATEMENT_EXECUTE_METHODS_INTERCEPTOR ;
4040 public static final String MYSQL_PREPARED_STATEMENT_CLASS_NAME = "com.mysql.jdbc.PreparedStatement" ;
41+ public static final String MYSQL_SERVER_PREPARED_STATEMENT_CLASS_NAME = "com.mysql.jdbc.ServerPreparedStatement" ;
4142
4243 @ Override
4344 public final ConstructorInterceptPoint [] getConstructorsInterceptPoints () {
@@ -70,7 +71,7 @@ public boolean isOverrideArgs() {
7071
7172 @ Override
7273 protected ClassMatch enhanceClass () {
73- return byName (MYSQL_PREPARED_STATEMENT_CLASS_NAME );
74+ return MultiClassNameMatch . byMultiClassMatch (MYSQL_PREPARED_STATEMENT_CLASS_NAME , MYSQL_SERVER_PREPARED_STATEMENT_CLASS_NAME );
7475 }
7576
7677}
Original file line number Diff line number Diff line change 2323import org .apache .skywalking .apm .agent .core .plugin .interceptor .ConstructorInterceptPoint ;
2424import org .apache .skywalking .apm .agent .core .plugin .interceptor .InstanceMethodsInterceptPoint ;
2525import org .apache .skywalking .apm .agent .core .plugin .match .ClassMatch ;
26+ import org .apache .skywalking .apm .agent .core .plugin .match .MultiClassNameMatch ;
2627
2728import static net .bytebuddy .matcher .ElementMatchers .named ;
28- import static org .apache .skywalking .apm .agent .core .plugin .match .NameMatch .byName ;
2929
3030/**
3131 * {@link PreparedStatementInstrumentation} define that the mysql-6.x plugin intercepts the following methods in the
@@ -36,6 +36,7 @@ public class PreparedStatementInstrumentation extends AbstractMysqlInstrumentati
3636
3737 private static final String SERVICE_METHOD_INTERCEPTOR = org .apache .skywalking .apm .plugin .jdbc .mysql .Constants .PREPARED_STATEMENT_EXECUTE_METHODS_INTERCEPTOR ;
3838 public static final String MYSQL6_PREPARED_STATEMENT_CLASS_NAME = "com.mysql.cj.jdbc.PreparedStatement" ;
39+ public static final String MYSQL6_SERVER_PREPARED_STATEMENT_CLASS_NAME = "com.mysql.cj.jdbc.ServerPreparedStatement" ;
3940
4041 @ Override
4142 public final ConstructorInterceptPoint [] getConstructorsInterceptPoints () {
@@ -68,7 +69,7 @@ public boolean isOverrideArgs() {
6869
6970 @ Override
7071 protected ClassMatch enhanceClass () {
71- return byName (MYSQL6_PREPARED_STATEMENT_CLASS_NAME );
72+ return MultiClassNameMatch . byMultiClassMatch (MYSQL6_PREPARED_STATEMENT_CLASS_NAME , MYSQL6_SERVER_PREPARED_STATEMENT_CLASS_NAME );
7273 }
7374
7475}
You can’t perform that action at this time.
0 commit comments