Skip to main content

DebugHero vs. other tools

Many tools help you debug services in Kubernetes. They solve different problems. This page compares them, so that you can select the correct tool for each task.

DebugHero does one thing: it attaches Delve to a Go process that already runs in a pod, and it connects your IDE to it. Use it when you must see the state of the real process at the moment of the problem.

Summary​

ToolWhat you debugChange to the workloadIDE breakpoints
DebugHeroThe running Go process in the podAdds an ephemeral containerYes, set up for you
kubectl debugThe running pod, or a copyAdds an ephemeral container, or creates a copyManual setup
Delve in the imageThe process, started under DelveNew image and deploymentManual setup
mirrordA process on your machine, with the cluster contextStarts an agent in the clusterYes, local debugger
SignadotA sandbox version of your serviceCreates sandbox workloadsThrough a local or sandbox workload
cdebug, kpexecThe container, with a shell and toolsStarts a debug containerNo

kubectl debug​

kubectl debug is part of kubectl. It can add an ephemeral container to a pod, the same as DebugHero. With --profile=general, the container gets the SYS_PTRACE capability.

After that, you must do the other steps yourself: use an image that contains Delve, find the PID, start dlv attach with the correct flags, forward the port, and configure the IDE and the source path mapping. DebugHero does these steps for you, and it keeps the status of each session.

Use kubectl debug when you need a shell or network tools in the pod, or when you cannot install DebugHero.

Delve in the image​

You can build an image that starts your service under Delve, for example dlv exec --headless. This works on every cluster, with no ephemeral containers and no extra capabilities at runtime.

But you must build and deploy a special image, and the pod restarts. A problem that depends on state or timing can be gone after the restart. The debug image must not stay in production.

Use this method for a development environment where you deploy debug builds all the time.

mirrord​

mirrord runs your service on your machine and connects it to the cluster. It mirrors or steals the traffic of a remote pod, and it gives your local process the environment variables, files, and network of that pod. It starts an agent in the cluster to do this. You debug the local process with your usual debugger.

mirrord does not debug the process in the pod. Use mirrord to run new code against real traffic and real dependencies before you deploy it. Use DebugHero to examine the process that already runs, with its current memory and state.

Signadot​

Signadot creates sandboxes: versions of one or more services that receive only the requests that are routed to them. A developer can test a change in a shared cluster without a full copy of the environment.

Signadot is for testing changes. It does not attach a debugger to a running process.

cdebug and kpexec​

cdebug and kpexec start a debug container next to the target container, or on the same node. The container gives you a shell and tools in the namespaces of the target, also for distroless images.

They help you examine files, processes, and the network of a container. They do not set up a source-level debugger or an IDE connection.

When to use DebugHero​

  • A Go service shows a problem in the cluster that you cannot reproduce on your machine.
  • You must see variables, goroutines, and the call stack of the real process.
  • You cannot rebuild or restart the service to investigate.

When a breakpoint stops the process, the process does not answer requests. On a production service, use conditional breakpoints or logpoints, and select a pod that does not receive critical traffic. See Limitations.