Skip to content

Commit 8b09295

Browse files
authored
prometheus: don't poll the same tag multiple times (#10450)
1 parent 35a7438 commit 8b09295

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.math.BigDecimal;
2020
import java.util.ArrayList;
2121
import java.util.HashMap;
22+
import java.util.HashSet;
2223
import java.util.List;
2324
import java.util.Map;
2425
import java.util.stream.Collectors;
@@ -302,7 +303,7 @@ private void addHostTagsMetrics(final List<Item> metricsList, final long dcId, f
302303
.flatMap( h -> _hostTagsDao.getHostTags(h).stream())
303304
.distinct()
304305
.collect(Collectors.toList());
305-
List<String> allHostTags = new ArrayList<>();
306+
HashSet<String> allHostTags = new HashSet<>();
306307
allHostTagVOS.forEach(hostTagVO -> allHostTags.add(hostTagVO.getTag()));
307308

308309
for (final State state : State.values()) {

0 commit comments

Comments
 (0)