tracing-chrome

Crates.io Documentation GitHub CI

Overview

tracing-chrome is a Layer for tracing-subscriber that outputs traces in Chrome's trace viewer format that can be viewed with chrome://tracing or ui.perfetto.dev.

Usage

Add this near the beginning of main: ```rust use tracingchrome::ChromeLayerBuilder; use tracingsubscriber::{registry::Registry, prelude::*};

let (chromelayer, _guard) = ChromeLayerBuilder::new().build(); tracingsubscriber::registry().with(chrome_layer).init(); ```

When _guard is dropped, your trace will be in a file like trace-1668480819035032.json.

Open that file with ui.perfetto.dev (or chrome://tracing) and take a look at your pretty trace.

License

Licensed under the MIT license

Contributions

Unless you state otherwise, any contribution intentionally submitted for inclusion in the work shall be licensed as above.