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,6 +68,7 @@ class ExportApi:
for mode in sorted(UserGpioModes.ALL): for mode in sorted(UserGpioModes.ALL):
for (channel, ch_state) in gpio_state[f"{mode}s"].items(): for (channel, ch_state) in gpio_state[f"{mode}s"].items():
if not channel.startswith("__"): # Hide special GPIOs
for key in ["online", "state"]: for key in ["online", "state"]:
self.__append_prometheus_rows(rows, ch_state["state"], f"pikvm_gpio_{mode}_{key}_{channel}") self.__append_prometheus_rows(rows, ch_state["state"], f"pikvm_gpio_{mode}_{key}_{channel}")