diff --git a/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/instance_state.lua b/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/instance_state.lua deleted file mode 100644 index 9354267da..000000000 --- a/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/instance_state.lua +++ /dev/null @@ -1,48 +0,0 @@ --- Copyright 2015 Mirantis, Inc. --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. -local utils = require 'lma_utils' - -local msg = { - Type = "metric", -- will be prefixed by "heka.sandbox." - Timestamp = nil, - Severity = 6, -} - -count = 0 - -function process_message () - local state = read_message("Fields[state]") - local old_state = read_message("Fields[old_state]") - if old_state ~= nil and state == old_state then - -- nothing to do - return 0 - end - msg.Timestamp = read_message("Timestamp") - msg.Fields = { - source = read_message('Logger'), - name = "openstack_nova_instance_state", - -- preserve the original hostname in the Fields attribute because - -- sandboxed filters cannot override the Hostname attribute - hostname = read_message("Fields[hostname]"), - type = utils.metric_type['COUNTER'], - value = 1, - tenant_id = read_message("Fields[tenant_id]"), - user_id = read_message("Fields[user_id]"), - state = state, - tag_fields = { 'state', 'hostname' }, - } - utils.inject_tags(msg) - - return utils.safe_inject_message(msg) -end diff --git a/deployment_scripts/puppet/modules/lma_collector/manifests/notifications/metrics.pp b/deployment_scripts/puppet/modules/lma_collector/manifests/notifications/metrics.pp index 375ebcdb1..12c5adf45 100644 --- a/deployment_scripts/puppet/modules/lma_collector/manifests/notifications/metrics.pp +++ b/deployment_scripts/puppet/modules/lma_collector/manifests/notifications/metrics.pp @@ -28,13 +28,4 @@ class lma_collector::notifications::metrics { module_directory => $lua_modules_dir, notify => Class['lma_collector::service::log'], } - - # Filter to compute the instance state change metric - heka::filter::sandbox { 'instance_state': - config_dir => $config_dir, - filename => "${lma_collector::params::plugins_dir}/filters/instance_state.lua", - message_matcher => 'Type == \'notification\' && Fields[event_type] == \'compute.instance.update\' && Fields[state] != NIL', - module_directory => $lua_modules_dir, - notify => Class['lma_collector::service::log'], - } } diff --git a/doc/user/source/metrics/openstack.rst b/doc/user/source/metrics/openstack.rst index c9c0ce7f4..a73aaa7e2 100644 --- a/doc/user/source/metrics/openstack.rst +++ b/doc/user/source/metrics/openstack.rst @@ -42,9 +42,6 @@ The following metrics are emitted per compute node: instances. * ``openstack_nova_instance_creation_time``, the time in seconds it took to launch a new instance. -* ``openstack_nova_instance_state``, the number of instances which entered a - given state (the value is always ``1``). - The metric contains a ``state`` field. * ``openstack_nova_running_instances``, the number of running instances. * ``openstack_nova_running_tasks``, the number of tasks currently executed. * ``openstack_nova_used_disk``, the disk space in GB used by the instances.