summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-08-18 00:27:46 +0300
committerMaxim Devaev <[email protected]>2023-08-18 00:27:46 +0300
commit07e1c601a983cfc17cbb62d7e99044a31ef6d93f (patch)
treef5374883f43252f4f5c1ccd5d0962dd1c3474d9f /kvmd
parent61ce81ab6401046a02aa3eb048af6deed004f840 (diff)
prometheus: hid special gpios starting with __
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/apps/kvmd/api/export.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/apps/kvmd/api/export.py b/kvmd/apps/kvmd/api/export.py
index a5d4d0bf..081e81a2 100644
--- a/kvmd/apps/kvmd/api/export.py
+++ b/kvmd/apps/kvmd/api/export.py
@@ -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")