You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/01 06:28:23 UTC

[GitHub] [pulsar] xuesongxs commented on a diff in pull request #16888: [improve][broker] Add gzip compression support for /metrics endpoint

xuesongxs commented on code in PR #16888:
URL: https://github.com/apache/pulsar/pull/16888#discussion_r960263732


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/web/WebServiceTest.java:
##########
@@ -349,6 +350,36 @@ public void testBrokerReady() throws Exception {
         assertEquals(res.getResponseBody(), "ok");
     }
 
+    @Test
+    public void testCompressOutputMetricsInPrometheus() throws Exception {
+        compressOutputMetricsInPrometheus = true;
+        setupEnv(true, "1.0", true, false, false, false, -1, false);
+
+        String metricsUrl = pulsar.getWebServiceAddress() + "/metrics";
+
+        @Cleanup
+        AsyncHttpClient metricsClient = new DefaultAsyncHttpClient();
+        Response metricsRes = metricsClient.prepareGet(metricsUrl).execute().get();

Review Comment:
   ```
           HttpClient client = new HttpClient();
           client.start();
           ContentResponse response = client.GET(metricsUrl);
           assertEquals(response.getHeaders().get("Content-Encoding"), "gzip");
           client.stop();
   ```
   This code should be used to check.



-- 
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: commits-unsubscribe@pulsar.apache.org

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