How can I enable Prometheus extension in docker Hivemq image?

How can I enable prometheus extension in docker Hivemq image ?

Hello Rahul,

Do you want to enable the Prometheus extension for HiveMQ deployed using docker? if yes then you will need to build a custom image where the base will be a hivemq image and then copy the Prometheus extension to the extension folder. Please refer sample snippet

ARG TAG=4.7.3

FROM hivemq/hivemq4:${TAG}

...
COPY --chown=hivemq:hivemq hivemq-prometheus-extension extensions/hivemq-prometheus-extension
...

I hope this helps.

Kind regards,
Sheetal

2 Likes

I would like to know, How it will work like it will new separate instance for prometheus ?

Because I have existing one prometheus setup us running that’s where I want to point this one.

Thanks,
Rahul

Hello Rahul,

When you enable Prometheus extension for HiveMQ broker then it allows HiveMQ to expose metrics to a Prometheus application. Since you already have Prometheus setup, to gather HiveMQ metrics you will need to add a scrape configuration to your Prometheus configuration. i.e prometheus.yml
Please check here for minimal Prometheus configurations.

Kind regards
Sheetal

1 Like