BalenaHub block to capture device / application metrics with Prometheus

This is really cool! I wonder if there is a way to wire this up with the Balena Local UI project happening over at Good Starting Place for Local Balena Device UI - #51 by Maggie

:thinking: perhaps this could node-exporter could be used as another datasource beside systeminformation?

1 Like

Not really familiar with Prometheus. Is it a way to show graphs of device stats? Does it add some other features? If there is JSON exported you could just feed that in to a chart. Although without knowing more about it, and just based on the screenshots it would probably make more sense just to build a dashboard around the pre-existing systeminfo endpoint already in the UI, and just add some eye candy with ChartsJs Getting Started | Chart.js or echarts Examples - Apache ECharts. It would be far less resource intensive.

Here’s an example in Quasar that components could be pulled directly from: GitHub - pratik227/quasar-echarts: Demo Project using Quasar and ECharts 5. https://quasar-echarts-v5.netlify.app/. Would just have to plug in the system info metrics.

Or Apex charts even more ready to go. Looks like a nicer way to structure the files and already in Vue 3: GitHub - patrickmonteiro/quasar-apexcharts: 📊 📈 📉 Project using Quasar Framework and ApexCharts.

I’m talking in terms of the user interface integration of course. If I just wanted the dashboard would just fire up this new block. :slight_smile:

2 Likes

Prometheus is the engine that scrapes metrics from a load of devices as a time series, and that data can then be used by a visualisation engine like Grafana.

I do quite fancy having a Grafana block available actually. I might have a look at that…?

2 Likes

Ah nice, so you could aggregate and navigate stats from multiple devices and log it. Looks like alerts too. :+1: .

2 Likes

Yeah so I am kind of playing around here as ever but I really want to have this node-exporter stuff running on a URL behind the main port 80 e.g. my-device.balena.com/metrics so it can be accessed via the public URL (probs with some authentication). That would mean we could enable device stats without hogging the port, and then a Prometheus server could scrape metrics from many fleets of devices which I think would be awesome from the DevOps side of things…

I don’t think that’s actually too hard to do. I have been working on a Traefik block which would operate alongside the Prometheus-exporter block to achieve this :slight_smile:

That off-the-shelf Grafana dashboard up above is AWESOME in terms of all the device stuff it displays and you can configure exporters to export application specific information which I think would be really really cool for embedded systems

2 Likes

A Traefik block is just what the doctor ordered!

2 Likes