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.
\uD83D\uDCD8 Instructions
To begin, download
and rename tohivemq-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
Add the Grafana repository to Helm.:
helm repo add grafana https://grafana.github.io/helm-charts helm repo update
Retrieve the Grafana configuration values and save them to a file named grafana-values.yaml:
helm show values grafana/grafana > grafana-values.yaml
Edit the grafana-values.yaml file to incorporate the HiveMQ dashboard into
dashboardsConfigMaps
as follows:dashboardsConfigMaps: hivemq-dashboard: "hivemq-dashboard"
Grafana will automatically mount the config map "hivemq-dashboard" to the directory /var/lib/grafana/dashboards/hivemq-dashboard within the Grafana container.
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:
dashboardProviders: dashboardproviders.yaml: apiVersion: 1 providers: - name: 'hivemq-dashboard' orgId: 1 folder: 'HiveMQ' type: file disableDeletion: false editable: true options: path: /var/lib/grafana/dashboards/hivemq-dashboard
Deploy Grafana with the customized values:
helm upgrade 'grafana' --install 'grafana/grafana' \ --values 'grafana-values.yaml' \ --namespace hivemq-namespace
Upon successful Grafana installation, retrieve the 'admin' user password by running::
kubectl get secret grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
Facilitate access to Grafana on your local machine by forwarding the service with this command:
kubectl port-forward svc/grafana 3000:80
Open your preferred web browser and navigate to http://localhost:3000. Sign in using the "admin" username and the password obtained in Step 6.
To validate the presence of the HiveMQ dashboard, explore the "HiveMQ" folder located under "Dashboards" within the Grafana interface:
You have successfully orchestrated the deployment of the HiveMQ Dashboard in Grafana, providing you with an advanced monitoring solution for your HiveMQ instances.