What problem does it solve?
Rust projects using the tracing crate often suffer from inconsistent span usage, silent functions with no log output, leaked secrets in logs, and broken async span propagation. This Skill enforces a single, consistent set of tracing standards whenever you write, modify, or review Rust code involving spans, events, or subscribers.
Core Features & Use Cases
- Span and Event Standards: Defines where
#[instrument] spans are required (entry layers, usecases, external boundaries) and where they are forbidden (hot paths, pure utilities), plus the rule that every span must contain at least one event.
- Async-Safe Patterns: Provides three correct patterns for span lifecycle in async code (
#[instrument], .instrument(span), inline async blocks) and forbids holding .entered() guards across .await points that break Send bounds.
- Structured Field Conventions: Standardizes snake_case field names like
trace_id, session_id, and error_kind, mandates skip() for secrets and large payloads, and defines level usage from ERROR to TRACE.
- Use Case: When adding a new Tauri command or reviewing a state machine handler, apply this Skill to generate correctly instrumented code with propagated trace IDs, structured error events, and no sensitive data leakage.
Quick Start
Review my Rust function that handles pairing session events and add proper tracing instrumentation following the project standards.