eolivelli commented on a change in pull request #306:
URL: https://github.com/apache/pulsar-manager/pull/306#discussion_r444737972



##########
File path: 
src/main/java/org/apache/pulsar/manager/service/impl/BrokerStatsServiceImpl.java
##########
@@ -131,7 +132,26 @@ private void scheduleCollectStats() {
             clusterLists.forEach((clusterMap) -> {
                 String cluster = (String) clusterMap.get("cluster");
                 Pair<String, String> envCluster = Pair.of(env.getName(), 
cluster);
-                collectStatsServiceUrls.put(envCluster, (String) 
clusterMap.get("serviceUrl"));
+                String webServiceUrl = (String) clusterMap.get("serviceUrl");
+                if (webServiceUrl.contains(",")) {
+                    String[] webServiceUrlList = webServiceUrl.split(",");
+                    if (StringUtils.isNotBlank(pulsarJwtToken)) {
+                        header.put("Authorization", String.format("Bearer %s", 
pulsarJwtToken));
+                    }
+                    for (String url : webServiceUrlList) {
+                        if (!url.contains("http://";)) {
+                            url = "http://"; + url;
+                        }
+                        String httpTestResult = HttpUtil.doGet( url + 
"/metrics", header);

Review comment:
       Sorry for late reply.
   It looks like we are going to call metrics endpoint twice.
   Isn't there any way to download such data only once?
   
   Like pushing down the list of endpoints to downstream processing?
   




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

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


Reply via email to