Windows_exporter: textfile collector fails to read file

Created on 14 May 2018  路  5Comments  路  Source: prometheus-community/windows_exporter

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 ?

bug collectotextfile

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.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benridley picture benridley  路  5Comments

lngphp picture lngphp  路  4Comments

Gerthum picture Gerthum  路  9Comments

LuisLoranca picture LuisLoranca  路  5Comments

carlpett picture carlpett  路  7Comments