By clicking “Accept All Cookies”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.
title
Best-practices and guides for Grafana

Installing mqtt-datasource in Grafana

Learn how to add MQTT live data to Grafana by installing the mqtt-datasource plugin in the Grafana Helm Chart.

Installing mqtt-datasource in Grafana

The mqtt-datasource plugin allows you to see live data from MQTT in Grafana. Here is a step-by-step guide on how to install it in the Grafana Helm Chart.

ℹ️
This datasource is community-supported only. If you have questions, refer to our GitHub or Discord channel. Thanks to DanielH for his contribution and testing.

Instructions

  1. Go to UMHLens / OpenLens and navigate to Helm -> Releases.
  2. Change the Grafana section in the Helm Chart.
  3. In the section extraInitContainers, add the following additional container:
extraInitContainers: 
 - args:
    - mkdir -p /var/lib/grafana/plugins
      && cd /var/lib/grafana/plugins
      && apk add mage --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
      && apk add git
      && git clone https://github.com/grafana/mqtt-datasource.git
      && cd mqtt-datasource
      && yarn install
      && yarn build
    command:
    - /bin/sh
    - -c
    image: node:lts-alpine3.16
    imagePullPolicy: IfNotPresent
    name: init-mqtt-datasource
    securityContext:
      privileged: true
      runAsUser: 0
    volumeMounts:
    - mountPath: /var/lib/grafana
      name: storage