Closed VCCPlindsten closed 3 months ago
Further investigation reveals the original cause is not what it at first seemed, instead the problem comes from attempting to dynamically map the histogram .values array when it has a "mixed" payload (both things detected as integers and things detected as floats).
This only seems to happen on the first document ingested, when one has been successfully ingested, the type is set, and the values are coerced/cast to the mapped type.
Dynamic template
{
"prometheus.*.histogram.values": {
"path_match": "prometheus.*.histogram.values",
"mapping": {
"type": "double"
},
"match_mapping_type": "*"
}
}
This turns out to be a 8.12 regression - and the problems encountered here are in fact a failure of applying templates in correct order. Resolved by https://github.com/elastic/kibana/pull/175970 in a somewhat non-obvious way. Fixed in 8.12.1
With
use_types: true
documents that contain histogram values such as0.20500000000000002
(Not exactly representable by a float32) will get rejected with the following error in metricbeat:Observed in remote_write metricset, may also exist in the other metricsets.
Workaround
Set a @custom component template (e.g. metrics-prometheus.remote_write@custom) with mappings that set the type as
double
.This dynamic template snippet maps all floats as
double
, which may or may not be desired for all use-casesProposed solution
Make histogram values mappings explicitly
double
in the integration.