On linux, write_to_textfile can overwrite an existing file.
However, this fails if we try this on windows:
"C:\...\dashboard\metrics.py", line 169, in write_metrics
write_to_textfile(outfile, registry)
File "C:\...\env\lib\site-packages\prometheus_client\exposition.py", line 275, in write_to_textfile
os.rename(tmppath, path)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: '..\metrics\cable_alert.prom.6092.3608' -> '..\metrics\cable_alert.prom'