diff --git a/services/monitoring/jetson-tegrastats-exporter.yaml b/services/monitoring/jetson-tegrastats-exporter.yaml index 3679938..6b0ce37 100644 --- a/services/monitoring/jetson-tegrastats-exporter.yaml +++ b/services/monitoring/jetson-tegrastats-exporter.yaml @@ -17,7 +17,7 @@ spec: annotations: prometheus.io/scrape: "true" prometheus.io/port: "9100" - monitoring.bstein.dev/restart-rev: "5" + monitoring.bstein.dev/restart-rev: "6" spec: serviceAccountName: default hostPID: true diff --git a/services/monitoring/scripts/jetson_tegrastats_exporter.py b/services/monitoring/scripts/jetson_tegrastats_exporter.py index 8314ad7..284d5ce 100644 --- a/services/monitoring/scripts/jetson_tegrastats_exporter.py +++ b/services/monitoring/scripts/jetson_tegrastats_exporter.py @@ -14,6 +14,7 @@ BASE_METRICS = { "ram_used_mb": 0.0, "ram_total_mb": 0.0, "power_5v_in_mw": 0.0, + "log_line_len": 0.0, "last_scrape_ts": 0.0, } @@ -33,7 +34,7 @@ def parse_line(line: str) -> dict: if m: updates["ram_used_mb"] = float(m.group(1)) updates["ram_total_mb"] = float(m.group(2)) - m = re.search(r"(?:POM_5V_IN|VDD_IN)\\s+(\\d+)/(\\d+)", line) + m = re.search(r"(?:POM_5V_IN|VDD_IN)\\s+(\\d+)(?:mW)?/(\\d+)(?:mW)?", line) if m: updates["power_5v_in_mw"] = float(m.group(1)) return updates @@ -66,6 +67,7 @@ class Handler(http.server.BaseHTTPRequestHandler): line = read_latest_line() if line: metrics.update(parse_line(line)) + metrics["log_line_len"] = float(len(line)) metrics["last_scrape_ts"] = time() out = [] label = f'{{node="{NODE_NAME}"}}'