health event instead of hw

This commit is contained in:
Maxim Devaev
2025-02-07 01:10:57 +02:00
parent 54f6d93f63
commit 84ec99b332
6 changed files with 133 additions and 117 deletions

View File

@@ -57,7 +57,7 @@ class ExportApi:
async def __get_prometheus_metrics(self) -> str:
(atx_state, info_state, gpio_state) = await asyncio.gather(*[
self.__atx.get_state(),
self.__info_manager.get_state(["hw", "fan"]),
self.__info_manager.get_state(["health", "fan"]),
self.__user_gpio.get_state(),
])
rows: list[str] = []
@@ -71,7 +71,7 @@ class ExportApi:
for key in ["online", "state"]:
self.__append_prometheus_rows(rows, ch_state["state"], f"pikvm_gpio_{mode}_{key}_{channel}")
self.__append_prometheus_rows(rows, info_state["hw"]["health"], "pikvm_hw") # type: ignore
self.__append_prometheus_rows(rows, info_state["health"], "pikvm_hw") # type: ignore
self.__append_prometheus_rows(rows, info_state["fan"], "pikvm_fan")
return "\n".join(rows)