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
  • Docker container support - Debug Python processes in local 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

# 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 โ”€โ–บโ”‚   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.4.2.tar.gz (157.8 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.4.2-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: debugwand-0.4.2.tar.gz
  • Upload date:
  • Size: 157.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","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.4.2.tar.gz
Algorithm Hash digest
SHA256 e60552c8b5d517a3944916e97dae8e03dcfb82b4435d74900095188e50d0cad4
MD5 971ae55ffb38db5fb8a230078d1ef482
BLAKE2b-256 04d3f550ca7f75af97cb9aefdab2d541ad0105389248133b73908ed26ab2f088

See more details on using hashes here.

File details

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

File metadata

  • Download URL: debugwand-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","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.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5316905c195b5ec08cf73b11750872df24d8831eac49771fba1e60ab95ed6974
MD5 baf68facd15d5605540e68918834d6b2
BLAKE2b-256 08720d21a6effea61a2700fabf00b2e60673e004a69be7b7fa5cfe8883f3d586

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