summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSwann Croiset <scroiset@mirantis.com>2017-02-09 12:05:47 +0100
committerSwann Croiset <scroiset@mirantis.com>2017-02-09 13:16:24 +0100
commit4d025aa0ab1264fab573141abf0750d8c2321065 (patch)
tree053a34e30a8d207c2cde7a49871ba6aebd1143db
parent36224e696345905b8d853d1e843ea5da6750c7cf (diff)
Fix Logger setting in sandboxes
A filter sandbox cannot modify the Logger field Change-Id: Ie50bf2acb3d764504be398685c8e4e61c4e1c61b Closes-bug: #1662879
Notes
Notes (review): Code-Review+2: Simon Pasquier <spasquier@mirantis.com> Workflow+1: Swann Croiset <scroiset@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 09 Feb 2017 12:21:47 +0000 Reviewed-on: https://review.openstack.org/431438 Project: openstack/fuel-plugin-lma-collector Branch: refs/heads/master
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/files/plugins/common/lma_utils.lua3
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/hdd_errors_counter.lua3
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/heka_monitoring.lua2
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/http_metrics_aggregator.lua5
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/logs_counter.lua3
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/manifests/logs/aggregated_http_metrics.pp1
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/manifests/logs/counter.pp1
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/manifests/logs/hdd_errors_counter.pp1
8 files changed, 6 insertions, 13 deletions
diff --git a/deployment_scripts/puppet/modules/lma_collector/files/plugins/common/lma_utils.lua b/deployment_scripts/puppet/modules/lma_collector/files/plugins/common/lma_utils.lua
index 6be1ab2..5561488 100644
--- a/deployment_scripts/puppet/modules/lma_collector/files/plugins/common/lma_utils.lua
+++ b/deployment_scripts/puppet/modules/lma_collector/files/plugins/common/lma_utils.lua
@@ -74,7 +74,7 @@ function add_to_bulk_metric(name, value, tags)
74end 74end
75 75
76-- Send the bulk metric message to the Heka pipeline 76-- Send the bulk metric message to the Heka pipeline
77function inject_bulk_metric(ts, hostname, logger, source, m_type) 77function inject_bulk_metric(ts, hostname, source, m_type)
78 if #bulk_datapoints == 0 then 78 if #bulk_datapoints == 0 then
79 return 79 return
80 end 80 end
@@ -89,7 +89,6 @@ function inject_bulk_metric(ts, hostname, logger, source, m_type)
89 end 89 end
90 90
91 local msg = { 91 local msg = {
92 Logger = logger,
93 Hostname = hostname, 92 Hostname = hostname,
94 Timestamp = ts, 93 Timestamp = ts,
95 Payload = payload, 94 Payload = payload,
diff --git a/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/hdd_errors_counter.lua b/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/hdd_errors_counter.lua
index 6e5146c..e46ce93 100644
--- a/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/hdd_errors_counter.lua
+++ b/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/hdd_errors_counter.lua
@@ -31,7 +31,6 @@ end
31-- grace_interval parameter allows to take into account log messages that are 31-- grace_interval parameter allows to take into account log messages that are
32-- received in the current interval but emitted before it. 32-- received in the current interval but emitted before it.
33local grace_interval = (read_config('grace_interval') or 0) + 0 33local grace_interval = (read_config('grace_interval') or 0) + 0
34local metric_logger = read_config('logger')
35local metric_source = read_config('source') 34local metric_source = read_config('source')
36 35
37local error_counters = {} 36local error_counters = {}
@@ -84,7 +83,7 @@ function timer_event(ns)
84 end 83 end
85 84
86 enter_at = ns 85 enter_at = ns
87 utils.inject_bulk_metric(ns, hostname, metric_logger, metric_source) 86 utils.inject_bulk_metric(ns, hostname, metric_source)
88 87
89 return 0 88 return 0
90end 89end
diff --git a/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/heka_monitoring.lua b/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/heka_monitoring.lua
index c40f0c3..51ead49 100644
--- a/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/heka_monitoring.lua
+++ b/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/heka_monitoring.lua
@@ -80,6 +80,6 @@ function process_message ()
80 end 80 end
81 end 81 end
82 82
83 utils.inject_bulk_metric(ts, hostname, 'heka_monitoring', 'internal') 83 utils.inject_bulk_metric(ts, hostname, 'internal')
84 return 0 84 return 0
85end 85end
diff --git a/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/http_metrics_aggregator.lua b/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/http_metrics_aggregator.lua
index 81eaf43..6abe3b7 100644
--- a/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/http_metrics_aggregator.lua
+++ b/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/http_metrics_aggregator.lua
@@ -34,7 +34,6 @@ local percentile_thresh = (read_config('percentile') or 90) + 0
34-- and also to compensate the delay introduced by log parsing/decoding 34-- and also to compensate the delay introduced by log parsing/decoding
35-- which leads to arrive too late in its interval. 35-- which leads to arrive too late in its interval.
36local grace_time = (read_config('grace_time') or 0) + 0 36local grace_time = (read_config('grace_time') or 0) + 0
37local metric_logger = read_config('logger')
38local metric_source = read_config('source') 37local metric_source = read_config('source')
39 38
40local inject_reached_error = 'too many metrics to aggregate, adjust bulk_size and/or max_timer_inject parameters' 39local inject_reached_error = 'too many metrics to aggregate, adjust bulk_size and/or max_timer_inject parameters'
@@ -167,7 +166,7 @@ function timer_event(ns)
167 num_metrics = num_metrics - 1 166 num_metrics = num_metrics - 1
168 if num >= bulk_size then 167 if num >= bulk_size then
169 if msg_injected < max_timer_inject then 168 if msg_injected < max_timer_inject then
170 utils.inject_bulk_metric(ns, hostname, metric_logger, metric_source) 169 utils.inject_bulk_metric(ns, hostname, metric_source)
171 msg_injected = msg_injected + 1 170 msg_injected = msg_injected + 1
172 num = 0 171 num = 0
173 num_metrics = 0 172 num_metrics = 0
@@ -179,7 +178,7 @@ function timer_event(ns)
179 all_times[service] = nil 178 all_times[service] = nil
180 end 179 end
181 if num > 0 then 180 if num > 0 then
182 utils.inject_bulk_metric(ns, hostname, metric_logger, metric_source) 181 utils.inject_bulk_metric(ns, hostname, metric_source)
183 num = 0 182 num = 0
184 num_metrics = 0 183 num_metrics = 0
185 end 184 end
diff --git a/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/logs_counter.lua b/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/logs_counter.lua
index 5199f25..e6ef229 100644
--- a/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/logs_counter.lua
+++ b/deployment_scripts/puppet/modules/lma_collector/files/plugins/filters/logs_counter.lua
@@ -26,7 +26,6 @@ local hostname = read_config('hostname') or error('hostname must be specified')
26-- older than the current time. 26-- older than the current time.
27local grace_interval = (read_config('grace_interval') or 0) + 0 27local grace_interval = (read_config('grace_interval') or 0) + 0
28local logger_matcher = read_config('logger_matcher') or '.*' 28local logger_matcher = read_config('logger_matcher') or '.*'
29local metric_logger = read_config('logger')
30local metric_source = read_config('source') 29local metric_source = read_config('source')
31 30
32local discovered_services = {} 31local discovered_services = {}
@@ -79,7 +78,7 @@ function timer_event(ns)
79 78
80 last_timer_event = ns 79 last_timer_event = ns
81 80
82 ok, err = utils.inject_bulk_metric(ns, hostname, metric_logger, metric_source, utils.metric_type['DERIVE']) 81 ok, err = utils.inject_bulk_metric(ns, hostname, metric_source, utils.metric_type['DERIVE'])
83 if ok ~= 0 then 82 if ok ~= 0 then
84 return -1, err 83 return -1, err
85 end 84 end
diff --git a/deployment_scripts/puppet/modules/lma_collector/manifests/logs/aggregated_http_metrics.pp b/deployment_scripts/puppet/modules/lma_collector/manifests/logs/aggregated_http_metrics.pp
index c4e7b70..5473ee5 100644
--- a/deployment_scripts/puppet/modules/lma_collector/manifests/logs/aggregated_http_metrics.pp
+++ b/deployment_scripts/puppet/modules/lma_collector/manifests/logs/aggregated_http_metrics.pp
@@ -37,7 +37,6 @@ class lma_collector::logs::aggregated_http_metrics (
37 bulk_size => $bulk_size, 37 bulk_size => $bulk_size,
38 percentile => $percentile, 38 percentile => $percentile,
39 grace_time => $grace_time, 39 grace_time => $grace_time,
40 logger => 'aggregated_http_metrics_filter',
41 source => 'log_collector', 40 source => 'log_collector',
42 }, 41 },
43 module_directory => $lua_modules_dir, 42 module_directory => $lua_modules_dir,
diff --git a/deployment_scripts/puppet/modules/lma_collector/manifests/logs/counter.pp b/deployment_scripts/puppet/modules/lma_collector/manifests/logs/counter.pp
index fa20a5d..4db64ce 100644
--- a/deployment_scripts/puppet/modules/lma_collector/manifests/logs/counter.pp
+++ b/deployment_scripts/puppet/modules/lma_collector/manifests/logs/counter.pp
@@ -33,7 +33,6 @@ class lma_collector::logs::counter (
33 hostname => $hostname, 33 hostname => $hostname,
34 grace_interval => $grace_interval, 34 grace_interval => $grace_interval,
35 logger_matcher => '^openstack%.(%a+)$', 35 logger_matcher => '^openstack%.(%a+)$',
36 logger => 'log_counter_filter',
37 source => 'log_collector', 36 source => 'log_collector',
38 }, 37 },
39 module_directory => $lua_modules_dir, 38 module_directory => $lua_modules_dir,
diff --git a/deployment_scripts/puppet/modules/lma_collector/manifests/logs/hdd_errors_counter.pp b/deployment_scripts/puppet/modules/lma_collector/manifests/logs/hdd_errors_counter.pp
index 730e4a6..4b4bde5 100644
--- a/deployment_scripts/puppet/modules/lma_collector/manifests/logs/hdd_errors_counter.pp
+++ b/deployment_scripts/puppet/modules/lma_collector/manifests/logs/hdd_errors_counter.pp
@@ -31,7 +31,6 @@ class lma_collector::logs::hdd_errors_counter (
31 hostname => $hostname, 31 hostname => $hostname,
32 grace_interval => $grace_interval, 32 grace_interval => $grace_interval,
33 patterns => '/error%s.+([sv]d[a-z][a-z]?)%d?/ /([sv]d[a-z][a-z]?)%d?.+%serror/', 33 patterns => '/error%s.+([sv]d[a-z][a-z]?)%d?/ /([sv]d[a-z][a-z]?)%d?.+%serror/',
34 logger => 'hdd_errors_counter_filter',
35 source => 'log_collector', 34 source => 'log_collector',
36 }, 35 },
37 module_directory => $lua_modules_dir, 36 module_directory => $lua_modules_dir,