Revert "Add meter-sink as an option"
This reverts commit6ed691807d
. The meter_sink is actually required in pipeline.yaml and not in event_pipline.yaml, and this is something that needs to be enabled for newton and above as the ceilometer-collector is not the dependancy for this. Change-Id: Ie40a99281f1f60de7a409e1e3a2025a850a8a446 (cherry picked from commitf046895cdb
)
This commit is contained in:
parent
5b29872a3a
commit
7cdafac314
12
config.yaml
12
config.yaml
|
@ -259,24 +259,12 @@ options:
|
|||
.
|
||||
'udp://<host>:<port>/'
|
||||
'prometheus://pushgateway-host:9091/metrics/job/openstack-telemetry'
|
||||
meter-sink:
|
||||
type: string
|
||||
default:
|
||||
description: |
|
||||
Space delimited list of meter consumers of Ceilometer meter reporting
|
||||
which reside outside of the deployed model. Only supported for Mitaka
|
||||
and later clouds. e.g.
|
||||
.
|
||||
'udp://<host>:<port>/'
|
||||
'http://telegraf-host-host:8080/telegraf?timeout=10&max_retries=2&batch=False'
|
||||
pipeline-yaml:
|
||||
type: string
|
||||
default: ""
|
||||
description: |
|
||||
When set the content is written to /etc/ceilometer/pipeline.yaml, by
|
||||
default the package's file is used.
|
||||
|
||||
This setting is not supported from Mitaka onwards.
|
||||
polling-interval:
|
||||
type: int
|
||||
default: 300
|
||||
|
|
|
@ -156,7 +156,7 @@ class HAProxyContext(OSContextGenerator):
|
|||
return ctxt
|
||||
|
||||
|
||||
class CustomSinksContext(OSContextGenerator):
|
||||
class RemoteSinksContext(OSContextGenerator):
|
||||
interfaces = ['event-service']
|
||||
|
||||
def __call__(self):
|
||||
|
@ -166,8 +166,6 @@ class CustomSinksContext(OSContextGenerator):
|
|||
ctxt = {}
|
||||
if config('remote-sink'):
|
||||
ctxt['remote_sinks'] = config('remote-sink').split(' ')
|
||||
if config('meter-sink'):
|
||||
ctxt['meter_sinks'] = config('meter-sink').split(' ')
|
||||
for relid in relation_ids('event-service'):
|
||||
for unit in related_units(relid):
|
||||
publisher = relation_get('publisher', unit=unit, rid=relid)
|
||||
|
|
|
@ -32,7 +32,7 @@ from ceilometer_contexts import (
|
|||
HAProxyContext,
|
||||
MetricServiceContext,
|
||||
CEILOMETER_PORT,
|
||||
CustomSinksContext,
|
||||
RemoteSinksContext,
|
||||
AMQPListenersContext,
|
||||
)
|
||||
from charmhelpers.contrib.openstack.utils import (
|
||||
|
@ -170,7 +170,7 @@ QUEENS_CONFIG_FILES = OrderedDict([
|
|||
'services': QUEENS_SERVICES
|
||||
}),
|
||||
(PIPELINE_CONF, {
|
||||
'hook_contexts': [CustomSinksContext()],
|
||||
'hook_contexts': [RemoteSinksContext()],
|
||||
'services': QUEENS_SERVICES,
|
||||
}),
|
||||
])
|
||||
|
@ -216,7 +216,7 @@ CONFIG_FILES = OrderedDict([
|
|||
'services': ['ceilometer-api', 'apache2'],
|
||||
}),
|
||||
(PIPELINE_CONF, {
|
||||
'hook_contexts': [CustomSinksContext()],
|
||||
'hook_contexts': [RemoteSinksContext()],
|
||||
'services': ['ceilometer-collector'],
|
||||
}),
|
||||
])
|
||||
|
|
|
@ -13,13 +13,6 @@ sources:
|
|||
- {{ item }}
|
||||
{% endfor -%}
|
||||
{% endif %}
|
||||
{%- if meter_sinks %}
|
||||
- name: meter_source
|
||||
meters:
|
||||
- "*"
|
||||
sinks:
|
||||
- meter_sink
|
||||
{% endif %}
|
||||
sinks:
|
||||
{%- if remote_sinks %}
|
||||
- name: remote_sink
|
||||
|
@ -29,14 +22,6 @@ sinks:
|
|||
- {{ item }}
|
||||
{% endfor %}
|
||||
{%- endif -%}
|
||||
{%- if meter_sinks %}
|
||||
- name: meter_sink
|
||||
transformers:
|
||||
publishers:
|
||||
{% for item in meter_sinks -%}
|
||||
- {{ item }}
|
||||
{% endfor %}
|
||||
{%- endif -%}
|
||||
{%- if internal_sinks %}
|
||||
{%- for item, target in internal_sinks.items() -%}
|
||||
- name: {{ item }}
|
||||
|
|
|
@ -13,13 +13,6 @@ sources:
|
|||
- {{ item }}
|
||||
{% endfor -%}
|
||||
{% endif %}
|
||||
{%- if meter_sinks %}
|
||||
- name: meter_source
|
||||
meters:
|
||||
- "*"
|
||||
sinks:
|
||||
- meter_sink
|
||||
{% endif %}
|
||||
sinks:
|
||||
{%- if remote_sinks %}
|
||||
- name: remote_sink
|
||||
|
@ -29,14 +22,6 @@ sinks:
|
|||
- {{ item }}
|
||||
{% endfor %}
|
||||
{%- endif -%}
|
||||
{%- if meter_sinks %}
|
||||
- name: meter_sink
|
||||
transformers:
|
||||
publishers:
|
||||
{% for item in meter_sinks -%}
|
||||
- {{ item }}
|
||||
{% endfor %}
|
||||
{%- endif -%}
|
||||
{%- if internal_sinks %}
|
||||
{%- for item, target in internal_sinks.items() -%}
|
||||
- name: {{ item }}
|
||||
|
|
|
@ -231,20 +231,20 @@ class CeilometerContextsTest(CharmTestCase):
|
|||
self.assertEqual(contexts.HAProxyContext()(), expected)
|
||||
|
||||
@patch.object(contexts, 'get_os_codename_package')
|
||||
def test_custom_sink_context_no_config(self, mock_get_rel):
|
||||
def test_remote_sink_context_no_config(self, mock_get_rel):
|
||||
mock_get_rel.return_value = 'mitaka'
|
||||
self.relation_ids.return_value = []
|
||||
self.os_release.return_value = 'mitaka'
|
||||
self.assertEqual(contexts.CustomSinksContext()(), {
|
||||
self.assertEqual(contexts.RemoteSinksContext()(), {
|
||||
'event_sink_publisher': None})
|
||||
|
||||
mock_get_rel.return_value = 'queens'
|
||||
self.assertEqual(contexts.CustomSinksContext()(),
|
||||
self.assertEqual(contexts.RemoteSinksContext()(),
|
||||
{'event_sink_publisher':
|
||||
'notifier://?topic=alarm.all'})
|
||||
|
||||
@patch.object(contexts, 'get_os_codename_package')
|
||||
def test_custom_sink_context_event_service_relation(self, mock_get_rel):
|
||||
def test_remote_sink_context_event_service_relation(self, mock_get_rel):
|
||||
mock_get_rel.return_value = 'mitaka'
|
||||
self.relation_ids.return_value = ['event-service:0', 'meter-service:0']
|
||||
self.related_units.return_value = ['panko/0']
|
||||
|
@ -253,71 +253,63 @@ class CeilometerContextsTest(CharmTestCase):
|
|||
'publisher': 'panko://'
|
||||
}
|
||||
self.test_relation.set(data)
|
||||
self.assertEqual(contexts.CustomSinksContext()(),
|
||||
self.assertEqual(contexts.RemoteSinksContext()(),
|
||||
{'internal_sinks': {'panko': 'panko://'},
|
||||
'event_sink_publisher': None})
|
||||
|
||||
mock_get_rel.return_value = 'queens'
|
||||
self.assertEqual(contexts.CustomSinksContext()(),
|
||||
self.assertEqual(contexts.RemoteSinksContext()(),
|
||||
{'internal_sinks': {'panko': 'panko://'},
|
||||
'event_sink_publisher':
|
||||
'notifier://?topic=alarm.all'})
|
||||
|
||||
self.test_config.set('events-publisher', 'gnocchi')
|
||||
self.assertEqual(contexts.CustomSinksContext()(),
|
||||
self.assertEqual(contexts.RemoteSinksContext()(),
|
||||
{'internal_sinks': {'panko': 'panko://'},
|
||||
'event_sink_publisher':
|
||||
'gnocchi://'})
|
||||
|
||||
@patch.object(contexts, 'get_os_codename_package')
|
||||
def test_custom_sink_context_with_single_config(self, mock_get_rel):
|
||||
def test_remote_sink_context_with_single_config(self, mock_get_rel):
|
||||
mock_get_rel.return_value = 'mitaka'
|
||||
self.relation_ids.return_value = ['meter-service:0']
|
||||
self.os_release.return_value = 'mitaka'
|
||||
self.test_config.set('remote-sink', 'http://foo')
|
||||
self.test_config.set('meter-sink', 'http://foo1')
|
||||
self.assertEqual(contexts.CustomSinksContext()(),
|
||||
self.assertEqual(contexts.RemoteSinksContext()(),
|
||||
{'remote_sinks': ['http://foo'],
|
||||
'meter_sinks': ['http://foo1'],
|
||||
'event_sink_publisher': None})
|
||||
|
||||
mock_get_rel.return_value = 'queens'
|
||||
self.assertEqual(contexts.CustomSinksContext()(),
|
||||
self.assertEqual(contexts.RemoteSinksContext()(),
|
||||
{'remote_sinks': ['http://foo'],
|
||||
'meter_sinks': ['http://foo1'],
|
||||
'event_sink_publisher':
|
||||
'notifier://?topic=alarm.all'})
|
||||
|
||||
self.test_config.set('events-publisher', 'gnocchi')
|
||||
self.assertEqual(contexts.CustomSinksContext()(),
|
||||
self.assertEqual(contexts.RemoteSinksContext()(),
|
||||
{'remote_sinks': ['http://foo'],
|
||||
'meter_sinks': ['http://foo1'],
|
||||
'event_sink_publisher':
|
||||
'gnocchi://'})
|
||||
|
||||
@patch.object(contexts, 'get_os_codename_package')
|
||||
def test_custom_sink_context_with_multiple_config(self, mock_get_rel):
|
||||
def test_remote_sink_context_with_multiple_config(self, mock_get_rel):
|
||||
mock_get_rel.return_value = 'mitaka'
|
||||
self.relation_ids.return_value = ['meter-service:0']
|
||||
self.os_release.return_value = 'mitaka'
|
||||
self.test_config.set('remote-sink', 'http://foo http://bar')
|
||||
self.test_config.set('meter-sink', 'http://foo1 http://bar1')
|
||||
self.assertEqual(contexts.CustomSinksContext()(),
|
||||
self.assertEqual(contexts.RemoteSinksContext()(),
|
||||
{'remote_sinks': ['http://foo', 'http://bar'],
|
||||
'meter_sinks': ['http://foo1', 'http://bar1'],
|
||||
'event_sink_publisher': None})
|
||||
|
||||
mock_get_rel.return_value = 'queens'
|
||||
self.assertEqual(contexts.CustomSinksContext()(),
|
||||
self.assertEqual(contexts.RemoteSinksContext()(),
|
||||
{'remote_sinks': ['http://foo', 'http://bar'],
|
||||
'meter_sinks': ['http://foo1', 'http://bar1'],
|
||||
'event_sink_publisher':
|
||||
'notifier://?topic=alarm.all'})
|
||||
|
||||
self.test_config.set('events-publisher', 'gnocchi')
|
||||
self.assertEqual(contexts.CustomSinksContext()(),
|
||||
self.assertEqual(contexts.RemoteSinksContext()(),
|
||||
{'remote_sinks': ['http://foo', 'http://bar'],
|
||||
'meter_sinks': ['http://foo1', 'http://bar1'],
|
||||
'event_sink_publisher':
|
||||
'gnocchi://'})
|
||||
|
||||
|
|
Loading…
Reference in New Issue