diff --git a/.github/workflows/hypertrace-service/docker-compose.yml b/.github/workflows/hypertrace-service/docker-compose.yml index 09b9d941..ed2c3ca0 100644 --- a/.github/workflows/hypertrace-service/docker-compose.yml +++ b/.github/workflows/hypertrace-service/docker-compose.yml @@ -80,6 +80,8 @@ services: default: aliases: - pinot-controller + - pinot-server + - pinot-broker cpu_shares: 2048 depends_on: kafka-zookeeper: diff --git a/hypertrace-service/src/main/java/org/hypertrace/service/HypertraceUIServerTimerTask.java b/hypertrace-service/src/main/java/org/hypertrace/service/HypertraceUIServerTimerTask.java index fd215ce9..2720dd53 100644 --- a/hypertrace-service/src/main/java/org/hypertrace/service/HypertraceUIServerTimerTask.java +++ b/hypertrace-service/src/main/java/org/hypertrace/service/HypertraceUIServerTimerTask.java @@ -39,6 +39,10 @@ public class HypertraceUIServerTimerTask extends TimerTask { private static final String DEFAULT_PINOT_CONTROLLER_HOST = "pinot-controller"; private static final String PINOT_CONTROLLER_PORT = "pinot.controller_port"; private static final int DEFAULT_PINOT_CONTROLLER_PORT = 9000; + private static final String PINOT_SERVER_HOST = "pinot.server_host"; + private static final String DEFAULT_PINOT_SERVER_HOST = "pinot-server"; + private static final String PINOT_SERVER_PORT = "pinot.server_port"; + private static final int DEFAULT_PINOT_SERVER_PORT = 8097; private final HypertraceUIServer uiServer; private final GatewayServiceBlockingStub client; @@ -51,6 +55,8 @@ public class HypertraceUIServerTimerTask extends TimerTask { private String defaultTenant; private String pinotControllerHost; private int pinotControllerPort; + private String pinotSeverHost; + private int pinotServerPort; private boolean isPinotUp; @@ -69,6 +75,11 @@ public HypertraceUIServerTimerTask(Config appConfig, HypertraceUIServer uiServer pinotControllerPort = appConfig.hasPath(PINOT_CONTROLLER_PORT) ? appConfig.getInt(PINOT_CONTROLLER_PORT) : DEFAULT_PINOT_CONTROLLER_PORT; + pinotSeverHost = appConfig.hasPath(PINOT_SERVER_HOST) ? + appConfig.getString(PINOT_SERVER_HOST) : DEFAULT_PINOT_SERVER_HOST; + pinotServerPort = appConfig.hasPath(PINOT_SERVER_PORT) ? + appConfig.getInt(PINOT_SERVER_PORT) : DEFAULT_PINOT_SERVER_PORT; + this.uiServer = uiServer; this.numRetries = 0; this.defaultTenant = defaultTenant; @@ -163,7 +174,7 @@ private SpansRequest buildSpanRequest() { private boolean executePinotHealthCheck() throws Exception { HttpURLConnection con = null; try { - URL url = new URL(String.format("http://%s:%s/health", pinotControllerHost, pinotControllerPort)); + URL url = new URL(String.format("http://%s:%s/health", pinotSeverHost, pinotServerPort)); con = (HttpURLConnection) url.openConnection(); con.setRequestMethod("GET"); con.setConnectTimeout(timeout * 1000); diff --git a/hypertrace-service/src/main/resources/configs/hypertrace-service/application.conf b/hypertrace-service/src/main/resources/configs/hypertrace-service/application.conf index d7215d6d..a7241a0b 100644 --- a/hypertrace-service/src/main/resources/configs/hypertrace-service/application.conf +++ b/hypertrace-service/src/main/resources/configs/hypertrace-service/application.conf @@ -25,6 +25,10 @@ hypertraceUI { } } pinot { + server_host = "pinot-server" + server_host = ${?PINOT_SERVER_HOST} + server_port = 8097 + server_port = ${?PINOT_SERVER_PORT} controller_host = "pinot-controller" controller_host = ${?PINOT_CONTROLLER_HOST} controller_port = 9000