This is certainly not the first time ever that somebody needed to generate syntheric IoT telemetry for InfluxDB. Instead of writing code/scripts to achieve that goal, we can leverage existing tools to do the heavy lifting for us.
This repo demonstrates how to simulate synthetic IoT telemetry and ingest it into InfluxDB OSS. The telemetry is generated using the Azure IoT Device Telemetry Simulator. The Simulator is capable of sending data to a Confluent Community Kafka broker. Telegraf is then used to consume the telemetry from Kafka and ingest it into InfluxDB. The entire flow is orchestrated using Docker Compose.
docker compose up
- Wait for the containers to be up and running and for log messages to confirm that telemetry is being sent.
- Open http://localhost:8086 in the browser and login with the InfluxDB credentials specified in thhe
.env
file. - In the Influx Query Editor, try the following Flux query to visualize the raw data.
from(bucket: "ts-bucket")
|> range(start: -15m)
- All credentials are stored in the
.env
file. - To modify the telemetry payload, the env vars
Template
andVariables
under theiot-telemetry-simulator
service indocker-compose.yml
can be used. - To configure the JSON parsing and Influx DB measurements, please modify
telegraf.conf
accordingly. A reference Telegraf config can be generated by executing
docker run --rm telegraf telegraf config > default-telegraf.conf
To validate that the Simulator is working E2E, we can execute the script smoke-test.sh
.