Setting up Grafana for HiveMQ Monitoring in Kubernetes

In this guide, we will demonstrate how to configure and deploy the HiveMQ Dashboard in Grafana, empowering you to monitor your HiveMQ instances with precision.

 Instructions

  1. To begin, download and rename to hivemq-dashboard.json. Then create a ConfigMap named "hivemq-dashboard" using the hivemq-dashboard.json file:

    kubectl create configmap 'hivemq-dashboard' \ --from-file hivemq-dashboard.json \ --namespace hivemq-namespace
  2. Add the Grafana repository to Helm.:

    helm repo add grafana https://grafana.github.io/helm-charts helm repo update
  3. Retrieve the Grafana configuration values and save them to a file named grafana-values.yaml:

    helm show values grafana/grafana > grafana-values.yaml
  4. Edit the grafana-values.yaml file to incorporate the HiveMQ dashboard into dashboardsConfigMaps as follows:

    Grafana will automatically mount the config map "hivemq-dashboard" to the directory /var/lib/grafana/dashboards/hivemq-dashboard within the Grafana container.

  5. Add a Dashboard Provider configuration with the same name as the dashboard ('hivemq-dashboard'). Specify the path as /var/lib/grafana/dashboards/hivemq-dashboard and assign it to the "HiveMQ" folder:

  6. Deploy Grafana with the customized values:

  7. Upon successful Grafana installation, retrieve the 'admin' user password by running::

  8. Facilitate access to Grafana on your local machine by forwarding the service with this command:

  9. Open your preferred web browser and navigate to http://localhost:3000. Sign in using the "admin" username and the password obtained in Step 6.

  10. To validate the presence of the HiveMQ dashboard, explore the "HiveMQ" folder located under "Dashboards" within the Grafana interface:

    Dashboards in Grafana

     

    HiveMQ Dashboard

     

You have successfully orchestrated the deployment of the HiveMQ Dashboard in Grafana, providing you with an advanced monitoring solution for your HiveMQ instances.

Tested with versions:

grafana/grafana 6.59.4 10.1.1

prometheus-community/prometheus 24.4.0 v2.47.0

hivemq/hivemq-operator 0.11.25 4.19.0

 Related articles