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

[Metricbeat] Grab raw memory stats for docker/memory metricset #12855

Closed
fearful-symmetry opened this issue Jul 11, 2019 · 1 comment
Closed
Assignees
Labels
containers Related to containers use case enhancement needs testing notes Team:Integrations Label for the Integrations team test-plan Add this PR to be manual test plan v7.4.0

Comments

@fearful-symmetry
Copy link
Contributor

This is a request from the Cloud team, as they wanted docker-specific memory data beyond what we provide, including info on page faults. Making an issue since I'm probably not gonna have time to actually make the PR before I leave for vacation.

Docker provides this info via not-great Stats object that's just a map[string]uint64 :
https://github.com/docker/engine/blob/master/api/types/stats.go#L68

The engine API uses the stats object to provide a variety of info, including page faults:

      "stats" : {
         "total_rss_huge" : 0,
         "pgpgout" : 2075,
         "total_pgmajfault" : 0,
         "dirty" : 0,
         "pgpgin" : 2370,
         "hierarchical_memsw_limit" : 9223372036854771712,
         "total_unevictable" : 0,
         "total_dirty" : 0,
         "active_file" : 0,
         "total_writeback" : 0,
         "inactive_file" : 0,
         "total_pgpgout" : 2075,
         "total_inactive_file" : 0,
         "cache" : 0,
         "hierarchical_memory_limit" : 9223372036854771712,
         "active_anon" : 1208320,
         "total_active_file" : 0,
         "total_pgpgin" : 2370,
         "total_cache" : 0,
         "total_inactive_anon" : 0,
         "rss_huge" : 0,
         "pgfault" : 1585,
         "total_rss" : 1208320,
         "pgmajfault" : 0,
         "total_mapped_file" : 0,
         "unevictable" : 0,
         "writeback" : 0,
         "rss" : 1208320,
         "total_pgfault" : 1585,
         "inactive_anon" : 0,
         "total_active_anon" : 1208320,
         "mapped_file" : 0
      }

You can get this via the engine API with something like this:

curl -H "Content-Type: application/json" -XGET --unix-socket /var/run/docker.sock 'http:/v1.24/containers/$CONTAINER_ID/stats?stream=false'

@fearful-symmetry
Copy link
Contributor Author

Fixed by #12916

@andresrc andresrc added v7.4.0 test-plan Add this PR to be manual test plan needs testing notes and removed [zube]: Done labels Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Related to containers use case enhancement needs testing notes Team:Integrations Label for the Integrations team test-plan Add this PR to be manual test plan v7.4.0
Projects
None yet
Development

No branches or pull requests

3 participants