Monitoring HiveMQ Swarm Instances with HiveMQ Operator and Prometheus
This article provides instructions on how to scrape metrics for HiveMQ Swarm instances in HiveMQ’s Prometheus when using the HiveMQ operator.
Prerequisites
The Kubernetes cluster is set up and operational on your preferred cloud provider.
Kubernetes version 1.16+ is installed.
Helm version 3 is installed.
The HiveMQ Kubernetes operator repository is added to the Helm repository.
Running HiveMQ cluster using Helm chart with the following configurations:
monitoring: enabled: true dedicated: true
Running Swarm cluster using Helm chart with the following configurations:
monitoring: enabled: true dedicated: false
Instructions
Edit your values.yaml file to configure the reading/scraping of metrics from Swarm agents. Add the following configurations to values.yaml:
kube-prometheus-stack: prometheus: prometheusSpec: serviceMonitorSelector: matchLabels: release: hivemq --- your hivemq deployment name release: swarm. --- your swarm deployment name
redeploy hivemq
Access Grafana and navigate to Dashboards. Search for the "HiveMQ Swarm" dashboard. If it is not available, you can download it and import it into Grafana.
The Swarm dashboard should now display the relevant data.