censorinus
censorinus copied to clipboard
Data is sent with system default locale, which may cause problems in the parsing end
Telegraf logs show lines like these:
2021-04-07T08:21:11Z E! [inputs.statsd] Parsing value to float64, unable to parse metric: xxx.yyy.zzz:2,2|g
Note that I have LANG=fi_FI.UTF-8 which should have comma (,) as the decimal separator. (This is of course only a problem when testing on my own workstation.)
The metric is sent like this client.gauge("yyy.zzz", doubleValue, tags)
It seems that in github.gphat.censorinus.dogstatsd.Encoder the value format is initialized as:
val format = new DecimalFormat("0.################")
I think it should be initialized with ROOT locale:
val format = new DecimalFormat("0.################", new DecimalFormatSymbols(Locale.ROOT))