Leverage one-shot container metrics in Docker metricsets #23345
Labels
enhancement
Metricbeat
Metricbeat
Stalled
Team:Integrations
Label for the Integrations team
Team:Platforms
Label for the Integrations - Platforms team
Describe the enhancement:
Docker metricsets get stats per container using the Docker ContainerStats API. Till Docker 20.10.0 (released on Dec 2020), this endpoint takes more than 1 second to reply, this is because it takes two measures to help on calculation of CPU usage percentages.
In 20.10.0, after moby/moby#40478 (see also moby/moby#28881), a new parameter is added,
one-shot
, that can be set totrue
to avoid this second measure, making these requests to reply much faster.Take advantage of this new argument when possible.
This implies:
ContainersStatOneShot
method.ContainerStatsOneShot
instead ofContainerStats
. In principle this change can be directly done on any metricset that is not usingPreCPUStats
.cpu
metricset, refactor the code to keep supporting current metrics based onPreCPUStats
.Describe a specific use case for the enhancement or feature:
This would improve the use of resources when monitoring Docker daemons with many running containers.
The text was updated successfully, but these errors were encountered: