Implementing the Monitoring Dashboard for the HiveMQ Platform Operator

Implementing the Monitoring Dashboard for the HiveMQ Platform Operator

The HiveMQ Platform Operator 1.7.0 Helm chart introduces a new Grafana dashboard with expanded monitoring capabilities for both the operator process and associated HiveMQ Platform deployments. The updated dashboard offers key insights, including uptime, start time, and heap usage of the operator process.

This article provides a basic step-by-step guide on configuring the Monitoring Dashboard for the HiveMQ Platform Operator. Please note that the exact steps may vary depending on your Kubernetes cluster implementation.

 Pre-requisites

  • Running Kubernetes cluster version 1.23.x or higher

  • Helm version 3.10.x or higher

  • The HiveMQ Platform Operator 1.7.0 Helm chart or higher

  • The Kubernetes command line tool kubectl

 Instructions

Deploying Prometheus + Grafana Stack

To visualize metrics, you can use a monitoring stack consisting of Prometheus and Grafana on Kubernetes along with the HiveMQ Helm charts. To simplify and ease the monitoring of the HiveMQ Platform Operator and HiveMQ Platform, the HiveMQ Helm charts can provide a Prometheus ServiceMonitor resource along with the corresponding Grafana dashboard available via a ConfigMap.

The following steps show how to install Prometheus and Grafana and how to configure the HiveMQ Helm charts to monitor HiveMQ:

  1. Add the Prometheus community Helm charts to your local Helm repository:

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
  1. Create a dedicated Kubernetes namespace for monitoring:

kubectl create namespace monitoring
  1. Install the monitoring stack into the new namespace:

helm upgrade --install monitoring-stack prometheus-community/kube-prometheus-stack -n monitoring

 

Deploying HiveMQ Platform Operator

  1. Add the HiveMQ Helm repository to your local Helm setup:

helm repo add hivemq https://hivemq.github.io/helm-charts

You can configure how Helm installs your HiveMQ Platform Operator. The Helm chart’s values.yaml file defines the default values and configuration parameters that are available.

  1. To adjust the default values in the values.yaml, export the possible configuration values to a file named operator-values.yaml:

helm show values hivemq/hivemq-platform-operator > operator-values.yaml
  1. Edit the operator-values.yaml and uncomment the following section to your HiveMQ Platform Operator operator-values.yaml configuration file:

# Enables the ServiceMonitor resource and Grafana dashboard creation for the operator. monitoring: # Defines whether the monitoring configuration for the HiveMQ Platform Operator is enabled. The default setting is `false`. enabled: true # Dashboard configuration options. dashboard: # Boolean value that configures whether to use the default HiveMQ Platform Operator Grafana dashboard ConfigMap. The default setting is `true`. create: true # Namespace where to deploy the Grafana dashboard ConfigMap. Defaults to the namespace of the HiveMQ Platform Operator. # namespace: monitoring # Sets the Grafana dashboard content for the HiveMQ Platform Operator Grafana dashboard ConfigMap with your own JSON file from a specified path. overrideDashboard: "" # Prometheus ServiceMonitor configuration options. serviceMonitor: # Namespace where to deploy the ServiceMonitor. Defaults to the namespace of the HiveMQ Platform Operator. # namespace: monitoring # Helm chart release name of the Prometheus Monitoring stack installed. Defaults to the HiveMQ Platform Operator Helm chart release name. releaseName: monitoring-stack # Defines how often Prometheus scrapes metrics from the operator endpoints. # Example of a valid format are `1d`, `1h30m`, `5m`, `10s`. Defaults to 15 seconds. interval: 15s # Defines the maximum duration allowed for scraping metrics from the endpoints defined in the ServiceMonitor resource. # Example of a valid format are `1d`, `1h30m`, `5m`, `10s`. Defaults to 10 seconds. scrapeTimeout: 10s
  1. Create a dedicated Kubernetes namespace for HiveMQ Platform Operator:

kubectl create namespace hivemq
  1. Install the HiveMQ Platform Operator with the operator-values.yaml configuration file:

helm upgrade --install hivemq-operator hivemq/hivemq-platform-operator -f operator-values.yaml -n hivemq

This command upgrades/installs the HiveMQ Platform Operator with your custom configuration.

 

Testing the Monitoring Dashboard for the HiveMQ Platform Operator

  1. Test that the Prometheus dashboard is accessible.

kubectl port-forward svc/monitoring-stack-kube-prom-prometheus 9090 -n monitoring
  1. Browse to http://localhost:9090 and view the Prometheus dashboard.

  1. Test that the Grafana dashboard is accessible.

kubectl port-forward svc/monitoring-stack-grafana 8080:80 -n monitoring
  1. Browse to http://localhost:8080 and view the Grafana dashboard.

  1. The default login credentials for the Grafana are user: admin and password: prom-operator.

  2. Navigate to Grafana HiveMQ Platform Operator (Prometheus) Dashboard.

Use the dashboard for a comprehensive overview of all HiveMQ Platform states the operator manages. The dashboard provides detailed views to monitor the state of your HiveMQ Platform clusters from the operator's perspective.

Reference Documentation:

Monitoring with Prometheus

Install HiveMQ Platform Operator with Helm