Skip to content

Commit 5284805

Browse files
committed
Support disabling Monasca alerting pipeline
The Monasca alerting pipeline provides multi-tenancy alerts and notifications. It runs as an Apache Storm topology and generally places a significant memory and CPU burden on monitoring hosts, particularly when there are lot of metrics. This is fine if the alerting service is in use, but sometimes it is not. For example you may use Prometheus for monitoring the control plane, and wish to offer tenants a monitoring service via Monasca without alerting and notification functionality. In this case it makes sense to disable this part of the Monasca pipeline and this patch adds support for that. If the service is ever re-enabled, all alerts and notifications should spawn back automatically since they are persisted in the central mysql database cluster. Change-Id: I84aa04125c621712f805f41c8efbc92c8e156db9
1 parent 59f0c81 commit 5284805

File tree

8 files changed

+69
-13
lines changed

8 files changed

+69
-13
lines changed

ansible/group_vars/all.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ enable_searchlight: "no"
684684
enable_senlin: "no"
685685
enable_skydive: "no"
686686
enable_solum: "no"
687-
enable_storm: "{{ enable_monasca | bool }}"
687+
enable_storm: "{{ enable_monasca | bool and monasca_enable_alerting_pipeline | bool }}"
688688
enable_swift: "no"
689689
enable_swift_s3api: "no"
690690
enable_swift_recon: "no"
@@ -718,6 +718,8 @@ enable_destroy_images: "no"
718718
####################
719719
# Monasca options
720720
####################
721+
monasca_enable_alerting_pipeline: True
722+
721723
monasca_api_admin_base_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ monasca_api_port }}"
722724
monasca_api_internal_base_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ monasca_api_port }}"
723725
monasca_api_public_base_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn | put_address_in_context('url') }}:{{ monasca_api_port }}"

ansible/monasca_cleanup.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@
1212
roles:
1313
- { role: monasca,
1414
tags: monasca }
15+
16+
- name: Cleanup unused Storm services
17+
hosts:
18+
- storm-worker
19+
- storm-nimbus
20+
roles:
21+
- { role: storm,
22+
tags: storm }

ansible/roles/monasca/defaults/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ monasca_services:
4646
monasca-thresh:
4747
container_name: monasca_thresh
4848
group: monasca-thresh
49-
enabled: true
49+
enabled: "{{ monasca_enable_alerting_pipeline | bool }}"
5050
image: "{{ monasca_thresh_image_full }}"
5151
volumes: "{{ monasca_thresh_default_volumes + monasca_thresh_extra_volumes }}"
5252
dimensions: "{{ monasca_thresh_dimensions }}"
5353
monasca-notification:
5454
container_name: monasca_notification
5555
group: monasca-notification
56-
enabled: true
56+
enabled: "{{ monasca_enable_alerting_pipeline | bool }}"
5757
image: "{{ monasca_notification_image_full }}"
5858
volumes: "{{ monasca_notification_default_volumes + monasca_notification_extra_volumes }}"
5959
dimensions: "{{ monasca_notification_dimensions }}"
@@ -186,23 +186,23 @@ monasca_all_topics:
186186
- name: "{{ monasca_events_topic }}"
187187
partitions: "{{ monasca_default_topic_partitions }}"
188188
replication_factor: "{{ monasca_default_topic_replication_factor }}"
189-
enabled: True
189+
enabled: "{{ monasca_enable_alerting_pipeline | bool }}"
190190
- name: "{{ monasca_alarm_state_transitions_topic }}"
191191
partitions: "{{ monasca_default_topic_partitions }}"
192192
replication_factor: "{{ monasca_default_topic_replication_factor }}"
193-
enabled: True
193+
enabled: "{{ monasca_enable_alerting_pipeline | bool }}"
194194
- name: "{{ monasca_alarm_notifications_topic }}"
195195
partitions: "{{ monasca_default_topic_partitions }}"
196196
replication_factor: "{{ monasca_default_topic_replication_factor }}"
197-
enabled: True
197+
enabled: "{{ monasca_enable_alerting_pipeline | bool }}"
198198
- name: "{{ monasca_alarm_notifications_retry_topic }}"
199199
partitions: "{{ monasca_default_topic_partitions }}"
200200
replication_factor: "{{ monasca_default_topic_replication_factor }}"
201-
enabled: True
201+
enabled: "{{ monasca_enable_alerting_pipeline | bool }}"
202202
- name: "{{ monasca_periodic_notifications_topic }}"
203203
partitions: "{{ monasca_default_topic_partitions }}"
204204
replication_factor: "{{ monasca_default_topic_replication_factor }}"
205-
enabled: True
205+
enabled: "{{ monasca_enable_alerting_pipeline | bool }}"
206206

207207
# NOTE(dszumski): Due to the way monasca-notification is currently
208208
# implemented it is not recommended to change this period.

ansible/roles/monasca/templates/monasca-persister/persister.conf.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ port = {{ monasca_influxdb_http_port }}
1515
legacy_kafka_client_enabled = False
1616

1717
[kafka_alarm_history]
18+
{% if not monasca_enable_alerting_pipeline | bool %}
19+
enabled = False
20+
{% else %}
1821
uri = {{ monasca_kafka_servers }}
1922
topic = {{ monasca_alarm_state_transitions_topic }}
2023
num_processors = 1
24+
{% endif %}
2125

2226
[kafka_metrics]
2327
uri = {{ monasca_kafka_servers }}

ansible/roles/storm/defaults/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ storm_services:
55
storm-worker:
66
container_name: storm_worker
77
group: storm-worker
8-
enabled: true
8+
enabled: "{{ enable_storm | bool }}"
99
image: "{{ storm_image_full }}"
1010
environment:
1111
STORM_LOG_DIR: /var/log/kolla/storm
@@ -15,7 +15,7 @@ storm_services:
1515
storm-nimbus:
1616
container_name: storm_nimbus
1717
group: storm-nimbus
18-
enabled: true
18+
enabled: "{{ enable_storm | bool }}"
1919
image: "{{ storm_image_full }}"
2020
environment:
2121
STORM_LOG_DIR: /var/log/kolla/storm
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
- name: Stop and remove containers for Storm services
3+
become: true
4+
kolla_docker:
5+
action: "stop_and_remove_container"
6+
name: "{{ item.value.container_name }}"
7+
when:
8+
- inventory_hostname in groups[item.value.group]
9+
- not item.value.enabled | bool
10+
with_dict: "{{ storm_services }}"
11+
12+
- name: Removing config for any disabled services
13+
file:
14+
path: "{{ node_config_directory }}/{{ item.key }}"
15+
state: "absent"
16+
become: true
17+
when:
18+
- inventory_hostname in groups[item.value.group]
19+
- not item.value.enabled | bool
20+
with_dict: "{{ storm_services }}"
21+
22+
# NOTE(dszumski): Docker volume removal is currently a manual procedure

doc/source/reference/logging-and-monitoring/monasca-guide.rst

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ Enable Monasca in ``/etc/kolla/globals.yml``:
3838
3939
enable_monasca: "yes"
4040
41+
If you wish to disable the alerting and notification pipeline to reduce
42+
resource usage you can set ``/etc/kolla/globals.yml``:
43+
44+
.. code-block:: yaml
45+
46+
monasca_enable_alerting_pipeline: "no"
47+
4148
Currently Monasca is only supported using the ``source`` install type Kolla
4249
images. If you are using the ``binary`` install type you should set the
4350
following override in ``/etc/kolla/globals.yml``:
@@ -330,6 +337,9 @@ which you must run the cleanup command is given below:
330337
Wallaby.
331338
- Upgrading from Wallaby to Xena to remove the Monasca Log Metrics service
332339
if the option to disable it by default was overridden in Wallaby.
340+
- If you have disabled the alerting pipeline via the
341+
`monasca_enable_alerting_pipeline` flag after you have deployed the alerting
342+
services.
333343

334344
The cleanup command can be invoked from the Kolla Ansible CLI, for example:
335345

@@ -361,7 +371,7 @@ System requirements and performance impact
361371
Monasca will deploy the following Docker containers:
362372

363373
* Apache Kafka
364-
* Apache Storm
374+
* Apache Storm (optional)
365375
* Apache Zookeeper
366376
* Elasticsearch
367377
* Grafana
@@ -374,9 +384,9 @@ Monasca will deploy the following Docker containers:
374384
* Monasca Log API
375385
* Monasca Log Metrics (Logstash, optional, deprecated)
376386
* Monasca Log Persister (Logstash)
377-
* Monasca Notification
387+
* Monasca Notification (optional)
378388
* Monasca Persister
379-
* Monasca Thresh (Apache Storm topology)
389+
* Monasca Thresh (Apache Storm topology, optional)
380390

381391
In addition to these, Monasca will also utilise Kolla deployed MariaDB,
382392
Keystone, Memcached and HAProxy/Keepalived. The Monasca Agent containers
@@ -393,6 +403,10 @@ multi-core CPU. You will also need enough space to store metrics and logs,
393403
and to buffer these in Kafka. Whilst Kafka is happy with spinning disks,
394404
you will likely want to use SSDs to back InfluxDB and Elasticsearch.
395405

406+
If resources are tight, it is possible to disable the alerting and
407+
notification pipeline which removes the need for Apache Storm, Monasca
408+
Thresh and Monasca Notification. This can have a significant effect.
409+
396410
Security impact
397411
~~~~~~~~~~~~~~~
398412

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
features:
3+
- |
4+
Support has been added to optionally disable the Monasca alerting
5+
pipeline. This can be helpful to reduce resource consumption on
6+
Monasca service hosts if the alerting pipeline is not in use.

0 commit comments

Comments
 (0)