Description
Dealing with floating point values can be somewhat tricky at points. We want to encode events to JSON, plus require values to be indexible in Elasticsearch. This is causing problems when a floating point value is NaN, -Inf, Inf for example. These special values are not included in the JSON standard and also not supported by Elasticsearch.
Normally the JSON encoding will fail and the event is dropped in the output. An error message is logged in this case.
In general modules are discouraged to publish events with NaN or other special values, but sometimes it can't be helped. When normalizing/checking the event we could alternatively remove fields from events or add placeholder values.
Special values are:
+Inf
-Inf
qNaN
(quiet Not a Number): normally used for error propagationsNaN
(signalling NaN): can be anything... e.g. not available indicator
Fun fact: NaN values can even contain a payload.