soreana commented on code in PR #7007:
URL: https://github.com/apache/cloudstack/pull/7007#discussion_r1057564129


##########
plugins/integrations/prometheus/src/main/java/org/apache/cloudstack/metrics/PrometheusExporterImpl.java:
##########
@@ -156,7 +157,7 @@ private void addHostMetrics(final List<Item> metricsList, 
final long dcId, final
 
             final String cpuFactor = 
String.valueOf(CapacityManager.CpuOverprovisioningFactor.valueIn(host.getClusterId()));
             final CapacityVO cpuCapacity = 
capacityDao.findByHostIdType(host.getId(), Capacity.CAPACITY_TYPE_CPU);
-            if (cpuCapacity != null) {
+            if (cpuCapacity != null && cpuCapacity.getCapacityState() == 
CapacityState.Enabled) {

Review Comment:
   @benj-n We use a 0 value to check if the host is in maintenance. If you only 
show enabled host entries, it is not possible to track hosts in maintenance. I 
prefer to modify these if statements in a way that shows zero for hosts in 
maintenance mode and the correct value for the reset.
   
   Or, if you want to exclude disabled host entries from Prometheus exporter, 
can you please add a global setting to control that?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to