简体   繁体   English

监控kubernetes PODS上运行的线程数

[英]Monitoring the number of threads running on kubernetes PODS

I have a use case where we need monitor the threads inside our pods, by using "kubectl top" i am able to monitor CPU, MEMORY.I am new to kubernetes and need to monitor the threads inside our pods.我有一个用例,我们需要监控 Pod 内的线程,通过使用“kubectl top”我可以监控 CPU,MEMORY。我是 kubernetes 的新手,需要监控 Pod 内的线程。

NAME                   CPU(cores)   CPU%      MEMORY(bytes)   MEMORY%
ip-XXX.ec2.internal    222m         11%       3237Mi          41%
ip-YYY.ec2.internal    91m          9%        2217Mi          60%

You need to instrument your code using some standard library depending on the language the application is written and then you can expose the metrics at /metrics endpoint which can be scraped by prometheus and shown in a Grafana dashboard.您需要根据应用程序编写的语言使用一些标准库来检测您的代码,然后您可以在/metrics端点公开指标,这些指标可以被 prometheus 抓取并显示在 Grafana 仪表板中。

If it's a JVM based app then micrometer is easy to use and exposes some metrics by default.如果它是基于 JVM 的应用程序,那么千分尺很容易使用,并且默认情况下会公开一些指标。

All other major languages has prometheus client library which can used to instrument code and expose metrics.所有其他主要语言都有prometheus 客户端库,可用于检测代码和公开指标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM