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]: 78851828ec/deps/rabbitmq_prometheus (configuration)
This commit is contained in:
Alex Vandiver 2024-03-26 00:30:54 -04:00 committed by Tim Abbott
parent ea5b6be433
commit 04f4e74709
1 changed files with 5 additions and 0 deletions

View File

@ -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' }
}