Skip to content

Commit d765e5d

Browse files
Daan HooglandDaanHoogland
authored andcommitted
move comment to javadoc
1 parent 46ee46e commit d765e5d

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

plugins/integrations/prometheus/src/main/java/org/apache/cloudstack/metrics/PrometheusExporter.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,23 @@
1818

1919
public interface PrometheusExporter {
2020

21+
/**
22+
* Update the Prometheus metrics in text format.
23+
*
24+
* NOTE: capacity data is refreshed independently by {@code AlertManagerImpl}'s own
25+
* periodic {@code CapacityChecker} timer. Do NOT force a synchronous
26+
* {@code recalculateCapacity()} call here: it spins up a fresh thread pool per host
27+
* and per storage pool across ALL zones on every single scrape, so with Z zones a
28+
* single Prometheus scrape triggered Z redundant full recalculations. That extra,
29+
* uncoordinated load compounds over time and can lead to {@code scrape_duration_seconds}
30+
* climbing until a management-server restart.
31+
*
32+
* @see PrometheusExporterImpl#updateMetrics()
33+
*/
2134
void updateMetrics();
2235

36+
/**
37+
* @return the latest Prometheus metrics refreshed by {@link #updateMetrics()}.
38+
*/
2339
String getMetrics();
2440
}

plugins/integrations/prometheus/src/main/java/org/apache/cloudstack/metrics/PrometheusExporterImpl.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -491,14 +491,6 @@ private void addVMsBySizeMetrics(final List<Item> metricsList, final long dcId,
491491
public void updateMetrics() {
492492
final List<Item> latestMetricsItems = new ArrayList<Item>();
493493
try {
494-
// NOTE: capacity data is refreshed independently by AlertManagerImpl's own
495-
// periodic CapacityChecker timer (see AlertManagerImpl#start()). Do NOT force a
496-
// synchronous recalculateCapacity() here: it spins up a fresh thread pool per host
497-
// and per storage pool across ALL zones on every single scrape, so with Z zones a
498-
// single Prometheus scrape triggered Z redundant full recalculations. That extra,
499-
// uncoordinated load compounds over time (thread churn + overlapping runs with the
500-
// timer) and was the cause of https://github.com/apache/cloudstack/issues/13586
501-
// (scrape_duration_seconds climbing until a management-server restart).
502494
for (final DataCenterVO dc : dcDao.listAll()) {
503495
final String zoneName = dc.getName();
504496
final String zoneUuid = dc.getUuid();

0 commit comments

Comments
 (0)