Skip to main content

A zero-preparation remote debugger for Python applications running in Kubernetes clusters or Docker containers.

Project description

debugwand ๐Ÿช„

A zero-preparation remote debugger for Python applications running in Kubernetes clusters or Docker containers.

Made possible by the Python 3.14 remote debugging attachment protocol and debugpy

Note: debugwand is experimental and not made for production. Use at your own risk.

Features

  • Zero-preparation debugging - No code changes or restarts required
  • Full breakpoint debugging - Using debugpy
  • Kubernetes-native - Handles pod discovery, service routing, and Knative
  • Container support - Debug Python processes in local Podman or Docker containers
  • Process selection - Interactive selection with CPU/memory metrics

Requirements

  • Python 3.14+ on both local machine and target
  • debugpy installed in the target container
  • kubectl (for Kubernetes) or Docker CLI (for containers)
  • SYS_PTRACE capability - on Linux/containers (see troubleshooting)

Quick Start

Kubernetes

# List pods and Python processes
wand pods -n my-namespace -s my-service --with-pids

# Debug a live process
wand debug -n my-namespace -s my-service

Docker/Podman

# Debug a container (must have SYS_PTRACE capability)
wand debug --container my-container

Containers must be started with --cap-add=SYS_PTRACE and -p 5679:5679

Connect your editor

VSCode launch configuration:

{
  "name": "Attach to debugwand",
  "type": "debugpy",
  "request": "attach",
  "connect": { "host": "localhost", "port": 5679 },
  "pathMappings": [{ "localRoot": "${workspaceFolder}", "remoteRoot": "/app" }]
}

Other DAP clients: Connect to localhost:5679

Configuration

Environment Variable Description
DEBUGWAND_SIMPLE_UI Set to 1 for simplified output (useful for Tilt/CI)
DEBUGWAND_AUTO_SELECT_POD Set to 1 to auto-select the newest pod

Additional Documentation

How it works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Local Machine  โ”‚                            โ”‚   Pod / Container  โ”‚
โ”‚                 โ”‚                            โ”‚                    โ”‚
โ”‚  debugwand CLI  โ”‚โ—„โ”€ kubectl/docker/podman โ”€โ–บ โ”‚   Python App       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                                              โ”‚
         โ”‚ 1. Discover pods (k8s only)                  โ”‚
         โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚
         โ”‚                                              โ”‚
         โ”‚ 2. List Python processes                     โ”‚
         โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚
         โ”‚                                              โ”‚
         โ”‚ 3. Select process                            โ”‚
         โ”‚                                              โ”‚
         โ”‚ 4. Inject debugpy via                        โ”‚
         โ”‚    sys.remote_exec()                         โ”‚
         โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚
         โ”‚                                              โ”‚
         โ”‚                            5. debugpy.listen()
         โ”‚                               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
         โ”‚ 6. Port-forward (k8s)         โ”‚              โ”‚
         โ”‚    or exposed port            โ”‚              โ”‚
         โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚
         โ”‚    localhost:5679             โ”‚              โ”‚
         โ”‚                               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
         โ”‚ 7. Connect editor                            โ”‚
         โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
         โ”‚         Debugging Session                    โ”‚
         โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

debugwand-0.5.0.tar.gz (158.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

debugwand-0.5.0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file debugwand-0.5.0.tar.gz.

File metadata

  • Download URL: debugwand-0.5.0.tar.gz
  • Upload date:
  • Size: 158.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for debugwand-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d18328f8e684d4b155b7cc5bca94c3cdb702ffc8b39a4e2bf568d667fb1f2d2e
MD5 992cb9b56a752d9e7f8210cc7fc91790
BLAKE2b-256 fab10ef12d4ec68ac33545d3506a73ade0fffffcc674dca28cb9e0ecbf00e4a0

See more details on using hashes here.

File details

Details for the file debugwand-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: debugwand-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for debugwand-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b6a1299a9dbfd6bd6dcb0893cd62088287ccdd6eaef57af0ccb02c332bd0bc9
MD5 00667d51693cdfd9933b3f8db9d87ffa
BLAKE2b-256 535c62d63507218d237ea9da78d8ebad1b6422919fe529ce4e64871425a50253

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page