Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage one-shot container metrics in Docker metricsets #23345

Closed
jsoriano opened this issue Jan 4, 2021 · 3 comments
Closed

Leverage one-shot container metrics in Docker metricsets #23345

jsoriano opened this issue Jan 4, 2021 · 3 comments
Labels
enhancement Metricbeat Metricbeat Stalled Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team

Comments

@jsoriano
Copy link
Member

jsoriano commented Jan 4, 2021

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 to true to avoid this second measure, making these requests to reply much faster.

Take advantage of this new argument when possible.

This implies:

  • Update Docker client to use a version including the ContainersStatOneShot method.
  • Start using ContainerStatsOneShot instead of ContainerStats. In principle this change can be directly done on any metricset that is not using PreCPUStats.
  • In the cpu metricset, refactor the code to keep supporting current metrics based on PreCPUStats.
  • Keep supporting older versions of Docker.

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.

@jsoriano jsoriano added enhancement Metricbeat Metricbeat Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team labels Jan 4, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Platforms)

@botelastic
Copy link

botelastic bot commented Jan 27, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@botelastic botelastic bot added the Stalled label Jan 27, 2022
@botelastic botelastic bot closed this as completed Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Metricbeat Metricbeat Stalled Team:Integrations Label for the Integrations team Team:Platforms Label for the Integrations - Platforms team
Projects
None yet
Development

No branches or pull requests

2 participants