LE-MQTT TO InfluxDBv2
Here is an example to run LE-MQTT-TO-InfluxDBv2 with Docker :
LE-MQTT-TO-InfluxDBv2 docker image is available at https://us-docker.pkg.dev/litmus-customer-facing/litmus-solutions-dev/le-mqtt-to-influxdbv2:latest
- MQTT Broker v3.1.1
- InfluxDB v2.x
- If the subscribed data is not published by Litmus Edge instances, it must be a valid JSON string (or object) and have the same JSON schema used by Litmus Edge.
⚠️ When using Docker, the following environment variables must be set before running the container.
Environment variables | Description | Sample value | type |
---|---|---|---|
MQTT_HOST | Broker URL for the MQTT server or cluster | tcp://localhost:1883 | String |
MQTT_TOPICS | Topics that will be subscribed to | le-mqtt-to-influxdbv2/# | String |
MQTT_QoS | QoS policy for messages. | 1 | Integer |
MQTT_CLIENT_ID | The ID to assign to the client when connecting to the broker. | LE-UniqueClientID | String |
MQTT_USERNAME | The username to connect to the MQTT server. | admin | String |
MQTT_PASSWORD | The password to connect to the MQTT server. | admin | String |
MQTT_PERSISTENT_SESSION | Persistent session disables clearing of the client session on connection. In order for this option to work you must also set MQTT_CLIENT_ID to identify the client. To receive messages that arrived while the client is offline, also set the QoS option to 1 or 2 and don't forget to also set the QoS when publishing. | true | Boolean |
MQTT_TIMEOUT | Connection timeout for initial connection in seconds. | 30s | String |
TELEGRAF_METRIC_BUFFER_LIMIT | Maximum number of unwritten metrics. Increasing this value allows for longer periods of InfluxDB downtime without dropping metrics at the cost of higher maximum memory usage. | 10000 | Integer |
TELEGRAF_BATCH_SIZE | LE-MQTT-TO-InfluxDBv2 will send metrics to InfluxDB in batches of at most TELEGRAF_BATCH_SIZE metrics. This controls the size of writes that LE-MQTT-TO-InfluxDBv2 sends to InfluxDB. | 5000 | Integer |
TELEGRAF_MAX_UNDELIVERED_MESSAGES | Maximum messages to read from the broker that have not been written to InfluxDB. For best throughput set based on the batch size TELEGRAF_BATCH_SIZE. | 5000 | Integer |
TELEGRAF_MQTT_FLUSH_INTERVAL | Period is seconds between writes to InfluxDB from MQTT topics. | 5s | String |
TELEGRAF_HC_FLUSH_INTERVAL | Period is seconds between writes to InfluxDB from internal input (LE-MQTT-TO-InfluxDBv2 statistics). | 3s | String |
TELEGRAF_HC_COLLECT_INTERVAL | Period is seconds between each collect of LE-MQTT-TO-InfluxDBv2 statistics. | 3s | String |
TELEGRAF_DEBUG | Log at debug level. | true | Boolean |
LE_NAME | Litmus Edge friendly name (used to name/identify the measurement). | LE-Local-VM | String |
INFLUX_HOST | The InfluxDB URL. | | String |
INFLUX_ORG | Organization is the name of the organization you wish to write to. | Litmus | String |
INFLUX_TOKEN | Token for authentication. | superSecureToken | String |
INFLUX_BUCKET | Destination bucket to write into. | le-mqtt-to-influxdbv2 | String |
- LE-MQTT-TO-InfluxDBv2also sends metrics about itself to InfluxDB such as the number of metrics gathered, added, written and dropped as well as the time spent in collecting and writing the metrics.
- The following InfluxDB template contains a dashboard to visualize these metrics for each instance of LE-MQTT-TO-InfluxDBv2 :
- To install the template, go to Settings, choose Templates and enter the above URL, then click the LOOKUP TEMPLALTE button :
- Under Dashboards select LE Ingestors | Performance Monitoring dashboard :