in scripts/chrony_exporter.py [0:0]
def main():
start_http_server(9100)
print("Exporter running at http://localhost:9100/metrics")
while True:
clock_error_ms = parse_tracking_output()
if clock_error_ms is not None:
clock_error_gauge.set(clock_error_ms)
print(f"Updated clock error: {clock_error_ms:.3f} ms")
else:
print("Clock error computation failed.")
time.sleep(SLEEP_INTERVAL)