summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter
diff options
context:
space:
mode:
Diffstat (limited to 'roles/monitoring/prometheus/exporter')
-rw-r--r--roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/sensors.j27
1 files changed, 6 insertions, 1 deletions
diff --git a/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/sensors.j2 b/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/sensors.j2
index 1e769389..0ab806c9 100644
--- a/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/sensors.j2
+++ b/roles/monitoring/prometheus/exporter/node/templates/textfile-collector-scripts/sensors.j2
@@ -11,8 +11,13 @@ local units = {
gpio = "status",
}
+local _typestring_printed = {}
+
local function metric(name, mtype, labels, value)
- print("# TYPE " .. name .. " " .. mtype)
+ if nil == _typestring_printed[name] then
+ print("# TYPE " .. name .. " " .. mtype)
+ _typestring_printed[name] = 1
+ end
local label_string = ""
if labels then