perforce / p4prometheus

[Community Supported] Perforce (Helix Core) interface for writing Prometheus metrics from real-time analysis of p4d log files.
MIT License
45 stars 24 forks source link

Avoid creation of cruff temp files /p4/metrics if commands fail. #30

Closed cttyler closed 1 year ago

cttyler commented 1 year ago

A common workflow in several scripts is to generate data to a temp file first, and move that data to the correct target file name on successful completion, so that only completed metrics data files appear for scraping by the node_exporter.

This enhancement is to better handle the case where commands fail. In that case, the temp files should be deleted.

Perhaps we consider doing something separate to indicate count of failures or some such?

rcowham commented 1 year ago

Fixed in 31dcbf7b8c13cec50e9208b029fdb923d8d966db