Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

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

§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: -vdebug; 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 (runbootstrap_logs) installs the global subscriber. Product modules only emit events/spans.

§Lifecycle

  1. [bootstrap_logs] — before clap parse (phase 1b).
  2. [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 --verbose only (G-AUD-22).
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 flag.