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
\uD83D\uDCD8 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: app.kubernetes.io/name: hivemq-swarm
redeploy hivemq
helm upgrade --install -f values.yaml hivemq hivemq/hivemq-operator -n 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.