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

  1. The Kubernetes cluster is set up and operational on your preferred cloud provider.

  2. Kubernetes version 1.16+ is installed.

  3. Helm version 3 is installed.

  4. The HiveMQ Kubernetes operator repository is added to the Helm repository.

  5. Running HiveMQ cluster using Helm chart with the following configurations:

    1. monitoring: enabled: true dedicated: true
    2. Running Swarm cluster using Helm chart with the following configurations:

      monitoring: enabled: true dedicated: false


 Instructions

  1. 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
  2. redeploy hivemq

  3. 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.

  4. The Swarm dashboard should now display the relevant data.