Skip to content

Commit a639cde

Browse files
committed
Improve performance of capture_ems_targets
For Kubernetes type providers if the ems has metrics credentials then all instances of container_nodes, container_groups, etc... supports capture. We don't have to check `.supporting(:capture)` if we are in a kubernetes provider, but this isn't generally true so only implement this behavior in k8s.
1 parent 0c258a3 commit a639cde

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/models/manageiq/providers/kubernetes/container_manager/metrics_capture.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ def capture_ems_targets(_options = {})
5757
return []
5858
end
5959

60-
super
60+
MiqPreloader.preload([ems], :container_images => :tags, :container_nodes => :tags, :container_groups => [:tags, :containers => :tags])
61+
62+
with_archived(ems.all_container_nodes) +
63+
with_archived(ems.all_container_groups) +
64+
with_archived(ems.all_containers) +
65+
with_archived(ems.container_images)
6166
end
6267

6368
def prometheus_capture_context(target, start_time, end_time)

0 commit comments

Comments
 (0)