prometheus: hid special gpios starting with __

This commit is contained in:
Maxim Devaev 2023-08-18 00:27:46 +03:00
parent 61ce81ab64
commit 07e1c601a9

View File

@ -68,8 +68,9 @@ class ExportApi:
for mode in sorted(UserGpioModes.ALL):
for (channel, ch_state) in gpio_state[f"{mode}s"].items():
for key in ["online", "state"]:
self.__append_prometheus_rows(rows, ch_state["state"], f"pikvm_gpio_{mode}_{key}_{channel}")
if not channel.startswith("__"): # Hide special GPIOs
for key in ["online", "state"]:
self.__append_prometheus_rows(rows, ch_state["state"], f"pikvm_gpio_{mode}_{key}_{channel}")
self.__append_prometheus_rows(rows, hw_state["health"], "pikvm_hw")
self.__append_prometheus_rows(rows, fan_state, "pikvm_fan")