rust-tracing

Configure structured logging and diagnostics in Rust applications using the tracing ecosystem.

28|6|Updated Dec 27, 2025
One-click install
npx skills add https://github.com/johnlindquist/script-kit-next --skill rust-tracing-johnlindquist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rust-tracing
Source: https://github.com/johnlindquist/script-kit-next/tree/main/.opencode/skill/rust-tracing
Command: npx skills add https://github.com/johnlindquist/script-kit-next --skill rust-tracing-johnlindquist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a robust framework for structured logging and diagnostics in Rust applications, enabling better observability and debugging.

Core Features & Use Cases

  • Structured Logging: Log events with key-value pairs for easier parsing and analysis.
  • Spans: Track execution flow and context across asynchronous operations.
  • #[instrument] Attribute: Automatically instrument functions to create spans.
  • Filtering: Control log verbosity using environment variables (RUST_LOG) and EnvFilter.
  • Use Case: Debugging a complex asynchronous Rust service by tracing requests through multiple microservices and identifying performance bottlenecks.

Quick Start

Initialize logging with sensible defaults and then use info! to log a message.

Frequently Asked Questions about rust-tracing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add structured logging to a Rust application?

You can add structured logging to a Rust application by using the tracing ecosystem to log events with key-value pairs. This approach makes logs easier to parse and analyze compared to traditional plain text logging.

How do I track context across asynchronous Rust operations?

To track context across asynchronous Rust operations, use spans provided by the tracing ecosystem. Spans monitor execution flow and maintain context across complex async systems, helping you identify performance bottlenecks.

Can I automatically instrument Rust functions for diagnostics?

Yes, you can automatically instrument Rust functions for diagnostics using the #[instrument] attribute. This creates spans for the function automatically, reducing manual boilerplate when adding observability to your code.

How do I control log verbosity in Rust diagnostics?

You control log verbosity in Rust diagnostics by using environment variables like RUST_LOG alongside EnvFilter. This flexible filtering mechanism allows you to dynamically adjust log levels without modifying the application source code.

What is the best way to debug a complex asynchronous Rust service?

The best way to debug a complex asynchronous Rust service is using structured diagnostics to trace requests through multiple operations. The tracing framework provides the spans and events needed to identify performance bottlenecks and monitor execution flow.

Does structured logging in Rust work with environment variables?

Yes, structured logging in Rust works with environment variables through the EnvFilter mechanism. You can set RUST_LOG to control filtering and verbosity levels, allowing flexible runtime configuration of your diagnostic output.