Skip to content

prometheus-node-exporter-lua: add chip_name to temperature metric collection#28092

Open
vgropp wants to merge 1 commit into
openwrt:masterfrom
vgropp:patch-1
Open

prometheus-node-exporter-lua: add chip_name to temperature metric collection#28092
vgropp wants to merge 1 commit into
openwrt:masterfrom
vgropp:patch-1

Conversation

@vgropp
Copy link
Copy Markdown

@vgropp vgropp commented Dec 15, 2025

removes duplicate sample with mt7996 and others with multiple radios

📦 Package Details

Maintainer: @champtar

Description:
Using the hwmon collector with a Banana Pi BPI-R4 there are duplicate samples for node_hwmon_temp_celsius{sensor="temp1",chip="ieee80211_phy0"}. This results in prometheus warnings:
level=WARN source=scrape.go:1923 msg="Error on ingesting samples with different value but same timestamp" component="scrape manager" scrape_pool=node-exporter target=http://<ip>:9100/metrics num_dropped=2

Adding the chip_name to node_hwmon_temp_celsius fixes this.

Current metrics:
Banana Pi BPI-R4

node_hwmon_chip_names{chip_name="mt7996_phy0.0",chip="ieee80211_phy0"} 1
node_hwmon_temp_celsius{sensor="temp1",chip="ieee80211_phy0"} 49
node_hwmon_chip_names{chip_name="mt7996_phy0.1",chip="ieee80211_phy0"} 1
node_hwmon_temp_celsius{sensor="temp1",chip="ieee80211_phy0"} 49
node_hwmon_chip_names{chip_name="mt7996_phy0.2",chip="ieee80211_phy0"} 1
node_hwmon_temp_celsius{sensor="temp1",chip="ieee80211_phy0"} 51

GL.iNet GL-MT6000

node_hwmon_chip_names{chip_name="cpu_thermal",chip="thermal_thermal_zone0"} 1
node_hwmon_temp_celsius{sensor="temp1",chip="thermal_thermal_zone0"} 45.499
node_hwmon_chip_names{chip_name="mdio_bus:01",chip="mdio-bus_mdio-bus:01"} 1
node_hwmon_temp_celsius{sensor="temp1",chip="mdio-bus_mdio-bus:01"} 52
node_hwmon_chip_names{chip_name="mdio_bus:07",chip="mdio-bus_mdio-bus:07"} 1
node_hwmon_temp_celsius{sensor="temp1",chip="mdio-bus_mdio-bus:07"} 64
node_hwmon_chip_names{chip_name="mt7915_phy0",chip="ieee80211_phy0"} 1
node_hwmon_temp_celsius{sensor="temp1",chip="ieee80211_phy0"} 49
node_hwmon_chip_names{chip_name="mt7915_phy1",chip="ieee80211_phy1"} 1
node_hwmon_temp_celsius{sensor="temp1",chip="ieee80211_phy1"} 49

Fixed metrics:
Banana Pi BPI-R4

node_hwmon_chip_names{chip_name="mt7996_phy0.0",chip="ieee80211_phy0"} 1
node_hwmon_temp_celsius{sensor="temp1",chip_name="mt7996_phy0.0",chip="ieee80211_phy0"} 55
node_hwmon_chip_names{chip_name="mt7996_phy0.1",chip="ieee80211_phy0"} 1
node_hwmon_temp_celsius{sensor="temp1",chip_name="mt7996_phy0.1",chip="ieee80211_phy0"} 55
node_hwmon_chip_names{chip_name="mt7996_phy0.2",chip="ieee80211_phy0"} 1
node_hwmon_temp_celsius{sensor="temp1",chip_name="mt7996_phy0.2",chip="ieee80211_phy0"} 55

GL.iNet GL-MT6000

node_hwmon_chip_names{chip_name="cpu_thermal",chip="thermal_thermal_zone0"} 1
node_hwmon_temp_celsius{sensor="temp1",chip_name="cpu_thermal",chip="thermal_thermal_zone0"} 45.499
node_hwmon_chip_names{chip_name="mdio_bus:01",chip="mdio-bus_mdio-bus:01"} 1
node_hwmon_temp_celsius{sensor="temp1",chip_name="mdio_bus:01",chip="mdio-bus_mdio-bus:01"} 52
node_hwmon_chip_names{chip_name="mdio_bus:07",chip="mdio-bus_mdio-bus:07"} 1
node_hwmon_temp_celsius{sensor="temp1",chip_name="mdio_bus:07",chip="mdio-bus_mdio-bus:07"} 64
node_hwmon_chip_names{chip_name="mt7915_phy0",chip="ieee80211_phy0"} 1
node_hwmon_temp_celsius{sensor="temp1",chip_name="mt7915_phy0",chip="ieee80211_phy0"} 49
node_hwmon_chip_names{chip_name="mt7915_phy1",chip="ieee80211_phy1"} 1
node_hwmon_temp_celsius{sensor="temp1",chip_name="mt7915_phy1",chip="ieee80211_phy1"} 48

🧪 Run Testing Details

  • OpenWrt Version: OpenWrt SNAPSHOT r32316
  • OpenWrt Target/Subtarget: mediatek/filogic
  • OpenWrt Device: Banana Pi BPI-R4, GL.iNet GL-MT6000

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/<your-package>/refresh V=s
  • It is structured in a way that it is potentially upstreamable
    (e.g., subject line, commit description, etc.)
    We must try to upstream patches to reduce maintenance burden.

@GeorgeSapkin
Copy link
Copy Markdown
Member

The commit message needs to be prefixed with a package name and follow the 50/75 rule as per the submissions guidelines. And the package needs a PKG_RELEASE bump.

@vgropp
Copy link
Copy Markdown
Author

vgropp commented Dec 15, 2025

sorry for not following guidelines, i hope its fine now

@vgropp
Copy link
Copy Markdown
Author

vgropp commented Dec 16, 2025

ok, i have no clue at all about these build failures. I can see libcurl recursive dependency and other errors but i dont understand why the build is failing by a change in the .lua script. I hope ill find more time to debug the full build process the next days

@GeorgeSapkin GeorgeSapkin changed the title Add chip_name to temperature metric collection prometheus-node-exporter-lua/hwmon prometheus-node-exporter-lua: add chip_name to temperature metric collection Dec 22, 2025
adds chip_name to temp metrics to remove
duplicate sample with mt7996

Signed-off-by: Volker Gropp <volker@gropp.org>
@vgropp
Copy link
Copy Markdown
Author

vgropp commented Jan 24, 2026

as i am still not able to reproduce a full build and this keeps failing but the patched version is working on my devices i have to step back fixing this, sorry. I would love to step back in if anyone can give me a hint what to fix or at least where to find the build error.

@champtar
Copy link
Copy Markdown
Member

@vgropp sorry for the delay, can you run the official node exporter on the BPI-R4 and see what we get ?

@vgropp
Copy link
Copy Markdown
Author

vgropp commented May 26, 2026

in 1.11.1 / 2026-04-07 i get:

# HELP node_hwmon_chip_names Annotation metric for human-readable chip names
# TYPE node_hwmon_chip_names gauge
node_hwmon_chip_names{chip="ieee80211_phy0",chip_name="mt7996_phy0_0"} 1
node_hwmon_chip_names{chip="ieee80211_phy0",chip_name="mt7996_phy0_1"} 1
node_hwmon_chip_names{chip="ieee80211_phy0",chip_name="mt7996_phy0_2"} 1
node_hwmon_chip_names{chip="platform_pwm_fan",chip_name="pwmfan"} 1
node_hwmon_chip_names{chip="platform_sfp2",chip_name="sfp2"} 1
node_hwmon_chip_names{chip="thermal_thermal_zone0",chip_name="cpu_thermal"} 1

# HELP node_hwmon_temp_celsius Hardware monitor for temperature (input)
# TYPE node_hwmon_temp_celsius gauge
node_hwmon_temp_celsius{chip="ieee80211_phy0",sensor="temp1"} 55
node_hwmon_temp_celsius{chip="platform_sfp2",sensor="temp1"} 57.09
node_hwmon_temp_celsius{chip="thermal_thermal_zone0",sensor="temp0"} 60.69
node_hwmon_temp_celsius{chip="thermal_thermal_zone0",sensor="temp1"} 60.552

and in sysout:

time=2026-05-26T16:09:18.951Z level=ERROR source=http.go:175 msg="error gathering metrics: 6 error(s) occurred:
* [from Gatherer #2] collected metric \"node_hwmon_temp_crit_celsius\" { label:{name:\"chip\" value:\"ieee80211_phy0\"} label:{name:\"sensor\" value:\"temp1\"} gauge:{value:110}} was collected before with the same name and label values
* [from Gatherer #2] collected metric \"node_hwmon_temp_celsius\" { label:{name:\"chip\" value:\"ieee80211_phy0\"} label:{name:\"sensor\" value:\"temp1\"} gauge:{value:55}} was collected before with the same name and label values
* [from Gatherer #2] collected metric \"node_hwmon_temp_max_celsius\" { label:{name:\"chip\" value:\"ieee80211_phy0\"} label:{name:\"sensor\" value:\"temp1\"} gauge:{value:120}} was collected before with the same name and label values
* [from Gatherer #2] collected metric \"node_hwmon_temp_crit_celsius\" { label:{name:\"chip\" value:\"ieee80211_phy0\"} label:{name:\"sensor\" value:\"temp1\"} gauge:{value:110}} was collected before with the same name and label values
* [from Gatherer #2] collected metric \"node_hwmon_temp_celsius\" { label:{name:\"chip\" value:\"ieee80211_phy0\"} label:{name:\"sensor\" value:\"temp1\"} gauge:{value:57}} was collected before with the same name and label values
* [from Gatherer #2] collected metric \"node_hwmon_temp_max_celsius\" { label:{name:\"chip\" value:\"ieee80211_phy0\"} label:{name:\"sensor\" value:\"temp1\"} gauge:{value:120}} was collected before with the same name and label values"

so its the same bug but a bit different behavior. I would really love to see the bpi-r4 support by the lua for all three bands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants