Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid metrics collection workers unless endpoint #7

Merged
merged 1 commit into from
May 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,14 @@ def friendly_name
def self.ems_class
ManageIQ::Providers::Kubernetes::ContainerManager
end

# Override PerEmsTypeWorkerMixin.emses_in_zone to limit metrics collection
def self.emses_in_zone
super.select do |ems|
ems.supports_metrics?.tap do |supported|
_log.info("Skipping [#{ems.name}] since it has no metrics endpoint") unless supported
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ module ManageIQ::Providers::Kubernetes::ContainerManagerMixin
end
end

def supports_metrics?
connection_configurations.hawkular != nil
end

module ClassMethods
def raw_api_endpoint(hostname, port, path = '')
URI::HTTPS.build(:host => hostname, :port => port.presence.try(:to_i), :path => path)
Expand Down