Skip to main content

Module tracing_setup

Module tracing_setup 

Source
Expand description

Process-local tracing subscriber (binary path only; libraries only emit). Process-local tracing setup for the ssh-cli binary path.

§Why this module was renamed from telemetry

The old name described a category of thing this product forbids. It never did any of it — the “out of scope” list below has been accurate since the first commit — but a reader auditing the tree for a telemetry ban found a module called telemetry and had to read it to learn it was innocent. A name that costs every reader a verification is a name that is wrong, however defensible its history.

The wire field "telemetry": false in vps doctor is a different thing and keeps its name. There the word is the claim being denied, and denying it in the operator’s own vocabulary is the point.

This rename is breaking for anyone importing ssh_cli::telemetry as a library. There is no deprecated alias: an alias would keep the name this rename exists to remove, and leave the audit exactly where it started.

§Product identity (Rules Rust — logs / tracing / rotation)

ssh-cli is a one-shot agent CLI, not a long-lived server:

SignalPolicy
Facadetracing only (no println! / env_logger / dual log consumer)
Sinkstderr text (data JSON stays on stdout)
Default filtererror (agent-first quiet stderr)
OverrideCLI only: -v → debug; ambient RUST_LOG is ignored; -q does not change the filter
Reloadreload::Layer so bootstrap (pre-parse) can reconfigure after argv
Bridgetracing-log::LogTracer for deps that emit via the log crate (russh, keyring)
Errorstracing_error::ErrorLayer for SpanTrace capture

§Explicitly out of scope

  • OpenTelemetry / OTLP / metrics backends (product: zero telemetry)
  • tracing-appender file rotation + WorkerGuard (no local log files; short process)
  • Admin HTTP /admin/log-level (no daemon / no network control plane)
  • tokio-console / Chrome tracing / journald / Docker log drivers as product features
  • Encrypted log-at-rest (no log files written by this binary)

Libraries that depend on ssh_cli as a crate should not call these installers; only the binary entry (run → bootstrap_logs) installs the global subscriber. Product modules only emit events/spans.

§Lifecycle

  1. crate::tracing_setup::bootstrap_logs — before clap parse (phase 1b).
  2. crate::tracing_setup::initialize_logs — after parse, reloads EnvFilter from -v only (G-E2E-09).
  3. Process exit — main flushes stderr; no file worker to join.

Functions§

bootstrap_logs
Installs stderr tracing before clap parse (one-shot lifecycle phase 1b).
build_env_filter
Builds the process-local tracing filter from CLI -v count only (G-AUD-22 / G14).
has_reload_handle
Returns whether the process owns a reloadable global filter (binary path).
initialize_logs
Initializes or reloads tracing-subscriber from the verbose CLI count (G14).