Closed GitImpulseIt closed 7 years ago
Hello @BriacRONDI , I just discover your message, I had a notification issue.
Could you capture more details? I suspect that InfluxMetric.valueAsStr()
could be more strict about float / decimal conversions. I see a risk with the locale of the JVM where valueAsStr()
could emit a ",
" instead of a ".
".
I have identified a potential issue: big float values in java get formatted with an exponent
float value = 123_456_789.012_345;
System.out.println("value: " + value);
will return 1.23456789012345E8
@kerlandsson can I get your feedback on this issue and on my PR #95 ? I suspect that we should be more strict than invoking Float.toString()
to format floats.
I found in the official java client https://github.com/influxdata/influxdb-java/blob/influxdb-java-2.5/src/main/java/org/influxdb/dto/Point.java#L321
NumberFormat numberFormat = NumberFormat.getInstance(Locale.ENGLISH);
numberFormat.setMaximumFractionDigits(MAX_FRACTION_DIGITS);
numberFormat.setGroupingUsed(false);
numberFormat.setMinimumFractionDigits(1);
Thank you for working on this issue. I will test your PR as soon as possible and will give you a feedback.
According to https://github.com/influxdata/influxdb-java/blob/influxdb-java-2.5/src/main/java/org/influxdb/dto/Point.java#L321
The expected string for 123_456_789.012_345
is 123456789.012345
and is NOT 1.23456789012345E8
as we generate today.
Fix should be ready at #95
Hello Guys,
I encountered a problem with the InfluxDbOutputWriter. The floating point metrics, for example : java.lang:type=OperatingSystem > ProcessCpuLoad causes jmxtrans-agent to crash.
Try this :
<query objectName="java.lang:type=OperatingSystem" attribute="ProcessCpuLoad" resultAlias="ProcessCpuLoad"/>
You will obtain :
WARNING [jmxtrans-agent-1] org.jmxtrans.agent.JmxTransExporter - Ignore exception flushing metrics java.lang.RuntimeException: Failed to write metrics, response code: 400, response message: Bad Request ...
My environment : jmxtrans-agent : 1.2.4 InfluxDB : 1.1 Tomcat : 7.0.73 JRE : Oracle 1.8.0_72-b15
Thank you for your help