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 05:46:02 UTC

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

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


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/web/WebService.java:
##########
@@ -263,7 +264,14 @@ public void addServlet(String path, ServletHolder servletHolder, boolean require
             });
         }
         filterInitializer.addFilters(context, requiresAuthentication);
-        handlers.add(context);
+        // Enable compress on /metrics endpoint
+        if (path.equals("/metrics") && pulsar.getConfiguration().isCompressOutputMetricsInPrometheus()) {

Review Comment:
   Great point @asafm.



##########
conf/broker.conf:
##########
@@ -1380,6 +1380,9 @@ metricsServletTimeoutMs=30000
 # Enable or disable broker bundles metrics. The default value is false.
 exposeBundlesMetricsInPrometheus=false
 
+# Enable or disable compress output metrics in prometheus. The default value is false.
+compressOutputMetricsInPrometheus=false

Review Comment:
   Can we make it configurable which type of compression to use instead of making this a boolean?



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