From 5cbce03f21cea3e6d1041afb6739280fb57e29f4 Mon Sep 17 00:00:00 2001 From: "Ritchie, Frank (fr801x)" Date: Fri, 15 Dec 2023 16:19:45 -0500 Subject: [PATCH] Enable management api metrics collection The default rabbitmq image disables metrics collection via the management api. This is implemented by adding a file named: /etc/rabbitmq/conf.d/management_agent.disable_metrics_collector.conf with the contents: management_agent.disable_metrics_collector = true The prometheus exporter currently used by osh requires this value to be false. This change was introduced when rabbit introduced the integrated prometheus exporter: https://github.com/docker-library/rabbitmq/issues/419 Change-Id: I9a94f49a7827bb4725ed3fd98404e637bfefa086 --- rabbitmq/Chart.yaml | 2 +- rabbitmq/templates/configmap-etc.yaml | 4 ++++ rabbitmq/templates/statefulset.yaml | 6 ++++++ rabbitmq/values.yaml | 1 + releasenotes/notes/rabbitmq.yaml | 1 + 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/rabbitmq/Chart.yaml b/rabbitmq/Chart.yaml index a58e570b7..9356625f8 100644 --- a/rabbitmq/Chart.yaml +++ b/rabbitmq/Chart.yaml @@ -15,6 +15,6 @@ apiVersion: v1 appVersion: v3.9.0 description: OpenStack-Helm RabbitMQ name: rabbitmq -version: 0.1.30 +version: 0.1.31 home: https://github.com/rabbitmq/rabbitmq-server ... diff --git a/rabbitmq/templates/configmap-etc.yaml b/rabbitmq/templates/configmap-etc.yaml index 88b532eea..cfa3171ce 100644 --- a/rabbitmq/templates/configmap-etc.yaml +++ b/rabbitmq/templates/configmap-etc.yaml @@ -77,4 +77,8 @@ data: rabbitmq-env.conf: | SERVER_ADDITIONAL_ERL_ARGS={{ $erlvm_scheduler_conf | quote }} {{- end }} +{{ if not .Values.conf.prometheus_exporter.rabbitmq_mgmt_metrics_collector_disabled }} + management_agent.disable_metrics_collector.conf: | + management_agent.disable_metrics_collector = false +{{- end }} {{ end }} diff --git a/rabbitmq/templates/statefulset.yaml b/rabbitmq/templates/statefulset.yaml index a8146198a..e2c7ab5e1 100644 --- a/rabbitmq/templates/statefulset.yaml +++ b/rabbitmq/templates/statefulset.yaml @@ -290,6 +290,12 @@ spec: subPath: erl_inetrc readOnly: true {{- end }} +{{- if not .Values.conf.prometheus_exporter.rabbitmq_mgmt_metrics_collector_disabled }} + - name: rabbitmq-etc + mountPath: /etc/rabbitmq/conf.d/management_agent.disable_metrics_collector.conf + subPath: management_agent.disable_metrics_collector.conf + readOnly: true +{{- end }} {{ dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.secrets.tls.oslo_messaging.server.internal "path" "/etc/rabbitmq/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} volumes: - name: pod-tmp diff --git a/rabbitmq/values.yaml b/rabbitmq/values.yaml index 071703e58..097e555aa 100644 --- a/rabbitmq/values.yaml +++ b/rabbitmq/values.yaml @@ -189,6 +189,7 @@ conf: skip_queues: "^$" include_queues: ".*" rabbit_exporters: "overview,exchange,node,queue" + rabbitmq_mgmt_metrics_collector_disabled: false # This IP could be IPv4/IPv6 and the tcp port will be appended to it and eventually it is set to rabbitmq.listeners.tcp.1 bind_address: "::" rabbitmq: diff --git a/releasenotes/notes/rabbitmq.yaml b/releasenotes/notes/rabbitmq.yaml index be6c2bf54..350bad637 100644 --- a/releasenotes/notes/rabbitmq.yaml +++ b/releasenotes/notes/rabbitmq.yaml @@ -30,4 +30,5 @@ rabbitmq: - 0.1.28 Add IPv6 environment support for rabbitmq - 0.1.29 Add build-in prometheus plugin and disable external exporter - 0.1.30 Add labels to rabbitmq service + - 0.1.31 Support management api metrics collection ...