How to switch between integer and float values


I am using the vsphere vsphere plugin to collect data from vCenter and when switching from use_int_samples = false to use_int_samples = true, I can no longer see data in Grafana and I also get messages such as these in telegraf:

input field "resourceMemShared_latest" on measurement "vsphere_host_sys" is type integer, already exists as type float dropped=486; discarding points

I assume is due to switching from float to integer values.

How can I effectively switch between the two?

Unfortunately you can’t do this, not if you want to keep them in the same measurement.

When the first data point arrives, the field type is set. It will never accept the field in a different type. To do that, you must delete the measurement and start again (not ideal).

Saying that, you may be able to use the processor plugins to duplicate the field and store one as an int and one as a float.

The use_int_samples flag was added after an update which changed the data type. It was added for backwards compatibility.

But, switching between the two at will won’t work.

Hope that helps

Edit: link to processor plugins