Giter VIP home page Giter VIP logo

Comments (3)

trentm avatar trentm commented on September 27, 2024

Hi @birladeanuadrian. Thanks for the issue.

The system.process.memory.usage

Do you mean system.process.memory.rss.bytes (https://www.elastic.co/guide/en/apm/agent/nodejs/current/metrics.html#metric-system.process.memory.rss.bytes) or perhaps system.process.memory.size? The Node.js APM agent doesn't report a metric named system.process.memory.usage.


Using /sys/fs/cgroup/memory might require some defensiveness. Testing in a kind k8s cluster on macOS there isn't such a dir:

~ # ls /sys/fs/cgroup/memory
ls: /sys/fs/cgroup/memory: No such file or directory
~ # ls /sys/fs/cgroup
cgroup.controllers        cpu.stat                  hugetlb.2MB.rsvd.max      memory.reclaim
cgroup.events             cpu.weight                io.bfq.weight             memory.stat
cgroup.freeze             cpu.weight.nice           io.latency                memory.swap.current
cgroup.kill               cpuset.cpus               io.max                    memory.swap.events
cgroup.max.depth          cpuset.cpus.effective     io.stat                   memory.swap.high
cgroup.max.descendants    cpuset.cpus.partition     memory.current            memory.swap.max
cgroup.procs              cpuset.mems               memory.events             pids.current
cgroup.stat               cpuset.mems.effective     memory.events.local       pids.events
cgroup.subtree_control    hugetlb.2MB.current       memory.high               pids.max
cgroup.threads            hugetlb.2MB.events        memory.low                pids.peak
cgroup.type               hugetlb.2MB.events.local  memory.max                rdma.current
cpu.idle                  hugetlb.2MB.max           memory.min                rdma.max
cpu.max                   hugetlb.2MB.numa_stat     memory.oom.group
cpu.max.burst             hugetlb.2MB.rsvd.current  memory.peak

I found docker/for-mac#6118 but I haven't read through it. I see mention of cgroupsv1 vs cgroupsv2, but I'm not sure if that is a relevant difference.

Do you happen to know of an authoritative reference for /sys/fs/cgroup/memory?

I found https://stackoverflow.com/questions/50865763/memory-usage-discrepancy-cgroup-memory-usage-in-bytes-vs-rss-inside-docker-con as well that seems to discuss the differences in various ways to get memory info. I haven't read through this yet, either.

from apm-agent-nodejs.

trentm avatar trentm commented on September 27, 2024

Ah... our APM agents already have a spec for report cgroup memory metrics: https://github.com/elastic/apm/blob/main/specs/agents/metrics.md#cgroup-metrics

And we have this (sadly languishing) issue to implement those in this agent: #1813

So I believe this issue is effectively a duplicate (and vote for) #1813.

from apm-agent-nodejs.

trentm avatar trentm commented on September 27, 2024

I'll resolve this as a duplicate, and I've made a node to discuss adding #1813 to upcoming planning.

from apm-agent-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.