1.7 KiB
1.7 KiB
How-to-generate-flame-graph-for-specific-container_686074188
Introduction
This guide presents the steps to generate flamegraph for specific container
When to use this guide?
Usually when the issue happens on specific deployment and basic monitoring metrics cannot help on the troubleshooting.
Deployment
- Deploy Krew on bastion
- Make sure that
gitis installed. 2. Run this command to download and installkrew:( set -x; cd "$(mktemp -d)" && OS="$(uname | tr '[:upper:]' '[:lower:]')" && ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" && KREW="krew-${OS}_${ARCH}" && curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" && tar zxvf "${KREW}.tar.gz" && ./"${KREW}" install krew )- Add the
$HOME/.krew/bindirectory to your PATH environment variable. To do this, update your.bashrcor.zshrcfile and append the following line:
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"- Run
kubectl krewto check the installation.
- Add the
- Make sure that
- Install kubectl-prof
kubectl krew index add kubectl-prof https://github.com/josepdcs/kubectl-prof kubectl krew search kubectl-prof kubectl krew install kubectl-prof/prof kubectl prof --help
Take the flame graph
- Find the pod / container with issue
- Take the flame graph
kubectl prof itom-xruntime-platform-offline-xxxxxxxxxx-xxxxx -n itsma-xxxxx -t 1m -l java -o flamegraph --local-path=/temp itom-xruntime-platform - Analyze on the flamegraph
Reference