From 04f4e74709069f578518eb6653e3b9f1a2282b01 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Tue, 26 Mar 2024 00:30:54 -0400 Subject: [PATCH] kandra: Enable per-object metrics from rabbitmq. These default to off, because in situations with thousands of queues, consumers, and producers, they cause unreasonable overhead. Our use case has few enough queues that we do want to be able to inspect them individually. Enable per-object Prometheus metrics, per [1]. [1]: https://github.com/rabbitmq/rabbitmq-server/tree/78851828ecd1dddab2c890aaedfed7d6559dcd6e/deps/rabbitmq_prometheus#configuration --- puppet/kandra/manifests/prometheus/rabbitmq.pp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/puppet/kandra/manifests/prometheus/rabbitmq.pp b/puppet/kandra/manifests/prometheus/rabbitmq.pp index 4ac6378da5..e2819ee224 100644 --- a/puppet/kandra/manifests/prometheus/rabbitmq.pp +++ b/puppet/kandra/manifests/prometheus/rabbitmq.pp @@ -10,5 +10,10 @@ class kandra::prometheus::rabbitmq { unless => 'grep -q rabbitmq_prometheus /etc/rabbitmq/enabled_plugins', require => Service['rabbitmq-server'], } + exec { 'enable rabbitmq-prometheus-per-metric': + command => "rabbitmqctl eval 'application:set_env(rabbitmq_prometheus, return_per_object_metrics, true).'", + unless => "rabbitmqctl eval 'application:get_env(rabbitmq_prometheus, return_per_object_metrics).' | grep -q true", + require => Exec['enable rabbitmq-prometheus'], + } kandra::firewall_allow { 'rabbitmq': port => '15692' } }