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-monitorgdbusdotfrom Graphviz forplotSVG 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.DBustraffic 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:
recorduses thesessionbus by defaultreportreadsrecord.dblensby defaultplotreadsrecord.dblensand writesrecord.svgby default
Typical workflow:
- Record traffic during the period you want to observe.
- Open the saved
.dblensbundle withreport. - Switch between
Senders,Members, andErrors. - Move through the table and inspect the detail pane for the selected row or error summary.
- 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 toSendersm: switch toMemberse: switch toErrorsLeft/Right: switch between viewsUp/Down: move inside the focused list or tableTab/Shift+Tab: switch focus between panesEnter: jump to the detail paneq: quit
License
Licensed under the GNU General Public License v3.0. See LICENSE.
Metadata
Release files for dbuslens 2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dbuslens-2.0.tar.gz | 58.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dbuslens-2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 101.2 kB
Release files / dbuslens-2.0.tar.gz
| Download URL | dbuslens-2.0.tar.gz |
|---|---|
| Size | 58.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cdad2523989b9652deffcb711a630b2f35cdc1be06459aebc81ebc46f63a73ee
|
|
BLAKE2b-256 checksum How to use checksums |
5b6c94e20e0c4208541d174d9204955521bbf58fc484797e45f78b4272621943
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.
Transparency logRelease files / dbuslens-2.0-py3-none-any.whl
| Download URL | dbuslens-2.0-py3-none-any.whl |
|---|---|
| Size | 43.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d02512d9f6c15064e8170279be7f76a84ac2310f225fdb1bb130a627169de68
|
|
BLAKE2b-256 checksum How to use checksums |
ac9eacf4543b9396181128628ed6c7bd1031b1a31e7f73882f2ed5bd39925567
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.
Transparency logSecurity for dbuslens 2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for dbuslens-2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.