Can Metrics Server be used as a source of monitoring solution metrics

368 views
Skip to first unread message

chetan mangsuli

unread,
Jul 22, 2020, 7:59:16 AM7/22/20
to kubernetes-sig-instrumentation
Hello,

I am currently exploring Kubernetes Metrics Server and wanted to know whether we can use Metric Server for Monitoring solution metrics I saw in the description as "Metrics Server is not meant for non-autoscaling purposes. For example, don't use it to forward metrics to monitoring solutions, or as a source of monitoring solution metrics." Just curious to know why we cant use this as one of the source of monitoring solution Metrics.

Regards,
Chetan

Marek Siarkowicz

unread,
Jul 22, 2020, 10:11:45 AM7/22/20
to chetan mangsuli, kubernetes-sig-instrumentation
Hey Chetan,

I'm currently the Metrics Server (MS) owner and author of this quote. I added it as I have seen more and more people trying MS this way, even though it was never designed for it.

As the goal of Metrics Server (MS) is to serve the autoscaling pipeline, some things like accuracy were sacrificed to make autoscaling more responsive. I listed two examples below

No matter what metric scraping period is configured (default 1 minute), MS will always return results from window of the same size (last ~15 seconds on docker). For autoscaling when making a decision to scale up, we only care about the most recent usage  even if we make this decision once a minute. For monitoring system it means that we will report usage from only 15 seconds out of every minute. Making such metrics not very useful when calculating average. 

Second example would be with the Memory usage metric, MS reports the so called Working Set Size (WSS). This type of memory was selected to best predict OOM events as this is used by Kubelet. Monitoring only WSS isn't very useful for most observability purposes.  

Overall, could those and other problems  be addressed to make MS a good source of metrics? Possibly, but I don't think it's worth it. Metrics that are exposed by MS can be as easily collected by Monitoring system like Prometheus and having clear purpose allows MS to provide a great scalable tool for autoscaling, and remain really simple.

Thanks for asking this question, I think we could do a better job in MS documentation to make it clear.

Marek

--
You received this message because you are subscribed to the Google Groups "kubernetes-sig-instrumentation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-sig-instru...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-sig-instrumentation/fa228699-b1b7-4013-be5e-b5ce0c5c921eo%40googlegroups.com.

Han Kang

unread,
Jul 22, 2020, 10:31:59 AM7/22/20
to Marek Siarkowicz, chetan mangsuli, kubernetes-sig-instrumentation
You may want to look at kube-state-metrics to see if that fits your use case.

--
- Han

Dan Roscigno

unread,
Jul 22, 2020, 10:51:52 AM7/22/20
to Han Kang, kubernetes-sig-instrumentation
I use kube-state-metrics for information about the k8s cluster, and I use Metricbeat from Elastic (note: I work for Elastic) for metrics from the pods running in the k8s cluster.  Metricbeat reads from kube-state-metrics and the processes running in the pods.  You can also use Prometheus to read from both kube-state-metrics and the processes.

Dan Roscigno | Elastic Customer Success Programs | dan.ro...@elastic.co | +1 425 985 3101


chetan mangsuli

unread,
Jul 22, 2020, 12:03:44 PM7/22/20
to Han Kang, Marek Siarkowicz, kubernetes-sig-instrumentation
Sure I will look at kubestate metrics as  thank you for your help

chetan mangsuli

unread,
Jul 22, 2020, 12:05:25 PM7/22/20
to Han Kang, Marek Siarkowicz, kubernetes-sig-instrumentation

Sure I will look at both kubestate metrics and metrics server as well  thank you for your help

Amit Jain

unread,
Sep 10, 2023, 4:36:14 PM9/10/23
to kubernetes-sig-instrumentation
Hi Marek,
can you please share metric server upgrade documentation please
I am checking around but not able to find the metric server upgrade documentation
That will be a great help for me
Thank You

Thanks
Amit


Reply all
Reply to author
Forward
0 new messages