elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
112 stars 4.93k forks source link

Metricbeat module with multiple metricsets overwrites the error status set by a previous metricset #41867

Open mauri870 opened 15 hours ago

mauri870 commented 15 hours ago

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.

elasticmachine commented 15 hours ago

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)