You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/10/23 01:49:10 UTC

[GitHub] [skywalking] aderm commented on a change in pull request #3618: add postgresql plugin agent sql param show

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

 ##########
 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:
   @wu-sheng @kezhenxu94 ACK,i will 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:
users@infra.apache.org


With regards,
Apache Git Services