1
votes

I was looking into Kubernetes Heapster and Metrics-server for getting metrics from the running pods. But the issue is, I need some custom metrics which might vary from pod to pod, and apparently Heapster only provides cpu and memory related metrics. Is there any tool already out there, which would provide me the functionality I want, or do I need to build one from scratch?

2
If you're using Java then you can use the micrometer library for pushing metrics to Prometheus. Is this the sort of thing you have in mind?Ryan Dawson
Hi, all of our micro-services are java components, so that should be fine. I'm not familiar with Prometheus at all, so I'd like to know if it supports any arbitrary metric (to be analyzed later)?Bitswazsky
You could look at adding custom metrics to the spring boot actuator and shipping to prometheus like in callicoder.com/… I realise you said heapster in your question so see brancz.com/2018/01/05/… on how it relates to prometheusRyan Dawson
You now have labels for custom metrics with Kubernetes 1.12 (Sept. 2018): stackoverflow.com/a/52565900/6309VonC

2 Answers

1
votes

What you're looking for is application & infrastructure specific metrics. For this, the TICK stack could be helpful! Specifically Telegraf can be set up to gather detailed infrastructure metrics like Memory- and CPU pressure or even the resources used by individual docker containers, network and IO metrics etc... But it can also scrape Prometheus metrics from pods. These metrics are then shipped to influxdb and visualized using either chronograph or grafana.

1
votes

Not sure if this is still open.
I would classify metrics into 3 types.
Events or Logs - System and Applications events which are sent to logs. These are non-deterministic.

Metrics - CPU and Memory utilization on the node the app is hosted. This is deterministic and are collected periodically.

APM - Applicaton Performance Monitoring metrics - these are application level metrics like requests received vs failed vs responded etc.

Not all the platforms do everything. ELK for instance does both the Metrics and Log Monitoring and does not do APM. Some of these tools have plugins into collect daemons which collect perfmon metrics of the node.

APM is a completely different area as it requires developer tool to provider metrics as Springboot does Actuator, Nodejs does AppMetrics etc. This carries the request level data. Statsd is an open source library which application can consume to provide APM metrics too Statsd agents installed in the node.

AWS offers CloudWatch agents for log shipping and sink and Xray for distributed tracing which can be used for APM.