hlteoh37 commented on PR #26387:
URL: https://github.com/apache/flink/pull/26387#issuecomment-2772636121

   Thanks for this contribution @r-sidd ! Library upgrade LGTM.
   
   However, since we only use `Unirest` in one specific place for testing,
   
https://github.com/apache/flink/blob/master/flink-metrics/flink-metrics-prometheus/src/test/java/org/apache/flink/metrics/prometheus/PrometheusReporterTest.java#L248
   
   Maybe we can consider instead removing the dependency on `Unirest` 
altogether by replacing the call `Unirest.get()` with calls to Java's default 
HttpClient instead?
   
   ```
   
       private static final HttpClient HTTP_CLIENT = HttpClient.newHttpClient();
   
       static HttpResponse<String> pollMetrics(int port) throws IOException, 
InterruptedException {
           return HTTP_CLIENT.send(
                   HttpRequest.newBuilder()
                   .uri(URI.create("http://localhost:"; + port + "/metrics"))
                   .GET()
                   .build(), HttpResponse.BodyHandlers.ofString());
       }
   
   ```
   A bit more verbose, but reduces dependencies when needed! 
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to