packages icon indicating copy to clipboard operation
packages copied to clipboard

ethtool-lua + prometheus-node-exporter-lua plugin

Open Kevinjil opened this issue 1 year ago • 4 comments

The ethtool-lua library is a partial re-implementation of the ethtool. The goal is to provide the CLI queries and configuration options as a Lua API.

The reason for starting this library, was the desire for a nice and efficient way to query DSA switch statistics in the prometheus-node-exporter-lua on OpenWRT devices. Existing suggestions around the internet focussed mainly on calling the ethtool CLI program and parsing the output. This is neither elegant nor efficient, as the collection time for this implementation was 300% higher on my rtl838x based switch running OpenWRT.

Kevinjil avatar May 08 '24 23:05 Kevinjil

@champtar Would you mind reviewing these changes?

Kevinjil avatar May 10 '24 11:05 Kevinjil

Hi @Kevinjil,

I haven't had time to fully review your work, but as those stats are also implemented in the official node-exporter, can you confirm the naming is exactly the same ? (https://github.com/prometheus/node_exporter/blob/master/collector/ethtool_linux.go#L458)

champtar avatar Jun 17 '24 09:06 champtar

I'll make sure they align

Kevinjil avatar Jun 19 '24 11:06 Kevinjil

@champtar I've changed the naming of metrics to align with the upstream names.

Kevinjil avatar Jun 25 '24 07:06 Kevinjil

@champtar A small reminder. Also, should I resolve the merge conflict or will you do it when it in the pull.

Kevinjil avatar Sep 19 '24 09:09 Kevinjil

Did some small changes: ethtool-lua:

  • changed PKG_SOURCE/PKG_SOURCE_URL (file in dl folder was named v0.1.0.tar.gz) prometheus-node-exporter-lua:
  • squash commits
  • bump version
  • fix permission (not needed)
  • use untyped instead of counter (match upstream)
  • rename to ethtool instead of ethtool-stats (match upstream)

@Kevinjil could you rename ethtool-lua to lua-ethtool and move it with all the small lua libs in the repo ?

champtar avatar Jun 08 '25 20:06 champtar