Observability
Context
PR #285 (#285) adds explicit config path resolution via resolve_config_path, env_config_path, collect_diag_file_layers, and push_file_layers in src/cli/config_merge.rs. None of these operational pathways currently emit structured log or trace events. When a user provides an explicit --config path that fails to load, or when the precedence logic selects an unexpected source, there is no diagnostic signal in the logs to aid debugging.
Required work
Instrument the following functions using the existing tracing dependency:
resolve_config_path – emit a debug event recording which selector was chosen (CLI flag, NETSUKE_CONFIG, NETSUKE_CONFIG_PATH, or None) and the resolved path.
env_config_path – emit a trace event when a variable is read and whether it produced a path.
collect_diag_file_layers – emit a debug span covering the layer collection; include an event when the explicit path is used and when discovery is performed instead.
- Error paths – emit a
warn event whenever an explicit config load fails, including the path and the error.
Acceptance criteria
- All four functions have at least one
tracing call on each significant branch.
- No new dependencies are required beyond the existing
tracing crate.
- Structured fields (not format strings) are used for path values and error descriptions where possible.
Raised by
Requested by @leynos as a follow-up to #285.
Observability
Context
PR #285 (#285) adds explicit config path resolution via
resolve_config_path,env_config_path,collect_diag_file_layers, andpush_file_layersinsrc/cli/config_merge.rs. None of these operational pathways currently emit structured log or trace events. When a user provides an explicit--configpath that fails to load, or when the precedence logic selects an unexpected source, there is no diagnostic signal in the logs to aid debugging.Required work
Instrument the following functions using the existing
tracingdependency:resolve_config_path– emit adebugevent recording which selector was chosen (CLI flag,NETSUKE_CONFIG,NETSUKE_CONFIG_PATH, orNone) and the resolved path.env_config_path– emit atraceevent when a variable is read and whether it produced a path.collect_diag_file_layers– emit adebugspan covering the layer collection; include an event when the explicit path is used and when discovery is performed instead.warnevent whenever an explicit config load fails, including the path and the error.Acceptance criteria
tracingcall on each significant branch.tracingcrate.Raised by
Requested by @leynos as a follow-up to #285.