Philipp’s Playground in the Cloud

15 Jun 2021

IOT Monitoring Grafanalabs

I think I have not written a lot about my IOT deployment so far but the following post covers an adjustment of the architecture I have worked on recently.

In order to handle the data (temperature) which my ESP8266 deployment is producing I decided to scrape and store the data using Prometheus and then visualize it through Grafana. Both tools were initially deployed on a Kubernetes cluster which I had running “on-premise” (aka on the Intel NUC under my desk). Unfortunately this deployment was not overly reliable. It seemed that the Kubernetes cluster was often not available whenever I wanted to send and visualize data. So I had a look around for improvements without actually replacing the tool stack. I was looking for a managed Grafana deployment and this is when I came across Grafana Cloud, which is an offering from Grafana Labs. They offer a free plan which allows (amongst other things) for 10000 series for Prometheus metrics which they store with a 14 day retention. This is more than enough for me currently. Visualizing the metrics stored in their Prometheus backend is done through a hosted instance of Grafana.

A scrape configuration would need to be added to the Prometheus server, if one would configure their own Prometheus system for data ingestion. The server then pulls the data. Grafana Labs have released the Grafana Agent in order to be able to push data to their Prometheus backend. They state: “Grafana Agent uses less memory on average than Prometheus – by doing less (only focusing on remote_write-related functionality)". The Grafana Agent works well with my setup, the only downside I am seeing with this is that I need compute capacity to run the agent. I did not want to deploy the agent on-premise again so I decided for the time being to run a very small droplet (VM) on Digitalocean that would host the agent as a docker container. I am sure this setup can be improved. Maybe with something that runs on a hosted container instance platform where I can dynamically start and stop containers and don’t have the long-living VM running all the time.

Below is an updated picture of the current architecture for my overall IOT deployment.

IOT Updated Architecture Grafanalabs