From 4c4a0619188657e4364dc5f1d23c4fce5c75e2a6 Mon Sep 17 00:00:00 2001 From: Mooli Tayer Date: Wed, 14 Jun 2017 13:42:13 +0300 Subject: [PATCH] Add prometheus event collection --- .../providers/openshift/monitoring_manager.rb | 5 +++++ .../openshift/monitoring_manager/event_catcher.rb | 11 +++++++++++ .../monitoring_manager/event_catcher/runner.rb | 3 +++ config/settings.yml | 2 ++ 4 files changed, 21 insertions(+) create mode 100644 app/models/manageiq/providers/openshift/monitoring_manager/event_catcher.rb create mode 100644 app/models/manageiq/providers/openshift/monitoring_manager/event_catcher/runner.rb diff --git a/app/models/manageiq/providers/openshift/monitoring_manager.rb b/app/models/manageiq/providers/openshift/monitoring_manager.rb index 4745c44b..d7f7774f 100644 --- a/app/models/manageiq/providers/openshift/monitoring_manager.rb +++ b/app/models/manageiq/providers/openshift/monitoring_manager.rb @@ -1,5 +1,6 @@ module ManageIQ::Providers class Openshift::MonitoringManager < ManageIQ::Providers::MonitoringManager + require_nested :EventCatcher include ManageIQ::Providers::Kubernetes::MonitoringManagerMixin belongs_to :parent_manager, @@ -14,5 +15,9 @@ def self.ems_type def self.description @description ||= "Openshift Monitor".freeze end + + def self.event_monitor_class + ManageIQ::Providers::Openshift::MonitoringManager::EventCatcher + end end end diff --git a/app/models/manageiq/providers/openshift/monitoring_manager/event_catcher.rb b/app/models/manageiq/providers/openshift/monitoring_manager/event_catcher.rb new file mode 100644 index 00000000..6dc84763 --- /dev/null +++ b/app/models/manageiq/providers/openshift/monitoring_manager/event_catcher.rb @@ -0,0 +1,11 @@ +class ManageIQ::Providers::Openshift::MonitoringManager::EventCatcher < ManageIQ::Providers::BaseManager::EventCatcher + require_nested :Runner + + def self.ems_class + ManageIQ::Providers::Openshift::MonitoringManager + end + + def self.settings_name + :event_catcher_prometheus + end +end diff --git a/app/models/manageiq/providers/openshift/monitoring_manager/event_catcher/runner.rb b/app/models/manageiq/providers/openshift/monitoring_manager/event_catcher/runner.rb new file mode 100644 index 00000000..9e305339 --- /dev/null +++ b/app/models/manageiq/providers/openshift/monitoring_manager/event_catcher/runner.rb @@ -0,0 +1,3 @@ +class ManageIQ::Providers::Openshift::MonitoringManager::EventCatcher::Runner < ManageIQ::Providers::BaseManager::EventCatcher::Runner + include ManageIQ::Providers::Kubernetes::MonitoringManager::EventCatcher::RunnerMixin +end diff --git a/config/settings.yml b/config/settings.yml index 9350b4ea..774ada29 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -21,6 +21,8 @@ :event_catcher: :event_catcher_openshift: :poll: 1.seconds + :event_catcher_prometheus: + :poll: 20.seconds :queue_worker_base: :ems_metrics_collector_worker: :ems_metrics_collector_worker_openshift: {}