Skip to main content

basename

Function basename 

Source
pub fn basename(path: &Path) -> &str
Expand description

Round-36 F1: return just the file name of path as a &str, suitable for path = %basename(&path) in tracing macros.

The concern is downstream OTLP export. Every tracing::warn!(path = %path.display(), ...) in this workspace flows through tracing_opentelemetry::layer when the otel feature is on, so absolute deployment paths (/var/lib/agentvisor-ai/spool/..., custom outbox layouts, quarantine locations) land in whatever SIEM ingests OTLP — same class of leak round-27 F6 closed on the dashboard and round-35 F1/F2 closed on %error on reqwest::Error, with a different producer / same sink. basename keeps enough context for operator triage (the file name usually encodes the session id or offset) without leaking the deployment topology. Non-UTF-8 file names or paths that end in .. fall back to ?; callers who need the full path server-side may still route it through a separate operator-only log channel.