This artical explains how to expose HiveMQ Prometheus metrics in DataDog using the HiveMQ operator
\uD83D\uDCD8 Pre-requisites
Helm version v3+
Running Kubernetes cluster version 1.18.0 or higher
kubectl latest version
\uD83D\uDCD8 Instructions
Configure the DataDog agent using the Helm chart
Add Datadog helm repository
Code Block helm repo add datadog https://helm.datadoghq.com helm repo update
Create
datadog-values.yaml
. For full values check here
Please refer to following the example ofdatadog-values.yaml
Code Block logLevel: DEBUG targetSystem: "linux" datadog: apiKey: <api key> #Logs configurations logs: enabled: true containerCollectAll: true containerCollectUsingFiles: true #Plesse configure this setting based on your region site: datadoghq.eu # datadog.kubelet.tlsVerify should be `false` on kind and minikube # to establish communication with the kubelet kubelet: tlsVerify: false clusterAgent: replicas: 2 createPodDisruptionBudget: true
install Datadog agent using Helm
Code Block helm install -f datadog-values.yaml <release name> datadog/datadog -n <namespace>
Verify installation and check the agent pod’s status
Code Block kubectl get pods
Also, check the agent’s log’s to confirm.
Install HiveMQ using Operator
The HiveMQ Kubernetes Operator provides seamless integration with the Prometheus Operator. Use the
monitoring
field to enable Prometheus and an associated Grafana dashboard. Metrics are exposed on port 9399.Configure
hivemq-values.yaml
based on your requirement and then add podAnnotations for Datadog to auto-discover HiveMQ metrics. Check here for more details and configurations.
Please find below a minimalist config example ofhivemq-values.yaml
Code Block hivemq: image: hivemq/hivemq4:k8s-4.9.0 imagePullPolicy: Always cpu: 8 memory: 8Gi nodeCount: "2" podAnnotations: ad.datadoghq.com/hivemq.check_names: '[\"openmetrics\"]' ad.datadoghq.com/hivemq.init_configs: '[{}]' ad.datadoghq.com/hivemq.instances: | [ { \"openmetrics_endpoint\": \"http://%%host%%:9399/metrics\", \"max_returned_metrics\": 10000, \"metrics\": [\".*\"] } ] ports: - name: "mqtt" port: 1883 expose: true patch: - '[{"op":"add","path":"/spec/selector/hivemq.com~1node-offline","value":"false"},{"op":"add","path":"/metadata/annotations","value":{"service.spec.externalTrafficPolicy":"Local"}}]' - name: "cc" port: 8080 expose: true patch: - '[{"op":"add","path":"/spec/sessionAffinity","value":"ClientIP"}]' monitoring: enabled: true dedicated: false
Install hivemq using the following command
Code Block helm upgrade --install -f hivemq-values.yaml <release name> hivemq/hivemq-operator
verify installation
Code Block kubectl get pods
Login to your Datadog account and click “Metrics” =>” Explorer” from the left navigation links. You will be redirected to the “Graph your data” page. By default, you will see “
system.cpu.user
" metrics and their data.
Type com_hivemq in the search box and you should be able to see the list of available hivemq metrics.
\uD83D\uDCCB Related articles
Filter by label (Content by label) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|