[英]how to take thread dump of java application on a distroless container running on kubernetes?
My cluster have many java applications running on it, I would like to take thread dump for few microservices.我的集群上运行着许多 java 应用程序,我想对一些微服务进行线程转储。 But as these are distroless images, I was thinking of ephemeral containers but not sure if volume can be attached to such containers.
但由于这些是 distroless 图像,我在考虑临时容器,但不确定是否可以将卷附加到此类容器。 Can someone help?
有人可以帮忙吗?
Regards, Anjani问候,安贾尼
Are you using Spring Boot to build those microservices?您是否使用 Spring Boot 来构建这些微服务? If yes, then by using Spring Boot Admin you can get thread dumps, heap dumps and monitor your services from a single window.
如果是,那么通过使用 Spring Boot Admin,您可以从单个 window 获取线程转储、堆转储并监控您的服务。
Please check here to get more details about it.请在此处查看以获取有关它的更多详细信息。
Check Spring Boot actuator endpoints https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints检查 Spring 引导执行器端点https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints
There is a dedicated endpoint for thread dumps.线程转储有一个专用端点。 Note that by default it returns custom JSON format, but you could request default text format.
请注意,默认情况下它返回自定义 JSON 格式,但您可以请求默认文本格式。
curl 'http://localhost:8080/actuator/threaddump' -i -X GET \
-H 'Accept: text/plain'
See for more details https://docs.spring.io/spring-boot/docs/current/actuator-api/htmlsingle/#threaddump.retrieving-text有关详细信息,请参阅https://docs.spring.io/spring-boot/docs/current/actuator-api/htmlsingle/#threaddump.retrieving-text
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.