apm icon indicating copy to clipboard operation
apm copied to clipboard

Add support for cgroup-based CPU metrics

Open eyalkoren opened this issue 5 years ago • 7 comments

Is your feature request related to a problem? Please describe. CPU metrics reported from containerised services are inaccurate.

Describe the solution you'd like So far we only support memory cgroup-based metrics, we need to apply the same for CPU.

Steps

  • [ ] Define the related data model and intake. @elastic/apm-server your assistance with that, based on Metricbeat and/or stack monitoring, would be great
  • [ ] Define how and when UI will be using those
  • [ ] Extend the APM agents spec accordingly

Describe alternatives you've considered Not supporting those and keep inaccurate 🙂

Additional context <TBD - @elastic/apm-server if you can provide evidence from such inaccuracies observed in ESS, that would be great>

eyalkoren avatar Nov 16 '20 16:11 eyalkoren

The libbeat/APM Server monitoring reports following metrics:

  • cgroup.cpu.id
  • cgroup.cpu.cfs.period.us
  • cgroup.cpu.cfs.quota.us
  • cgroup.cpu.stats.periods
  • cgroup.cpu.stats.throttled.periods
  • cgroup.cpu.stats.throttled.ns
  • cgroup.cpuacct.id
  • cgroup.cpuacct.total.ns

You can find the implementation for

simitt avatar Nov 17 '20 09:11 simitt

APM Server issue for defining Elasticsearch mapping https://github.com/elastic/apm-server/issues/4433.

simitt avatar Nov 17 '20 09:11 simitt

Hey folks -- apm-server is going to start indexing these fields with this pr: https://github.com/elastic/apm-server/pull/4956

are there any other cgroup cpu metrics that are going to be sent that aren't accounted for here?

stuartnelson3 avatar Mar 16 '21 08:03 stuartnelson3

@stuartnelson3 Thanks for picking this up!

are there any other cgroup cpu metrics that are going to be sent that aren't accounted for here?

AFAIK there is no agent reference implementation yet, so not sure anyone really looked into this. Is there a plan in the server team to implement that in the go agent?

eyalkoren avatar Mar 16 '21 10:03 eyalkoren

There isn't currently an issue in the repo, maybe @simitt knows something though

stuartnelson3 avatar Mar 16 '21 10:03 stuartnelson3

@axw do you have an overview over when this is planned to be added?

simitt avatar Mar 16 '21 11:03 simitt

@simitt no, sorry

axw avatar Mar 17 '21 06:03 axw