drop disable_non_metric_meters option
we don't support large amounts volume=1 meters anymore. the ones that remain are on purpose and should be disabled via pipeline. Change-Id: Ie571555449353f464412e71cd229a66544f9ae45
This commit is contained in:
parent
c0210dd0a2
commit
d82b19e838
@ -130,16 +130,6 @@ class NotificationBase(PluginBase):
|
||||
p(list(self.process_notification(notification)))
|
||||
|
||||
|
||||
class NonMetricNotificationBase(object):
|
||||
"""Use to mark non-measurement meters
|
||||
|
||||
There are a number of historical non-measurement meters that should really
|
||||
be captured as events. This common base allows us to disable these invalid
|
||||
meters.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class ExtensionLoadError(Exception):
|
||||
"""Error of loading pollster plugin.
|
||||
|
||||
|
@ -171,22 +171,19 @@ class ProcessMeterNotifications(plugin_base.NotificationBase):
|
||||
pkg_resources.resource_filename(__name__, "data/meters.yaml"))
|
||||
|
||||
definitions = {}
|
||||
disable_non_metric_meters = (self.manager.conf.notification.
|
||||
disable_non_metric_meters)
|
||||
for meter_cfg in reversed(meters_cfg['metric']):
|
||||
if meter_cfg.get('name') in definitions:
|
||||
# skip duplicate meters
|
||||
LOG.warning(_LW("Skipping duplicate meter definition %s")
|
||||
% meter_cfg)
|
||||
continue
|
||||
if (meter_cfg.get('volume') != 1 or not disable_non_metric_meters):
|
||||
try:
|
||||
md = MeterDefinition(meter_cfg, plugin_manager)
|
||||
except declarative.DefinitionException as e:
|
||||
errmsg = _LE("Error loading meter definition: %s")
|
||||
LOG.error(errmsg, six.text_type(e))
|
||||
else:
|
||||
definitions[meter_cfg['name']] = md
|
||||
try:
|
||||
md = MeterDefinition(meter_cfg, plugin_manager)
|
||||
except declarative.DefinitionException as e:
|
||||
errmsg = _LE("Error loading meter definition: %s")
|
||||
LOG.error(errmsg, six.text_type(e))
|
||||
else:
|
||||
definitions[meter_cfg['name']] = md
|
||||
return definitions.values()
|
||||
|
||||
def get_targets(self, conf):
|
||||
|
@ -33,8 +33,7 @@ OPTS = [
|
||||
]
|
||||
|
||||
|
||||
class HTTPRequest(plugin_base.NotificationBase,
|
||||
plugin_base.NonMetricNotificationBase):
|
||||
class HTTPRequest(plugin_base.NotificationBase):
|
||||
event_types = ['http.request']
|
||||
|
||||
def get_targets(self, conf):
|
||||
|
@ -22,10 +22,9 @@ from oslo_log import log
|
||||
import oslo_messaging
|
||||
from stevedore import extension
|
||||
|
||||
from ceilometer.agent import plugin_base as base
|
||||
from ceilometer import coordination
|
||||
from ceilometer.event import endpoint as event_endpoint
|
||||
from ceilometer.i18n import _, _LI, _LW
|
||||
from ceilometer.i18n import _, _LI
|
||||
from ceilometer import messaging
|
||||
from ceilometer import pipeline
|
||||
from ceilometer import service_base
|
||||
@ -47,12 +46,6 @@ OPTS = [
|
||||
default=True,
|
||||
deprecated_group='collector',
|
||||
help='Acknowledge message when event persistence fails.'),
|
||||
cfg.BoolOpt('disable_non_metric_meters',
|
||||
default=True,
|
||||
help='WARNING: Ceilometer historically offered the ability to '
|
||||
'store events as meters. This usage is NOT advised as it '
|
||||
'can flood the metering database and cause performance '
|
||||
'degradation.'),
|
||||
cfg.BoolOpt('workload_partitioning',
|
||||
default=False,
|
||||
help='Enable workload partitioning, allowing multiple '
|
||||
@ -214,11 +207,6 @@ class NotificationService(service_base.PipelineBasedService):
|
||||
with self.coord_lock:
|
||||
self._configure_pipeline_listener()
|
||||
|
||||
if not self.conf.notification.disable_non_metric_meters:
|
||||
LOG.warning(_LW('Non-metric meters may be collected. It is highly '
|
||||
'advisable to disable these meters using '
|
||||
'ceilometer.conf or the pipeline.yaml'))
|
||||
|
||||
self.init_pipeline_refresh()
|
||||
|
||||
def _configure_main_queue_listeners(self, pipe_manager,
|
||||
@ -237,9 +225,6 @@ class NotificationService(service_base.PipelineBasedService):
|
||||
targets = []
|
||||
for ext in notification_manager:
|
||||
handler = ext.obj
|
||||
if (self.conf.notification.disable_non_metric_meters and
|
||||
isinstance(handler, base.NonMetricNotificationBase)):
|
||||
continue
|
||||
LOG.debug('Event types from %(name)s: %(type)s'
|
||||
' (ack_on_error=%(error)s)',
|
||||
{'name': ext.name,
|
||||
|
@ -104,8 +104,6 @@ class TestNotification(tests_base.BaseTestCase):
|
||||
self.CONF = self.useFixture(fixture_config.Config(conf)).conf
|
||||
self.CONF.set_override("connection", "log://", group='database')
|
||||
self.CONF.set_override("backend_url", None, group="coordination")
|
||||
self.CONF.set_override("disable_non_metric_meters", False,
|
||||
group="notification")
|
||||
self.CONF.set_override("workload_partitioning", True,
|
||||
group='notification')
|
||||
self.setup_messaging(self.CONF)
|
||||
@ -534,8 +532,6 @@ class TestRealNotificationMultipleAgents(tests_base.BaseTestCase):
|
||||
self.CONF.set_override("event_pipeline_cfg_file",
|
||||
event_pipeline_cfg_file)
|
||||
self.CONF.set_override("backend_url", None, group="coordination")
|
||||
self.CONF.set_override("disable_non_metric_meters", False,
|
||||
group="notification")
|
||||
self.CONF.set_override('workload_partitioning', True,
|
||||
group='notification')
|
||||
self.CONF.set_override('pipeline_processing_queues', 2,
|
||||
|
Loading…
Reference in New Issue
Block a user