Elastic APM shows 100% CPU usage but the cause is unclear – need help!

Hi !

There is probably an issue with how the metric is captured by the agent here.

Before we dig any further are also a few unexpected things in your configuration that would be nice to fix:

  • -Delastic.apm.cpu_count=2 : I don't know this config option, do you know where it comes from ?
  • -Delastic.apm.server_url=https://localhost:8200 will make the agent send data to localhost which means unless there is an apm-server running within the container it's quite unlikely to send data anywhere.