thoren-d/tracing-chrome

A library for generating chrome://tracing traces in Rust.

125

stars

52

commits

Rust

primary language

Mar 15, 2024

updated

chrome
profiling
rust
tracing
Browse cluster: Distributed Tracing and APM Instrumentation

README

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:

use tracing_chrome::ChromeLayerBuilder;
use tracing_subscriber::{registry::Registry, prelude::*};

let (chrome_layer, _guard) = ChromeLayerBuilder::new().build();
tracing_subscriber::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.

Contributors

thoren-d

39 commits

SUPERCILEX

3 commits

trevyn

2 commits

maan2003

1 commits

thoren-d/tracing-chrome

A library for generating chrome://tracing traces in Rust.

125

stars

52

commits

Rust

primary language

Mar 15, 2024

updated

chrome
profiling
rust
tracing
Browse cluster: Distributed Tracing and APM Instrumentation

README

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:

use tracing_chrome::ChromeLayerBuilder;
use tracing_subscriber::{registry::Registry, prelude::*};

let (chrome_layer, _guard) = ChromeLayerBuilder::new().build();
tracing_subscriber::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.

Contributors

thoren-d

39 commits

SUPERCILEX

3 commits

trevyn

2 commits

maan2003

1 commits

Languages

Rust

100.0%