Skip to content

Conversation

SimonSimCity
Copy link
Contributor

@SimonSimCity SimonSimCity commented Apr 22, 2020

This ticket adds some metrics missing of #309.

I've added the metrics nodejs.memory.external.bytes and nodejs.memory.arrayBuffers.bytes (available from node 13.x).

All memory related data is now collected using process.memoryUsage() which has a better documentation than the internal v8 methods: https://nodejs.org/docs/latest/api/process.html#process_process_memoryusage

Checklist

  • Implement code
  • Add tests
  • Update documentation
  • Commit message follows commit guidelines

@cla-checker-service
Copy link

cla-checker-service bot commented Apr 22, 2020

💚 CLA has been signed

@SimonSimCity SimonSimCity force-pushed the add-external-memory branch 4 times, most recently from 9706e8a to 7d8b7aa Compare April 23, 2020 11:44
Use `process.memoryUsage()` instead of `v8.getHeapStatistics()`
Added metrics for `nodejs.memory.external.bytes` and `nodejs.memory.arrayBuffers.bytes`
@bmorelli25
Copy link
Member

@elasticmachine, run elasticsearch-ci/docs

@SimonSimCity
Copy link
Contributor Author

Anything postponing this? I'd like to have it in soon to monitor long-term memory development of the C-libraries of my node-application.

@lreuven
Copy link

lreuven commented May 4, 2020

Hi,
Thanks for the contribution,
@vigneshshanmugam can you have a look when you have the time?

@ghost
Copy link

ghost commented May 4, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview stats

Expand to view the summary

Build stats

Test stats 🧪

Test Results
Failed 0
Passed 143192
Skipped 0
Total 143192

Copy link
Member

@vigneshshanmugam vigneshshanmugam left a comment

Choose a reason for hiding this comment

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

Thanks @SimonSimCity, the code looks good to me

@axw One question on the APM Server part. Do we control the custom metrics in any way or we can keep adding new ones whenever we find the use-case for it?

@bmorelli25
Copy link
Member

@elasticmachine, run elasticsearch-ci/docs

@axw
Copy link
Member

axw commented May 5, 2020

One question on the APM Server part. Do we control the custom metrics in any way or we can keep adding new ones whenever we find the use-case for it?

@vigneshshanmugam as long as there's a clear use-case for it, it's fine to add new metrics. It's best to align across agents where we can, but these ones are pretty Node.js-specific so no worries there.

@vigneshshanmugam vigneshshanmugam merged commit be65dd6 into elastic:master May 5, 2020
watson pushed a commit to watson/apm-agent-nodejs that referenced this pull request May 7, 2020
Add the following new metrics:
- `nodejs.memory.external.bytes`
- `nodejs.memory.arrayBuffers.bytes`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants