Adds use of CustomCollector in Prometheus exporter 19/6719/11
authorBenjamin Diaz <bdiaz@whitestack.com>
Wed, 17 Oct 2018 17:44:36 +0000 (14:44 -0300)
committerBenjamin Diaz <bdiaz@whitestack.com>
Thu, 18 Oct 2018 18:12:56 +0000 (15:12 -0300)
commit4da146638bc3838270fa41c9f9fb91961f726c97
tree2968d1d64f54a4187e1c79286b61610f29fba81f
parent2aec92e1eb52d5512c2acae9ce9878f2f3c8f782
Adds use of CustomCollector in Prometheus exporter

Using a CustomCollector gives more control over the collection
process, which allows handling the removal of metrics when a NS
is deleted. Metrics now have a lifespan of a collection cycle, so
metrics of deleted vdus are now not visible in the exporter.

It also adds MonCollector class, which allows to abstract collection
logic and facilitates testing.

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: Idfdb86c1ee9facd07187e6582954ae4cab32a5b4
132 files changed:
docker/scripts/runInstall.sh
osm_mon/cmd/exporter.py [deleted file]
osm_mon/cmd/mon_prometheus_exporter.py [new file with mode: 0644]
osm_mon/collector/__init__.py [new file with mode: 0644]
osm_mon/collector/collector.py [new file with mode: 0644]
osm_mon/collector/prometheus_exporter.py [new file with mode: 0644]
osm_mon/core/message_bus/common_consumer.py
osm_mon/core/settings.py
osm_mon/exporter/__init__.py [deleted file]
osm_mon/exporter/exporter.py [deleted file]
osm_mon/plugins/OpenStack/Aodh/notifier.py
osm_mon/test/CloudWatch/test_schemas/alarm_details/acknowledge_alarm.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/create_alarm/create_alarm_differentName_differentInstance.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/create_alarm/create_alarm_differentName_sameInstance.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/create_alarm/create_alarm_sameName_differentInstance.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/create_alarm/create_alarm_sameName_sameInstance.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/create_alarm/operation_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/create_alarm/operation_valid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/create_alarm/statistic_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/create_alarm/statistic_valid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/create_metrics/create_metric_req_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/create_metrics/create_metric_req_valid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/delete_alarm/name_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/delete_alarm/name_valid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/delete_alarm/name_valid_delete1.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/delete_alarm/name_valid_delete2.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/delete_alarm/name_valid_delete3.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/delete_alarm/name_valid_delete4.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/delete_metrics/delete_metric_req_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/delete_metrics/delete_metric_req_valid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/list_alarm/list_alarm_valid_no_arguments.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/list_alarm/list_alarm_valid_one_argument.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/list_alarm/list_alarm_valid_two_arguments.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/list_metrics/list_metric_req_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/list_metrics/list_metric_req_valid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/read_metrics_data/read_coll_period_req_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/read_metrics_data/read_coll_period_req_valid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/read_metrics_data/read_metric_name_req_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/read_metrics_data/read_metric_name_req_valid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/update_alarm/name_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/update_alarm/name_valid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/update_alarm/operation_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/update_alarm/operation_valid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/update_alarm/statistic_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/update_alarm/statistic_valid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/update_alarm/update_alarm_new_alarm.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/update_metrics/update_metric_req_invalid.json [deleted file]
osm_mon/test/CloudWatch/test_schemas/update_metrics/update_metric_req_valid.json [deleted file]
osm_mon/test/CloudWatch/unit_tests_alarms.py [deleted file]
osm_mon/test/CloudWatch/unit_tests_metrics.py [deleted file]
osm_mon/test/OpenStack/__init__.py [deleted file]
osm_mon/test/OpenStack/integration/__init__.py [deleted file]
osm_mon/test/OpenStack/integration/test_alarm_integration.py [deleted file]
osm_mon/test/OpenStack/integration/test_metric_integration.py [deleted file]
osm_mon/test/OpenStack/integration/test_notify_alarm.py [deleted file]
osm_mon/test/OpenStack/integration/test_vim_account.py [deleted file]
osm_mon/test/OpenStack/unit/__init__.py [deleted file]
osm_mon/test/OpenStack/unit/test_alarm_req.py [deleted file]
osm_mon/test/OpenStack/unit/test_alarming.py [deleted file]
osm_mon/test/OpenStack/unit/test_common.py [deleted file]
osm_mon/test/OpenStack/unit/test_metric_calls.py [deleted file]
osm_mon/test/OpenStack/unit/test_metric_req.py [deleted file]
osm_mon/test/OpenStack/unit/test_notifier.py [deleted file]
osm_mon/test/OpenStack/unit/test_responses.py [deleted file]
osm_mon/test/OpenStack/unit/test_settings.py [deleted file]
osm_mon/test/VMware/__init__.py [deleted file]
osm_mon/test/VMware/test_mon_plugin_vrops.py [deleted file]
osm_mon/test/VMware/test_plugin_receiver.py [deleted file]
osm_mon/test/collector/__init__.py [new file with mode: 0644]
osm_mon/test/collector/test_collector.py [new file with mode: 0644]
osm_mon/test/core/test_common_consumer.py
osm_mon/test/functional/__init__.py [deleted file]
osm_mon/test/plugins/CloudWatch/__init__.py [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/alarm_details/acknowledge_alarm.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/create_alarm/create_alarm_differentName_differentInstance.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/create_alarm/create_alarm_differentName_sameInstance.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/create_alarm/create_alarm_sameName_differentInstance.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/create_alarm/create_alarm_sameName_sameInstance.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/create_alarm/operation_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/create_alarm/operation_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/create_alarm/statistic_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/create_alarm/statistic_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/create_metrics/create_metric_req_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/create_metrics/create_metric_req_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/delete_alarm/name_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/delete_alarm/name_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/delete_alarm/name_valid_delete1.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/delete_alarm/name_valid_delete2.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/delete_alarm/name_valid_delete3.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/delete_alarm/name_valid_delete4.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/delete_metrics/delete_metric_req_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/delete_metrics/delete_metric_req_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/list_alarm/list_alarm_valid_no_arguments.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/list_alarm/list_alarm_valid_one_argument.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/list_alarm/list_alarm_valid_two_arguments.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/list_metrics/list_metric_req_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/list_metrics/list_metric_req_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/read_metrics_data/read_coll_period_req_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/read_metrics_data/read_coll_period_req_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/read_metrics_data/read_metric_name_req_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/read_metrics_data/read_metric_name_req_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/update_alarm/name_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/update_alarm/name_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/update_alarm/operation_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/update_alarm/operation_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/update_alarm/statistic_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/update_alarm/statistic_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/update_alarm/update_alarm_new_alarm.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/update_metrics/update_metric_req_invalid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/test_schemas/update_metrics/update_metric_req_valid.json [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/unit_tests_alarms.py [new file with mode: 0644]
osm_mon/test/plugins/CloudWatch/unit_tests_metrics.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/__init__.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/integration/__init__.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/integration/test_alarm_integration.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/integration/test_metric_integration.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/integration/test_notify_alarm.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/integration/test_vim_account.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/unit/__init__.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/unit/test_alarm_req.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/unit/test_alarming.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/unit/test_common.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/unit/test_metric_calls.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/unit/test_metric_req.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/unit/test_notifier.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/unit/test_responses.py [new file with mode: 0644]
osm_mon/test/plugins/OpenStack/unit/test_settings.py [new file with mode: 0644]
osm_mon/test/plugins/VMware/__init__.py [new file with mode: 0644]
osm_mon/test/plugins/VMware/test_mon_plugin_vrops.py [new file with mode: 0644]
osm_mon/test/plugins/VMware/test_plugin_receiver.py [new file with mode: 0644]
osm_mon/test/plugins/__init__.py [new file with mode: 0644]
setup.py