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/15 13:59:12 UTC

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

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



##########
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:
       @nsivabalan Srry, couldnt reply in time. Yes this is tested, its not needed.




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