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

Fix used memory calculations in docker/memory #27473

Merged

Conversation

fearful-symmetry
Copy link
Contributor

What does this PR do?

This brings the memory usage reporting for docker/memory in line with docker stat, as well as cadvisor and containerd by calculating used memory as used - inactive_file. I'm marking this a bug, since we were the only ones using this more simplistic usage calculation.

Why is it important?

This brings us in line with how container memory usage is calculated elsewhere.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

  • Pull down and build
  • Run on a system with docker and containers running
  • Make sure the value for container memory usage in docker/memory is a reasonable value.

Related issues

@fearful-symmetry fearful-symmetry added bug Team:Integrations Label for the Integrations team labels Aug 18, 2021
@fearful-symmetry fearful-symmetry requested a review from a team August 18, 2021 17:24
@fearful-symmetry fearful-symmetry self-assigned this Aug 18, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Aug 18, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Aug 18, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-08-18T19:12:06.459+0000

  • Duration: 76 min 4 sec

  • Commit: b1c1c62

Test stats 🧪

Test Results
Failed 0
Passed 9126
Skipped 2420
Total 11546

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 9126
Skipped 2420
Total 11546

@fearful-symmetry fearful-symmetry added the backport-v7.16.0 Automated backport with mergify label Aug 20, 2021
"max": 7860224,
"pct": 0.000672283359618831,
"total": 1409024
"max": 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this 0 look right to you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a case where V1 and V2 might be different. Max Just indicates the cgroup's upper threshold, with 0 meaning there is no upper limit.

@fearful-symmetry fearful-symmetry requested review from kaiyan-sheng and a team August 23, 2021 15:57
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jsoriano
Copy link
Member

I'm marking this a bug

Do you want to backport this to 7.15? 🙂

@fearful-symmetry fearful-symmetry added the backport-v7.15.0 Automated backport with mergify label Aug 23, 2021
@fearful-symmetry
Copy link
Contributor Author

@jsoriano Added the correct (I think) backport tags.

@fearful-symmetry fearful-symmetry merged commit 3365e67 into elastic:master Aug 23, 2021
mergify bot pushed a commit that referenced this pull request Aug 23, 2021
mergify bot pushed a commit that referenced this pull request Aug 23, 2021
fearful-symmetry added a commit that referenced this pull request Aug 23, 2021
(cherry picked from commit 3365e67)

Co-authored-by: Alex K <8418476+fearful-symmetry@users.noreply.github.com>
fearful-symmetry added a commit that referenced this pull request Aug 23, 2021
(cherry picked from commit 3365e67)

Co-authored-by: Alex K <8418476+fearful-symmetry@users.noreply.github.com>
Icedroid pushed a commit to Icedroid/beats that referenced this pull request Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v7.15.0 Automated backport with mergify backport-v7.16.0 Automated backport with mergify bug Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metricbeat - collects the dockers memory size which is different from “docker stats”
4 participants