Skip to content

Commit 37a880e

Browse files
authored
[fix] In the higher version of mysql-connector-java 8x, there is an error in the value of db.instance. (#427)
1 parent 80ff07b commit 37a880e

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Release Notes.
1919
* Add [Micrometer Observation](https://github.com/micrometer-metrics/micrometer/) support
2020
* Add tags `mq.message.keys` and `mq.message.tags` for RocketMQ producer span
2121
* Clean the trace context which injected into Pulsar MessageImpl after the instance recycled
22+
* Fix In the higher version of mysql-connector-java 8x, there is an error in the value of db.instance.
2223

2324
#### Documentation
2425

apm-sniffer/apm-sdk-plugin/mysql-8.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/jdbc/mysql/v8/define/ConnectionInstrumentation.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,22 @@ public String getMethodsInterceptor() {
115115
return org.apache.skywalking.apm.plugin.jdbc.mysql.Constants.SET_CATALOG_INTERCEPTOR;
116116
}
117117

118+
@Override
119+
public boolean isOverrideArgs() {
120+
return false;
121+
}
122+
},
123+
new InstanceMethodsInterceptPoint() {
124+
@Override
125+
public ElementMatcher<MethodDescription> getMethodsMatcher() {
126+
return named("setDatabase");
127+
}
128+
129+
@Override
130+
public String getMethodsInterceptor() {
131+
return org.apache.skywalking.apm.plugin.jdbc.mysql.Constants.SET_CATALOG_INTERCEPTOR;
132+
}
133+
118134
@Override
119135
public boolean isOverrideArgs() {
120136
return false;

0 commit comments

Comments
 (0)