adutra commented on code in PR #4792:
URL: https://github.com/apache/polaris/pull/4792#discussion_r3421136925


##########
runtime/service/src/test/java/org/apache/polaris/service/test/TestMetricsUtil.java:
##########
@@ -36,23 +37,25 @@
 /** Utils for working with metrics in tests */
 public class TestMetricsUtil {
 
-  public static Map<String, MetricFamily> fetchMetrics(Client client, URI 
baseManagementUri) {
-    Response response = 
client.target(baseManagementUri.resolve("q/metrics")).request().get();
-    if (response.getStatus() == Status.MOVED_PERMANENTLY.getStatusCode()) {
-      response = client.target(response.getLocation()).request().get();
+  public static Map<String, MetricFamily> fetchMetrics(URI baseManagementUri) {
+    try (Client client = ClientBuilder.newBuilder().build()) {
+      Response response = 
client.target(baseManagementUri.resolve("q/metrics")).request().get();
+      if (response.getStatus() == Status.MOVED_PERMANENTLY.getStatusCode()) {
+        response = client.target(response.getLocation()).request().get();
+      }

Review Comment:
   Fixed.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to