Hi, WMI exporter fails to export metrics from text file. Error in event log:
Error parsing "C:\\Program Files\\wmi_exporter\\textfile_inputs\\test.prom": text format parsing error in line 1: expected float as value, got "8192\r"
file content:
node_directory_size_bytes{directory="."} 8192
I have tested the same file with the same content on node exporter on linux and it worked. Anyone tried to export metrics from file ?
Hi!
I think the key is "8192\r" - there's a trailing carriage return there. We probably should strip those, but if you want a quick fix, could you try to use unix line endings?
Carriage returns are not valid line endings for the text format.
Hi, yes file with unix line endings works, thanks !
Do we need fix for that or should we close this as not an issue?
\r\n is standard line endings on Windows though, so I think we need to support this.
I made a PR on the expfmt package earlier today, and it was explained that it is not within scope there. So we'll need to build it inside our bits in that case. Should be simple enough to build a filtering reader that wraps the file reader.
Most helpful comment
I made a PR on the expfmt package earlier today, and it was explained that it is not within scope there. So we'll need to build it inside our bits in that case. Should be simple enough to build a filtering reader that wraps the file reader.