diff --git a/CHANGES.md b/CHANGES.md index 9f95405d7..cda54595a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ Release Notes. * Refactor pipeline in jedis-plugin. * Enhance kotlin coroutine plugin for stack tracing. * Add plugin to support ClickHouse JDBC driver (0.3.2.*). +* Fix OracleURLParser ignoring actual port when :SID is absent. #### Documentation * Update docs of Tracing APIs, reorganize the API docs into six parts. diff --git a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/connectionurl/parser/OracleURLParser.java b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/connectionurl/parser/OracleURLParser.java index 470cf6e5b..9c14d40ce 100644 --- a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/connectionurl/parser/OracleURLParser.java +++ b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/connectionurl/parser/OracleURLParser.java @@ -27,8 +27,8 @@ import org.apache.skywalking.apm.util.StringUtil; /** * {@link OracleURLParser} presents that how to parse oracle connection url. *
- * Note: {@link OracleURLParser} can parse the commons connection url. the commons connection url is of the form:
- * jdbc:oracle:(drivertype):@(database),the other the form of connection url cannot be parsed success.
+ * Note: {@link OracleURLParser} can parse the commons/TNS connection url. the commons connection url is of the form:
+ * jdbc:oracle:(drivertype):@(database), the other the form of connection url cannot be parsed successfully.
*/
public class OracleURLParser extends AbstractURLParser {
@@ -49,7 +49,14 @@ public class OracleURLParser extends AbstractURLParser {
} else {
hostLabelStartIndex = url.indexOf("@") + 1;
}
- int hostLabelEndIndex = url.lastIndexOf(":");
+
+ String urlTrimmed = url.substring(hostLabelStartIndex);
+
+ // When /service/