Comments (3)
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.
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.
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)
- Does the "Sending error to Elastic APM: %o'" message need to be INFO level? HOT 2
- Control which framework/technology transactions are created from HOT 3
- Add configuration option to allow injecting headers on all outgoing requests
- chore: proper fallback value for boolean "bogus" options
- Error thrown when using `@elastic/ecs-pino-format` v1.4.0 HOT 3
- ESM instrumentation/hooking fails with Node.js v18.19.0 HOT 3
- update-tav-versions.js needs update for tav@5 syntax
- update Lambda guide to point out ELASTIC_APM_API_KEY for Elastic serverless usage
- Elastic APM Node package 3.50.0 and above causing issues with file upload HOT 1
- Agent environment not set correctly from NODE_ENV in 4.3.0 HOT 3
- avoid instrumenting some Node.js apps when `NODE_OPTIONS=-r elastic-apm-node/start` is being used
- "pg/knex.test.js" fails with Node.js v18.19.0 HOT 2
- Failed to start typescript app with APM agent. HOT 1
- elastic-apm-node not working for mongoose 8.0.3 and mongodb 6.2.0 HOT 1
- support `node --enable-source-maps` usage with our custom `Error.prepareStackTrace` usage
- fix <database>.$cmd.getMore span on mongodb
- Support of Next js ^14 HOT 2
- `_signalLambdaEnd` request to Lambda extension should set `Content-Type`
- Questions re ESM support for MikroOrm / knex, Node v20, & OIDC HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apm-agent-nodejs.