jackjlli commented on a change in pull request #7126: URL: https://github.com/apache/incubator-pinot/pull/7126#discussion_r664751738
########## File path: pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/TaskMetricsEmitter.java ########## @@ -86,5 +96,15 @@ protected final void runTask() { LOGGER.error("Caught exception while getting metrics for task type {}", taskType, e); } } + + // Emit metric to count the number of online minion instances. + List<String> onlineInstances = _pinotHelixResourceManager.getOnlineInstanceList(); + int onlineMinionInstanceCount = 0; + for (String onlineInstance : onlineInstances) { + if (onlineInstance.startsWith(CommonConstants.Helix.PREFIX_OF_MINION_INSTANCE)) { + onlineMinionInstanceCount++; + } + } + _controllerMetrics.addValueToGlobalGauge(ControllerGauge.ONLINE_MINION_INSTANCES, onlineMinionInstanceCount); Review comment: This metric is emitted only from only one controller, right? Suppose no controller is added or removed, there will be only one controller and it's always that controller which will run the actual logic of this task and emit this metric. -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org