Skip to main content

Record and inspect D-Bus traffic from the terminal

Project description

DBusLens logo

DBusLens

DBusLens is a terminal tool for recording and inspecting D-Bus traffic. It stores captures as .dblens bundles, opens them in a Textual UI, and helps you quickly understand who is sending messages, which members are busiest, and where errors are happening.

Highlights

  • A D-Bus inspector that feels like a real tool
    Clean, keyboard-first terminal UI built for investigation, not just dumping messages.

  • Built for speed
    Fast capture, fast load, and responsive browsing even when the trace is noisy.

  • From traffic ranking to failure diagnosis
    See top senders and members, then drill into error distribution, retries, call context, and arguments.

  • Understands changing bus ownership
    Recover service and process identity from short-lived unique names with capture-time snapshots and ownership timeline analysis.

  • One workflow for session and system bus
    Same commands, same bundle format, same inspection model.

  • Simple like perf, focused on D-Bus
    Capture now, inspect later, stay in the terminal.

Screenshots

Senders

Members

Errors

Plot

For Users

Requirements

DBusLens currently targets Linux systems with D-Bus tooling available on PATH.

  • Linux
  • dbus-monitor
  • gdbus
  • dot from Graphviz for plot SVG output

Install

Recommended:

uv tool install dbuslens

Alternative:

pip install dbuslens

After installation, confirm the command is available:

dbuslens --help

Enable Shell Completion

Bash:

mkdir -p ~/.local/share/bash-completion/completions
dbuslens completion bash > ~/.local/share/bash-completion/completions/dbuslens

Zsh:

mkdir -p ~/.local/share/zsh/site-functions
dbuslens completion zsh > ~/.local/share/zsh/site-functions/_dbuslens

Open a new shell after writing the completion file, or reload your shell configuration.

Basic Usage

Record a capture:

dbuslens record --duration 10
dbuslens record --bus system --duration 60 --output /tmp/system.dblens

Open a saved capture in the terminal UI:

dbuslens report
dbuslens report --input /tmp/system.dblens

Generate a dependency graph:

dbuslens plot
dbuslens plot --input /tmp/system.dblens
dbuslens plot --input /tmp/system.dblens --output graph.svg
dbuslens plot --input /tmp/system.dblens --format dot --output graph.dot
dbuslens plot --input /tmp/system.dblens --raw --output graph-raw.svg

plot writes a simplified dependency graph by default:

  • nodes prefer captured well-known service names over transient unique names
  • org.freedesktop.DBus traffic is hidden
  • SVG output uses a dark theme aligned with the terminal UI colors

When --output is omitted, plot writes next to the input bundle with a suffix matching --format. Use --output - when you want the rendered output on stdout.

Use --raw when you want the unfiltered graph with raw unique-name nodes.

Default behavior:

  • record uses the session bus by default
  • report reads record.dblens by default
  • plot reads record.dblens and writes record.svg by default

Typical workflow:

  1. Record traffic during the period you want to observe.
  2. Open the saved .dblens bundle with report.
  3. Switch between Senders, Members, and Errors.
  4. Move through the table and inspect the detail pane for the selected row or error summary.
  5. In Errors, use the details table to inspect resolved caller and target names, per-call arguments, and retry context.

Format reference:

Recent .dblens captures also embed ownership timeline metadata, which helps report resolve short-lived D-Bus unique names back to service labels, recover error call context across owner changes, and attach more accurate process metadata in the Errors view.

For Developers

Clone the repository and create the local environment:

git clone https://github.com/hualet/DBusLens.git
cd DBusLens
uv sync

Run the test suite:

./.venv/bin/python -m unittest discover -s tests -v

Run lint:

uv tool run --from pylint --with dbus-fast --with dpkt --with textual pylint $(git ls-files '*.py')

Verify the CLI wiring:

./.venv/bin/python -m dbuslens --help

Run the app from the checkout:

uv run dbuslens record --duration 10
uv run dbuslens report

Keyboard Shortcuts

  • s: switch to Senders
  • m: switch to Members
  • e: switch to Errors
  • Left / Right: switch between views
  • Up / Down: move inside the focused list or table
  • Tab / Shift+Tab: switch focus between panes
  • Enter: jump to the detail pane
  • q: quit

License

Licensed under the GNU General Public License v3.0. See LICENSE.

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

dbuslens-0.2.0.tar.gz (58.1 kB view details)

Uploaded Source

Built Distribution

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

dbuslens-0.2.0-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

Details for the file dbuslens-0.2.0.tar.gz.

File metadata

  • Download URL: dbuslens-0.2.0.tar.gz
  • Upload date:
  • Size: 58.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dbuslens-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ac36409b13eb36716066cd9d33413f8097ab1139e0a161506b4aac697d6d9dcc
MD5 e8938b54293e68f97c4666632ca8ddc7
BLAKE2b-256 6c51e69bac06bddac9a9ec406e9a5556954d955d39ece780a56e6affe773e926

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbuslens-0.2.0.tar.gz:

Publisher: release.yml on hualet/DBusLens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dbuslens-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dbuslens-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 43.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dbuslens-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 544fe4052f5a301cbf8a1c78245f42fe1bd0ecbfad541d9f7a8b762a0a5b7f1e
MD5 39eca3e6496aaf738f7c1cfbfd9efade
BLAKE2b-256 37bffc3716146b35335a124257a7586347f3ad8889709f1f210846ef05f2b9d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for dbuslens-0.2.0-py3-none-any.whl:

Publisher: release.yml on hualet/DBusLens

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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