Bug writing all exact integers as integers blows up influxdb if the field was already written as a float
Opened this issue · 0 comments
wz2b commented
I know we have a previous discussion here and I plan to fix this ... but I don't want to lose track of it.
Here you test if a number is an integer and if so you emit it as an int, but the problem is if you do that if the number has ever been a fraction influx will fail to insert it. Example:
Mar 15 19:58:34 testbed telegraf[1798106]: 2022-03-15T19:58:34Z E! [outputs.influxdb_v2] Failed to write metric (will be dropped: 422 Unprocessable Entity): unprocessable entity: failure writing points to database: partial write: field type conflict: input field "scf" on measurement "airflow" is type integer, already exists as type float dropped=4
This because scf was 1.1 for a while, then it went to 0. This library wrote it as scf=1.1 the first time, then scf=0i the second time. You cannot do that with influxdb...