paketo-buildpacks / libjvm

A library and helper applications that form the basis for building the different Paketo-style JVM-providing buildpacks
Apache License 2.0
19 stars 21 forks source link

Is it possible to support Thread Dump? #183

Open zhoufenqin opened 2 years ago

zhoufenqin commented 2 years ago

Describe the Enhancement

We have several ways for troubleshooting, like Heap dump, JFR, and Thread dump. This buildpack already support JFR and Heap Dump, is it possible to support Thread Dump? Or why is the Thread Dump helper not included in the buildpack?

Possible Solution

Motivation

We hope to use Java buildpack to build apps, but some features are not supported, like how to handle thread dump

dmikusa commented 2 years ago

We could certainly add something to make doing this easier, what would you like to see?

Right now, you can take heap dumps by issuing a kill -3 on the Java pid. How you do that exactly depends on where you are running the container. With Docker, it's a docker exec. With K8s, it would depend on what permissions you have, but possibly kubectl exec.

You can also...

Happy to add more options to make debugging easier. If anyone has feedback on what would help, please let us know.