minitrace-jaeger

Crates.iominitrace-jaeger
lib.rsminitrace-jaeger
version0.6.7
sourcesrc
created_at2022-01-14 18:19:22.634973
updated_at2024-06-23 09:28:13.559924
descriptionJaeger reporter for minitrace-rust
homepagehttps://github.com/tikv/minitrace-rust
repositoryhttps://github.com/tikv/minitrace-rust
max_upload_size
id513981
size25,589
Andy Lok (andylokandy)

documentation

https://docs.rs/minitrace-jaeger

README

minitrace-jaeger

Documentation Crates.io LICENSE

Jaeger reporter for minitrace.

Dependencies

[dependencies]
minitrace = "0.6"
minitrace-jaeger = "0.6"

Setup Jaeger Agent

docker run --rm -d -p6831:6831/udp -p14268:14268 -p16686:16686 --name jaeger jaegertracing/all-in-one:latest

cargo run --example synchronous

Web UI is available on http://127.0.0.1:16686/

Report to Jaeger Agent

use std::net::SocketAddr;

use minitrace::collector::Config;
use minitrace::prelude::*;

// Initialize reporter
let reporter =
    minitrace_jaeger::JaegerReporter::new("127.0.0.1:6831".parse().unwrap(), "asynchronous")
        .unwrap();
minitrace::set_reporter(reporter, Config::default());

{
    // Start tracing
    let root = Span::root("root", SpanContext::random());
}

minitrace::flush();
Commit count: 180

cargo fmt