kezhenxu94 commented on a change in pull request #3618: add postgresql plugin 
agent  sql param show
URL: https://github.com/apache/skywalking/pull/3618#discussion_r336094096
 
 

 ##########
 File path: 
apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/define/StatementEnhanceInfos.java
 ##########
 @@ -73,6 +73,22 @@ public void setParameter(int index, final Object parameter) 
{
         parameters[index] = parameter;
     }
 
+    public String getFullSql() {
+        StringBuilder resultSql = new StringBuilder();
+        int index = 0;
+        int startPos = 0;
+        int findPos = 0;
+        while ((findPos = sql.indexOf("?", startPos)) > 0) {
+            resultSql.append(sql.substring(startPos, findPos));
+            resultSql.append("'");
+            resultSql.append(parameters[index++]);
 
 Review comment:
   My point is not to try to parse the SQL, store the parameters in another tag

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to