Graphing firmware version strings

125 views
Skip to first unread message

Elliott Balsley

unread,
Oct 13, 2023, 8:06:05 PM10/13/23
to Prometheus Users
I'd like to track firmware versions for a large fleet of hardware devices and wondering if Prometheus is suitable for this task.  The data comes from a json API, as shown in the example below, where the firmware version is "1.7.8".  (I've redacted extra information to make a minimal working example.)

I set this up as a module in json-exporter with firmwareVersion as a label; the problem is it creates a new time series every time a firmware version is updated.  I'd like to visualize this in Grafana with a state timeline where the X axis is a stack of each device by name, the Y axis is time, and each bar shows the firmware version string.

image.png

This is the closest I have come using Grafana transformations, this looks good except it only works for a single device, because I've lost the device name label.
image.png

{

  "general": {

    "schemaVersion": "1",

    "environment": "production",

    "deviceName": "RA32S-703752",

    "firmwareVersion": "1.7.8",

    "https": false

  },

  "debug": {

    "uptime": 225

  }

}


modules:
roomalert:
metrics:
- name: uptime
path: '{.debug.uptime}'
valuetype: counter
labels:
firmwareVersion: '{.general.firmwareVersion}'
serial: '{.general.serialNumber}'

Brian Candler

unread,
Oct 14, 2023, 4:38:36 AM10/14/23
to Prometheus Users
I'd like to track firmware versions for a large fleet of hardware devices and wondering if Prometheus is suitable for this task.  The data comes from a json API, as shown in the example below, where the firmware version is "1.7.8".  (I've redacted extra information to make a minimal working example.)

I set this up as a module in json-exporter with firmwareVersion as a label; the problem is it creates a new time series every time a firmware version is updated.

That's all fine: a small amount of metric churn on each firmware update is not a problem. Conventionally such a metric would have a static value of 1, which makes it easier to use in join queries, but using its value for upTime as well shouldn't be a problem.

Here's some background documentation for this way of working:

Metrics like node_uname_info and node_os_info work this way.

I'd like to visualize this in Grafana with a state timeline where the X axis is a stack of each device by name, the Y axis is time, and each bar shows the firmware version string.

That is a Grafana question rather than a Prometheus question, so is probably best asked on community.grafana.com.

I can tell you that I did set this up on a system to display state changes of drives in MegaRAID arrays from prometheus labels, and it worked fine.  It had horizontal bars, with time on the X axis and the drive name and drive ID+state on the Y axis.  I'm afraid that since I no longer have access to that system, I can't give you its exact config.

but that looks more complicated than I thought I had done.
Reply all
Reply to author
Forward
0 new messages