While investigating https://github.com/elastic/elastic-agent/issues/6155, @VihasMakwana pointed out that if a Metricbeat module contains multiple metricsets, an error reported by one metricset is overwritten by another. This was tested with the latest DRA (8.17.0) of Elastic Agent.
The likely cause of this issue appears to be in the following code that is called for the error result of a metricset Fetch op: metricbeat/mb/module/wrapper.go#L313-L336.
While investigating https://github.com/elastic/elastic-agent/issues/6155, @VihasMakwana pointed out that if a Metricbeat module contains multiple metricsets, an error reported by one metricset is overwritten by another. This was tested with the latest DRA (8.17.0) of Elastic Agent.
The likely cause of this issue appears to be in the following code that is called for the error result of a metricset Fetch op: metricbeat/mb/module/wrapper.go#L313-L336.