Get rid of openstack_nova_instance_state metric

This metric isn't used anywhere and has no value on its own.

Change-Id: I4b25517ace9a5721f71bd797fe073e66238f1891
This commit is contained in:
Simon Pasquier 2017-02-21 13:44:39 +01:00
parent 9016e64bb4
commit f745102732
3 changed files with 0 additions and 60 deletions

View File

@ -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

View File

@ -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'],
}
}

View File

@ -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.