feedback-to-code/mozzarella huggingface dataset:
Repository: pinpoint-apm/pinpoint
Issue: Fix execution failed networktest.sh script
Labels: bug

#### Description
Corrects failures when invoking a collector configured with a load balancer.

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/tools/src/main/java/com/navercorp/pinpoint/tools/network/UDPChecker.java b/tools/src/main/java/com/navercorp/pinpoint/tools/network/UDPChecker.java
index 0e8886af9c54..068a2d828850 100644
--- a/tools/src/main/java/com/navercorp/pinpoint/tools/network/UDPChecker.java
+++ b/tools/src/main/java/com/navercorp/pinpoint/tools/network/UDPChecker.java
@@ -41,9 +41,9 @@ protected boolean check(InetSocketAddress address) throws IOException {
     protected boolean check(InetSocketAddress address, byte[] requestData, byte[] expectedResponseData) {
         DatagramSocket socket = null;
         try {
-            socket = createSocket(address);
+            socket = createSocket();
 
-            write(socket, requestData);
+            write(socket, requestData, address);
             byte[] responseData = read(socket, expectedResponseData.length);
 
             return Arrays.equals(expectedResponseData, responseData);
@@ -57,6 +57,13 @@ protected boolean check(InetSocketAddress address, byte[] requestData, byte[] ex
         return false;
     }
 
+    private DatagramSocket createSocket() throws IOException {
+        DatagramSocket socket = new DatagramSocket();
+
+        socket.setSoTimeout(3000);
+        return socket;
+    }
+
     private DatagramSocket createSocket(InetSocketAddress socketAddress) throws IOException {
         DatagramSocket socket = new DatagramSocket();
         socket.connect(socketAddress);
@@ -65,8 +72,8 @@ private DatagramSocket createSocket(InetSocketAddress socketAddress) throws IOEx
         return socket;
     }
 
-    private void write(DatagramSocket socket, byte[] requestData) throws IOException {
-        DatagramPacket datagramPacket = new DatagramPacket(requestData, requestData.length);
+    private void write(DatagramSocket socket, byte[] requestData, InetSocketAddress address) throws IOException {
+        DatagramPacket datagramPacket = new DatagramPacket(requestData, requestData.length, address);
         socket.send(datagramPacket);
     }
 


Test patch:
Repository: pinpoint-apm/pinpoint
Issue: Fix Thrift plugin integration tests to run on 0.10.x
Labels: enhancement
module:plugin

#### Description
~~Thrift 0.10.0 is out with some internal changes that is currently not compatible with the thrift plugin.
Thrift plugin needs to be updated to support this.~~
Thrift 0.10.0 introduces breaking changes to auto-generated `AsyncIface` methods, which requires regenerating test service to run on libthrift 0.10.0.
The internals have not been changed as far as tracing with Thrift plugin is concerned. Only integration tests need fixing.

Issue comments:
Skipping 0.10.x integration tests due to conflict in pinpoint agent's internal thrift version.
Thrift plugin currently works with libthrift 0.10.0.
Reopening issue to see if progress can be made here now that pinpoint's thrift version is upgraded to 0.10.0 (#2725)
Keep testing libthrift 0.9.x for regression.
Above change breaks all IT as giving libthrift test scope makes libthrift unavailable at runtime, should revert back to testing 0.10.x.

Pull request review comments:

Patch that resolved the issue:
diff --git a/agent/pom.xml b/agent/pom.xml
index 626a559b26fb..b134b426d37f 100644
--- a/agent/pom.xml
+++ b/agent/pom.xml
@@ -194,6 +194,13 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.thrift</groupId>
+            <artifactId>libthrift</artifactId>
+            <version>0.9.3</version>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.activemq</groupId>
             <artifactId>activemq-all</artifactId>


Test patch:
diff --git a/agent/src/test/resources/thrift/Echo.thrift b/agent/src/test/resources/thrift/Echo.thrift
new file mode 100644
index 000000000000..c8eed567f3cb
--- /dev/null
+++ b/agent/src/test/resources/thrift/Echo.thrift
@@ -0,0 +1,6 @@
+namespace java com.navercorp.pinpoint.plugin.thrift.dto
+
+service EchoService
+{
+    string echo(1:string message)
+}
\ No newline at end of file
Repository: pinpoint-apm/pinpoint
Issue: Change required maven version to 3.5.3

#### Description
Have maven wrapper use 3.5.3 binary.

Issue comments:
Reopening to update maven wrapper as well to 0.4.0.

Pull request review comments:

Patch that resolved the issue:
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
index 6637cedb28e9..33232336d09e 100644
--- a/.mvn/wrapper/maven-wrapper.properties
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -1,1 +1,1 @@
-distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
\ No newline at end of file
+distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.3/apache-maven-3.5.3-bin.zip
\ No newline at end of file


Test patch:
Repository: pinpoint-apm/pinpoint
Issue: Trace https calls made via JDK http connector
Labels: enhancement
module:plugin

#### Description
Https calls are not being traced when using JDK http connector ([details](https://github.com/naver/pinpoint/issues/4072#issuecomment-387960147)).

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/plugins/jdk-http/src/main/java/com/navercorp/pinpoint/plugin/jdk/http/JdkHttpPlugin.java b/plugins/jdk-http/src/main/java/com/navercorp/pinpoint/plugin/jdk/http/JdkHttpPlugin.java
index ffaf679c4977..c842f96f8851 100644
--- a/plugins/jdk-http/src/main/java/com/navercorp/pinpoint/plugin/jdk/http/JdkHttpPlugin.java
+++ b/plugins/jdk-http/src/main/java/com/navercorp/pinpoint/plugin/jdk/http/JdkHttpPlugin.java
@@ -63,6 +63,19 @@ public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, Strin
                 return target.toBytecode();
             }
         });
+
+        transformTemplate.transform("sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection", new TransformCallback() {
+            @Override
+            public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {
+                InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);
+                final InstrumentMethod connectMethod = target.getDeclaredMethod("connect");
+                if (connectMethod == null) {
+                    return null;
+                }
+                connectMethod.addScopedInterceptor("com.navercorp.pinpoint.plugin.jdk.http.interceptor.HttpURLConnectionInterceptor", "HttpURLConnection");
+                return target.toBytecode();
+            }
+        });
     }
 
     @Override


Test patch:
Repository: pinpoint-apm/pinpoint
Issue: Upgrade hbase client version
Labels: enhancement
module:project-common

#### Description
The current hbase client (1.2.4) does not work on Java 9+ due to https://issues.apache.org/jira/browse/HBASE-17944.
Fix was introduced for 1.2.6, so a version up is required.



Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/pom.xml b/pom.xml
index 3beca5cdc59f..fa58baee62a6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -358,7 +358,7 @@
             <dependency>
                 <groupId>org.apache.hbase</groupId>
                 <artifactId>hbase-shaded-client</artifactId>
-                <version>1.2.4</version>
+                <version>1.2.6.1</version>
             </dependency>
 
             <dependency>


Test patch:
Repository: pinpoint-apm/pinpoint
Issue: Change default agent sampling rate to 100%
Labels: module:agent
configuration

#### Description
Current pinpoint agent binary has `profiler.sampling.rate` set to 20. This caused too much confusion as only 1 out of 20 requests were being traced out of the box.
Changing this value to 1 would make it far less confusing.
If overhead becomes an issue, there is still the *pinpoint-real-env-lowoverhead-sample.config* to refer to.

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/agent/src/assembly/distribution.xml b/agent/src/assembly/distribution.xml
index 8b7b28fadd1c..33de45f8385c 100644
--- a/agent/src/assembly/distribution.xml
+++ b/agent/src/assembly/distribution.xml
@@ -26,10 +26,6 @@
     <includeBaseDirectory>false</includeBaseDirectory>
 
     <fileSets>
-        <fileSet>
-            <directory>${basedir}/src/main/resources</directory>
-            <outputDirectory></outputDirectory>
-        </fileSet>
         <fileSet>
             <directory>${basedir}/src/main/resources-${env}</directory>
             <outputDirectory></outputDirectory>
diff --git a/agent/src/main/resources-release/pinpoint.config b/agent/src/main/resources-release/pinpoint.config
index 4db5fc799f37..7bcc34f06207 100644
--- a/agent/src/main/resources-release/pinpoint.config
+++ b/agent/src/main/resources-release/pinpoint.config
@@ -46,7 +46,7 @@ profiler.jvm.stat.collect.detailed.metrics=true
 profiler.sampling.enable=true
 
 # 1 out of n transactions will be sampled where n is the rate. (20: 5%)
-profiler.sampling.rate=20
+profiler.sampling.rate=1
 
 # Allow buffering when flushing span to IO.
 profiler.io.buffering.enable=true


Test patch:
Repository: pinpoint-apm/pinpoint
Issue: There are typo in doc/per-request_feature_guide.md

<!--
    Please be as detailed as possible so that we can help answer your question as quickly as possible.
-->
There are typo in doc/per-request_feature_guide.md

line 288: `로그 메세지` -> `log message`  for consistency
line 289: `출려된` -> `출력된` typo
line 511: `추가되야` -> `추가돼야` typo

Also other spacing grammer errors exist.  
May I correct typo and send pull request?  
I already signed CLA.

Issue comments:
Hello, @bbvch13531 

Of course, Go ahead. Let us know when you finish
Hi @RoySRose, Thank you for your kind answer. 😃 
I send PR #4699. 
PTAL!

Pull request review comments:

Patch that resolved the issue:
diff --git a/doc/per-request_feature_guide.md b/doc/per-request_feature_guide.md
index 0aff94bcb84a..6731d35e4d45 100644
--- a/doc/per-request_feature_guide.md
+++ b/doc/per-request_feature_guide.md
@@ -279,18 +279,18 @@ For details in how the log buttons are generated, please refer to Pinpoint Web
 
 ### 1. 기능 설명
 
-Pinpoint에서는 log message를 request 단위로 구분할 수 있도록 log message 에 추가정보를 저장 해준다.
+Pinpoint에서는 log message를 request 단위로 구분할 수 있도록 log message 에 추가정보를 저장해준다.
 
 다수의 요청을 처리하는 tomcat을 사용할 경우 로그 파일을 보면 시간순으로 출력된 로그를 확인할 수 있다.
 그러나 동시에 요청된 다수의 request 각각에 대한 로그를 구분 해서 볼 수 없다.
-예를 들어 로그에서 exception message가 출력됐을때 그 exception이 발생한 request의 모든 log를 확인 하기 힘들다.
+예를 들어 로그에서 exception message가 출력됐을 때 그 exception이 발생한 request의 모든 log를 확인하기 힘들다.
 
-Pinpoint는 로그 메세지 마다 request와 연관된 정보(transactionId, spanId)를 MDC에 넣어줘서 request 단위로 log message를 구분할 수 있도록 해준다.
-로그에 출력된 transactionId는 pinpoint web의 transaction List 화면에 출려된 transactionId와 일치한다.
+Pinpoint는 log message 마다 request와 연관된 정보(transactionId, spanId)를 MDC에 넣어줘서 request 단위로 log message를 구분할 수 있도록 해준다.
+로그에 출력된 transactionId는 pinpoint web의 transaction List 화면에 출력된 transactionId와 일치한다.
 
 구체적으로 예를 들어보자.
-Pinpoint를 사용하지 않았을때 exception이 발생했을 경우 로그 메시지를 살펴 보자.
-요청된 다수의 request 각각을 구분하여 로그를 확인 할 수가 없다.
+Pinpoint를 사용하지 않았을 때 exception이 발생했을 경우 로그 메시지를 살펴 보자.
+요청된 다수의 request 각각을 구분하여 로그를 확인할 수가 없다.
 
 ex) Without Pinpoint
 ```
@@ -391,7 +391,7 @@ ex) With Pinpoint
 
 **2-1 Pinpoint agent 설정**
 
-Pinpoint를 사용하려면 Pinpoint agent 설정파일(Pinpoint.config)의 logging 설정 값을 true로 변경해야한다.
+Pinpoint를 사용하려면 Pinpoint agent 설정파일(Pinpoint.config)의 logging 설정 값을 true로 변경해야 한다.
 사용하는 logging 라이브러리에 해당하는 설정값만 true로 변경하면 된다.
 아래 설정에 대한 예시가 있다.
 
@@ -508,7 +508,7 @@ log.button.name=log
 **step 3**
 pinpoint 1.5 이후 버전부터 log 기록 여부에 따라 log 버튼의 활성화가 결정되도록 개선 됐기 때문에
 당신이 사용하는 logging appender의 로깅 메소드에 logging 여부를 저장하는 interceptor를 추가하는 플러그인을 개발해야 한다.
-플러그인 개발 방법은 다음 링크를 참고하면 된다([Link](https://github.com/naver/pinpoint-plugin-sample)). interceptor 로직이 추가되야 하는 위치는 appender class 내에 LoggingEvent 객체의 데이터를 이용하여 로깅을 하는 메소드다.
+플러그인 개발 방법은 다음 링크를 참고하면 된다([Link](https://github.com/naver/pinpoint-plugin-sample)). interceptor 로직이 추가돼야 하는 위치는 appender class 내에 LoggingEvent 객체의 데이터를 이용하여 로깅을 하는 메소드다.
 아래는 interceptor 예제이다.
 ```
 public class AppenderInterceptor implements AroundInterceptor0 {


Test patch:
Repository: pinpoint-apm/pinpoint
Issue: Add support for MySQL java connector 8+
Labels: enhancement
module:plugin

#### Description
Add trace support for MySQL java connector 8.

related issue - #4958 

Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/plugins/mysql-jdbc/src/main/java/com/navercorp/pinpoint/plugin/jdbc/mysql/MySqlPlugin.java b/plugins/mysql-jdbc/src/main/java/com/navercorp/pinpoint/plugin/jdbc/mysql/MySqlPlugin.java
index c40113ddd0c8..ed952dad2f90 100644
--- a/plugins/mysql-jdbc/src/main/java/com/navercorp/pinpoint/plugin/jdbc/mysql/MySqlPlugin.java
+++ b/plugins/mysql-jdbc/src/main/java/com/navercorp/pinpoint/plugin/jdbc/mysql/MySqlPlugin.java
@@ -93,6 +93,10 @@ public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, Strin
                     // 6.0.4+
                     constructor_6_X = target.getConstructor("com.mysql.cj.core.conf.url.HostInfo");
                 }
+                if (constructor_6_X == null) {
+                    // 8.x+
+                    constructor_6_X = target.getConstructor("com.mysql.cj.conf.HostInfo");
+                }
                 if (constructor_6_X != null) {
                     target.addGetter("com.navercorp.pinpoint.plugin.jdbc.mysql.interceptor.getter.OrigHostToConnectToGetter", "origHostToConnectTo");
                     target.addGetter("com.navercorp.pinpoint.plugin.jdbc.mysql.interceptor.getter.OrigPortToConnectToGetter", "origPortToConnectTo");
@@ -214,6 +218,9 @@ public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, Strin
         transformTemplate.transform("com.mysql.jdbc.PreparedStatement", transformCallback);
         // 6.x+
         transformTemplate.transform("com.mysql.cj.jdbc.PreparedStatement", transformCallback);
+        // 8.0.11+
+        transformTemplate.transform("com.mysql.cj.jdbc.ClientPreparedStatement", transformCallback);
+        transformTemplate.transform("com.mysql.cj.jdbc.ServerPreparedStatement", transformCallback);
     }
 
     private void addCallableStatementTransformer(final MySqlConfig config) {


Test patch:
Repository: pinpoint-apm/pinpoint
Issue: Fixes a problem where Kafka Plugin doesn't work in certain situations
Labels: bug
module:plugin

Fixes a problem where Kafka Plugin doesn't work in certain situations

#### description 
If Sampling is not set to 1, Kafka Plugin may not handle traces properly, which may cause problems.

Issue comments:
resolved via #6149 #6154 

Pull request review comments:

Patch that resolved the issue:
diff --git a/plugins/kafka/src/main/java/com/navercorp/pinpoint/plugin/kafka/interceptor/ConsumerRecordEntryPointInterceptor.java b/plugins/kafka/src/main/java/com/navercorp/pinpoint/plugin/kafka/interceptor/ConsumerRecordEntryPointInterceptor.java
index 0c8604f14bd6..b0ca62488086 100644
--- a/plugins/kafka/src/main/java/com/navercorp/pinpoint/plugin/kafka/interceptor/ConsumerRecordEntryPointInterceptor.java
+++ b/plugins/kafka/src/main/java/com/navercorp/pinpoint/plugin/kafka/interceptor/ConsumerRecordEntryPointInterceptor.java
@@ -148,7 +148,7 @@ Trace createTrace0(TraceContext traceContext, ConsumerRecord consumerRecord) {
                     if (isDebug) {
                         logger.debug("TraceID not exist. camSampled is false. skip trace.");
                     }
-                    return null;
+                    return trace;
                 }
             }
 


Test patch:
Repository: pinpoint-apm/pinpoint
Issue: I found a bug in  DefaultProfilerConfig.java  
Labels: bug
module:agent

problem:  pinpoint.config's properties ``` profiler.include``` not work

so I review the code ,and find something maybe wrong 

#### What version of pinpoint are you using?
master

``` java
   //. file:  https://github.com/pinpoint-apm/pinpoint/blob/master/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/config/DefaultProfilerConfig.java
  // position line 365 to 375
    @Value("${profiler.include}")
    void setProfilableClassFilter(String profilableClass) {
        // TODO have to remove
        // profile package included in order to test "call stack view".
        // this config must not be used in service environment because the size of  profiling information will get heavy.
        // We may need to change this configuration to regular expression.
        if (profilableClass != null && profilableClass.isEmpty()) {
            this.profilableClassFilter = new ProfilableClassFilter(profilableClass);
        } else {
            this.profilableClassFilter = new SkipFilter<String>();
        }
    }
```
```      if (profilableClass != null && profilableClass.isEmpty()) { ```   this line
the condition maybe is ```profilableClass != null && !profilableClass.isEmpty() ```, or this will not work forever



thank a lot



Issue comments:
Yes. It looks like it's a bug. Any suggestions?
> Yes. It looks like it's a bug. Any suggestions?

please fix it like this: ```profilableClass != null && !profilableClass.isEmpty() ```
I already tested in local env 
Also need I create a pr for this?

Pull request review comments:

Patch that resolved the issue:
diff --git a/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/config/DefaultProfilerConfig.java b/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/config/DefaultProfilerConfig.java
index 0d70dcd66d74..750969f65436 100644
--- a/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/config/DefaultProfilerConfig.java
+++ b/bootstrap-core/src/main/java/com/navercorp/pinpoint/bootstrap/config/DefaultProfilerConfig.java
@@ -368,7 +368,7 @@ void setProfilableClassFilter(String profilableClass) {
         // profile package included in order to test "call stack view".
         // this config must not be used in service environment because the size of  profiling information will get heavy.
         // We may need to change this configuration to regular expression.
-        if (profilableClass != null && profilableClass.isEmpty()) {
+        if (profilableClass != null && !profilableClass.isEmpty()) {
             this.profilableClassFilter = new ProfilableClassFilter(profilableClass);
         } else {
             this.profilableClassFilter = new SkipFilter<String>();


Test patch:
Repository: pinpoint-apm/pinpoint
Issue: Change position and url Monitor site link in inspector page
Labels: enhancement


Issue comments:

Pull request review comments:

Patch that resolved the issue:
diff --git a/web/src/main/java/com/navercorp/pinpoint/web/view/ApplicationAgentListSerializer.java b/web/src/main/java/com/navercorp/pinpoint/web/view/ApplicationAgentListSerializer.java
index a4dc85753f4d..2f8e1f83c78c 100644
--- a/web/src/main/java/com/navercorp/pinpoint/web/view/ApplicationAgentListSerializer.java
+++ b/web/src/main/java/com/navercorp/pinpoint/web/view/ApplicationAgentListSerializer.java
@@ -66,9 +66,9 @@ private void writeAgentList(JsonGenerator jgen, List<AgentInfoBo> agentList, Mat
             jgen.writeNumberField("endStatus", agentInfoBo.getEndStatus());
             jgen.writeObjectField("serverMetaData", agentInfoBo.getServerMetaData());
             
-            ServerMatcher serverMatcher = matcherGroup.match(agentInfoBo.getIp());
+            ServerMatcher serverMatcher = matcherGroup.match(agentInfoBo.getHostName());
             jgen.writeStringField("linkName", serverMatcher.getLinkName());
-            jgen.writeStringField("linkURL", serverMatcher.getLink(agentInfoBo.getIp()));
+            jgen.writeStringField("linkURL", serverMatcher.getLink(agentInfoBo.getHostName()));
             
             jgen.writeEndObject();
         }
diff --git a/web/src/main/webapp/views/agentInfoMain.html b/web/src/main/webapp/views/agentInfoMain.html
index 083f736cb534..af9409c4719e 100644
--- a/web/src/main/webapp/views/agentInfoMain.html
+++ b/web/src/main/webapp/views/agentInfoMain.html
@@ -25,14 +25,14 @@ <h3>Information</h3>
                     </tr>
                     <tr>
                         <td class="text-right"><strong>Hostname</strong></td>
-                        <td class="text-left">{{info.hostName}}</td>
+                        <td class="text-left">{{info.hostName}}&nbsp;<a ng-if="info.linkName" class="btn btn-default btn-xs" href="{{info.linkURL}}" target="_blank" title="System resource monitoring site">{{info.linkName}}</a></td>
                         <td class="text-right"><strong>JVM GC Type</strong></td>
                         <td class="text-left">{{info.jvmGcType}}</td>
                     </tr>
                     <tr>
                         <td class="text-right"><strong>IP</strong></td>
                         <td class="text-left">
-                            <div>{{info.ip}}&nbsp;<a ng-if="info.linkName" class="btn btn-default btn-xs" href="{{info.linkURL}}" target="_blank" title="System resource monitoring site">{{info.linkName}}</a></div>
+                            <div>{{info.ip}}</div>
                         </td>
                         <td class="text-right"><strong>Start Time</strong></td>
                         <td class="text-left">{{agent.startTime | date:'yyyy-MM-dd HH:mm:ss Z'}}</td>


Test patch: