Add support rabbitmq promethues plugin

Change-Id: I1b2b3d6708bfcd58864e26e6c1fc618fb421e9a2
This commit is contained in:
zhubingbing 2019-01-03 18:57:16 +08:00
parent f01b950eba
commit 4113483354
2 changed files with 23 additions and 0 deletions

View File

@ -99,3 +99,12 @@ RUN apt-get update \
{%- endif %}
{%- endif %}
{%- endmacro %}
{% macro install_rabbitmq_plugins(plugins, version) -%}
ENV PLUGINS_DIR /usr/lib/rabbitmq/plugins
{% if plugins is defined and plugins|length > 0 -%}
{% for item in plugins %}
RUN curl -L -o ${PLUGINS_DIR}/{{ item }} https://github.com/deadtrickster/prometheus_rabbitmq_exporter/releases/download/{{ version }}/{{ item }}
{% endfor %}
{%- endif %}
{%- endmacro %}

View File

@ -51,11 +51,25 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% block rabbitmq_install_plugins %}
RUN rm -rf /var/lib/rabbitmq/* \
&& mkdir -p /usr/lib/rabbitmq/plugins \
&& /usr/lib/rabbitmq/bin/rabbitmq-plugins enable --offline \
rabbitmq_management
{% endblock %}
{% block rabbitmq_plugins_install %}
{% set rabbitmq_plugins = [
'accept-0.3.3.ez',
'prometheus-3.5.1.ez',
'prometheus_cowboy-0.1.4.ez',
'prometheus_httpd-2.1.8.ez',
'prometheus_rabbitmq_exporter-3.7.2.4.ez'
] %}
{{ macros.install_rabbitmq_plugins(rabbitmq_plugins | customizable("plugins"), version="v3.7.2.4") }}
{% endblock %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
COPY rabbitmq_get_gospel_node.py /usr/local/bin/rabbitmq_get_gospel_node
RUN chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/rabbitmq_get_gospel_node