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

[GitHub] [hudi] nsivabalan commented on a change in pull request #4497: [HUDI-3147] Create pushgateway client based on port

nsivabalan commented on a change in pull request #4497:
URL: https://github.com/apache/hudi/pull/4497#discussion_r779678339



##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metrics/prometheus/PushGatewayReporter.java
##########
@@ -51,17 +53,30 @@ protected PushGatewayReporter(MetricRegistry registry,
                                 TimeUnit rateUnit,
                                 TimeUnit durationUnit,
                                 String jobName,
-                                String address,
+                                String serverHost,
+                                int serverPort,
                                 boolean deleteShutdown) {
     super(registry, "hudi-push-gateway-reporter", filter, rateUnit, durationUnit);
     this.jobName = jobName;
     this.deleteShutdown = deleteShutdown;
     collectorRegistry = new CollectorRegistry();
     metricExports = new DropwizardExports(registry);
-    pushGateway = new PushGateway(address);
+    pushGateway = createPushGatewayClient(serverHost, serverPort);
     metricExports.register(collectorRegistry);
   }
 
+  private PushGateway createPushGatewayClient(String serverHost, int serverPort) {
+    if (serverPort == 443) {
+      try {
+        return new PushGateway(new URL("https://" + serverHost));

Review comment:
       @t0il3ts0ap : Did you test this patch? 
   don't we need 
   ```
   new URL("https://" + serverHost + ":" + serverPort));
   ```




-- 
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@hudi.apache.org

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