beats
beats copied to clipboard
[OTel Mapper] Fails to convert nested arrays and slices to `[]any`
Prior to shipping Beat events to OTel via the otelconsumer, Beats attempts to sanitize the mapstr.M map for the pdata library used by OTel.
The sanitization does a few key things, but it serves two wide-reaching purposes:
- Convert
mapstr.Mtomap[string]anyin place.pdatainherently does not know aboutmapstr.M
- Convert arrays and slices (including
[]mapstr.M) to[]any.pdatachoose to not work with other types.
However, with both purposes, there are two issues:
- It recursively handles
mapstr.M, but it does not recursively handlemap[string]any. Any nested slices / arrays within amap[string]anywill inevitably fail to be handled bypdataunless they happen to already be[]anyslices. And, in the unlikely event of amapstr.Mcontaining amap[string]anycontaining amapstr.M, the innermapstr.Mwould not be converted. - It does not actually convert arrays because it only uses the
switchto detect slices.
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)