\uD83E\uDD14 Problem
No data is displayed in the Grafana “HiveMQ Cluster” Dashboard, after installing the hivemq-operator with:
helm upgrade ${hivemqRelease} --install 'hivemq/hivemq-operator' \ --namespace ${namespace} \ --set monitoring.enabled=true \ --set monitoring.dedicated=true \ --set kube-prometheus-stack.prometheusOperator.admissionWebhooks.patch.image.repository=k8s.gcr.io/ingress-nginx/kube-webhook-certgen \ --set kube-prometheus-stack.prometheusOperator.admissionWebhooks.patch.image.tag=v1.1.1 ...
where:
${hivemqRelease}
is your release name for the hivemq deployment;${namespace}
is the namespace you want to install the hivemq-operator.
\uD83C\uDF31 Solution
It might happen because Prometheus is missing Service Monitor – a custom resource defining from where to scrape the data.
Prepare a manifest definition for the Service Monitor,
monitorService.yaml
:apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: hivemq-cluster: ${hivemqRelease} release: ${hivemqRelease} name: hivemq spec: endpoints: - port: metrics jobLabel: hivemq selector: matchLabels: hivemq-cluster: ${hivemqRelease} app: hivemq
Do substitute
${hivemqRelease}
with the actual name you gave to the hivemq-operator deployment.Apply the manifest
kubectl apply -f monitorService.yaml --namespace ${namespace}
When all hivemq-pods are running and all their containers are ready, go to the Grafana and check if the data is updating in the “HiveMQ Cluster” dashboard.
This is tested with Kubernetes API v1.23 and hivemq-operator versions up to Chart 0.11.11, App 4.11.0, hivemq/hivemq-operator:4.7.9