diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index d95d8e59fa..44f76bbf40 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -430,6 +430,7 @@ prometheus_node_exporter_port: "9100" prometheus_mysqld_exporter_port: "9104" prometheus_haproxy_exporter_port: "9101" prometheus_memcached_exporter_port: "9150" +prometheus_rabbitmq_exporter_port: "15692" # Default cadvisor port of 8080 already in use prometheus_cadvisor_port: "18080" @@ -1077,6 +1078,7 @@ enable_prometheus_ceph_mgr_exporter: "no" enable_prometheus_openstack_exporter: "{{ enable_prometheus | bool }}" enable_prometheus_elasticsearch_exporter: "{{ enable_prometheus | bool and enable_elasticsearch | bool }}" enable_prometheus_blackbox_exporter: "{{ enable_prometheus | bool }}" +enable_prometheus_rabbitmq_exporter: "{{ enable_prometheus | bool and enable_rabbitmq | bool }}" prometheus_alertmanager_user: "admin" prometheus_openstack_exporter_interval: "60s" diff --git a/ansible/roles/prometheus/templates/prometheus.yml.j2 b/ansible/roles/prometheus/templates/prometheus.yml.j2 index fa0aabba02..44e5226f5f 100644 --- a/ansible/roles/prometheus/templates/prometheus.yml.j2 +++ b/ansible/roles/prometheus/templates/prometheus.yml.j2 @@ -47,6 +47,15 @@ scrape_configs: {% endfor %} {% endif %} +{% if enable_prometheus_rabbitmq_exporter | bool %} + - job_name: rabbitmq + static_configs: + - targets: +{% for host in groups['rabbitmq'] %} + - '{{ 'api' | kolla_address(host) | put_address_in_context('url') }}:{{ hostvars[host]['prometheus_rabbitmq_exporter_port'] }}' +{% endfor %} +{% endif %} + {% if enable_prometheus_memcached_exporter | bool %} - job_name: memcached static_configs: diff --git a/releasenotes/notes/prometheus-rabbitmq-f7d6ebf0d611a819.yaml b/releasenotes/notes/prometheus-rabbitmq-f7d6ebf0d611a819.yaml new file mode 100644 index 0000000000..018999a95e --- /dev/null +++ b/releasenotes/notes/prometheus-rabbitmq-f7d6ebf0d611a819.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Adds support for collecting Prometheus metrics from RabbitMQ. This is + enabled by default when Prometheus and RabbitMQ are enabled, and may be + disabled by setting ``enable_prometheus_rabbitmq_exporter`` to ``false``.