Skip to content

Commit 40e95fc

Browse files
authored
Merge pull request #10 from xtrusia/feature/session-reporting-workflows
Add session reporting workflows
2 parents 2a3ee25 + a90c67e commit 40e95fc

15 files changed

Lines changed: 2014 additions & 530 deletions

File tree

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ Notable changes are documented here. The format follows
66

77
## [Unreleased]
88

9+
### Added
10+
11+
- Added `cephlens report <session>` to export recorded sessions as Markdown.
12+
- Live TUI sessions now write `report.md` on exit when snapshots were recorded.
13+
- Added `cephlens doctor` for SSH, sudo, Ceph CLI, and tracer preflight checks.
14+
- Added `cephlens lab` to run a short benchmark with optional trace capture and
15+
write a session report.
16+
17+
### Changed
18+
19+
- Moved diagnostic insight rules out of the TUI so CLI reports reuse the same
20+
checks.
21+
- Replaced MicroCeph-specific node readiness wording with Ceph
22+
version/deployment data.
23+
924
## [0.1.2] - 2026-07-05
1025

1126
### Added

README.md

Lines changed: 66 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ remote runner script that removes itself when tracing stops or cephlens exits;
2020
## Features
2121

2222
- Live cluster health, quorum, OSD counts, and IO throughput over a single SSH stream.
23-
- Per-node readiness: connection state, OSD ids, CPU and memory percent, and microceph version.
23+
- Per-node readiness: connection state, OSD ids, CPU and memory percent, and Ceph version/deployment.
2424
- osdtrace eBPF latency tracing with per-OSD and per-PG breakdown of queue, BlueStore, and KV-commit latency.
2525
- No standing agent: no permanent daemon on the nodes; the osdtrace runner script removes itself on stop, quit, or TTL expiry. (The cephtrace tracer binaries you deploy do persist under `~/.cephlens/bin/`.)
2626
- Edit hosts and trace settings live in the TUI; changes apply to open SSH streams immediately.
27+
- Export recorded sessions as Markdown reports with the same diagnostic rules used by the TUI.
2728

2829
## Requirements
2930

@@ -218,20 +219,32 @@ check for lab use only; do not use it for production clusters.
218219
## Quick start
219220

220221
```sh
221-
cargo run -- snapshot
222-
cargo run -- probe
223-
cargo run -- record --count 3 --interval-secs 2
222+
cargo run -- init-config
223+
cargo run -- doctor
224224
cargo run -- tui --refresh-secs 1
225-
cargo run -- bench --host ceph-node-1 --seconds 5
226225
```
227226

228-
Create a fresh config template:
227+
## Workflows
228+
229+
### Preflight
230+
231+
Run `doctor` before a live session or lab capture. It checks SSH, passwordless
232+
sudo, admin Ceph CLI access, `rados`, osdtrace on OSD hosts, and
233+
kfstrace/radostrace on `client_hosts`:
229234

230235
```sh
231-
cargo run -- init-config
236+
cargo run -- doctor
232237
```
233238

234-
Useful keys in the TUI (the dashboard auto-refreshes every `refresh_secs`):
239+
### Live TUI
240+
241+
Start the dashboard after `doctor` passes:
242+
243+
```sh
244+
cargo run -- tui --refresh-secs 1
245+
```
246+
247+
The dashboard auto-refreshes every `refresh_secs`. Useful keys:
235248

236249
```text
237250
p run a probe readiness check
@@ -265,33 +278,68 @@ Esc/c return to live dashboard
265278
Config edits are written to `cephlens.toml` and applied to the live SSH streams
266279
immediately after the edit is confirmed.
267280

268-
Before installing, cephlens checks the remote kernel, architecture, and
269-
`/etc/os-release`. The automatic install path only runs when the target is
270-
Linux, x86_64/amd64, and in the Debian/Ubuntu family. Other platforms are shown
271-
as unsupported instead of being blindly overwritten.
272-
273281
The integrated trace panel can show osdtrace, kfstrace, or radostrace data.
274282
The osdtrace view observes Ceph OSD nodes. It streams `op_r`, `op_w`, and
275283
`subop_w` lines into the live dashboard and summarizes total, queue, and
276284
BlueStore latency. The kfstrace and radostrace views run on `client_hosts`.
277285
On wide terminals the trace panel appears on the right; on tall terminals it
278286
appears below the dashboard.
287+
Live TUI mode keeps one SSH stream open for cluster status and one stream per
288+
host for node readiness. Each stream emits data once per second by default and
289+
the node table shows connection state (`live`, `dial`, `retry`, `error`), OSD
290+
ids, CPU percentage, and memory percentage.
279291
When `trace_auto_start` is true, cephlens starts osdtrace runners as soon as the
280292
TUI opens. The default config keeps it false so an operator explicitly starts
281293
and stops tracing with `t`, `f`, `r`, or `a`.
282294
If no events appear, the cluster may be idle or all observed operations may be
283295
below the configured 1ms latency threshold. Set `trace_latency_ms = 0` to trace
284296
all observed osdtrace ops, or run Ceph IO while the trace runners are active.
285297

298+
Before installing osdtrace from the TUI, cephlens checks the remote kernel,
299+
architecture, and `/etc/os-release`. The automatic install path only runs when
300+
the target is Linux, x86_64/amd64, and in the Debian/Ubuntu family. Other
301+
platforms are shown as unsupported instead of being blindly overwritten.
302+
303+
### Lab capture
304+
305+
Use `lab` for a short benchmark plus trace capture. It creates a session,
306+
records before/after snapshots, writes `bench.log`, and writes `report.md`.
307+
The trace mode can be `none`, `osd`, or `all`:
308+
309+
```sh
310+
cargo run -- lab --host ceph-node-1 --seconds 30 --trace all
311+
```
312+
313+
### One-shot commands
314+
315+
Use these for scripts or quick checks outside the TUI:
316+
317+
```sh
318+
cargo run -- snapshot
319+
cargo run -- probe
320+
cargo run -- record --count 3 --interval-secs 2
321+
cargo run -- bench --host ceph-node-1 --seconds 5
322+
```
323+
324+
### Sessions and reports
325+
286326
Live TUI sessions are recorded under `.cephlens/sessions/<timestamp>/`.
287327
Cluster snapshots are appended to `snapshots.jsonl`, and raw trace lines are
288328
appended as plain text to `trace-osd.log`, `trace-kfs.log`, and
289-
`trace-rados.log`.
329+
`trace-rados.log`. When the TUI exits after recording at least one snapshot,
330+
cephlens also writes `.cephlens/sessions/<timestamp>/report.md`.
290331

291-
Live TUI mode keeps one SSH stream open for cluster status and one stream per
292-
host for node readiness. Each stream emits data once per second by default and
293-
the node table shows connection state (`live`, `dial`, `retry`, `error`), OSD
294-
ids, CPU percentage, and memory percentage.
332+
Turn a recorded session into a Markdown investigation note:
333+
334+
```sh
335+
cargo run -- report .cephlens/sessions/<timestamp> --out report.md
336+
```
337+
338+
Replay a recorded snapshot sequence in the TUI:
339+
340+
```sh
341+
cargo run -- replay .cephlens/sessions/<timestamp>
342+
```
295343

296344
## License
297345

0 commit comments

Comments
 (0)