rustracing_jaeger

Crates.io: rustracing_jaeger Documentation Actions Status Coverage Status License: MIT

Jaeger client library created on top of [rustracing].

Documentation

Examples

Basic Usage

```rust use rustracing::sampler::AllSampler; use rustracingjaeger::Tracer; use rustracingjaeger::reporter::JaegerCompactReporter;

// Creates a tracer let (spantx, spanrx) = crossbeamchannel::bounded(10); let tracer = Tracer::withsender(AllSampler, spantx); { let span = tracer.span("sampleop").start(); // Do something

} // The dropped span will be sent to span_rx

let span = spanrx.tryrecv().unwrap(); asserteq!(span.operationname(), "sample_op");

// Reports this span to the local jaeger agent let reporter = JaegerCompactReporter::new("sample_service").unwrap(); reporter.report(&[span]).unwrap(); ```

Executes report.rs example

```console

Run jaeger in background

$ docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest

Report example spans

$ cargo run --example report

View spans (see the image below)

$ firefox http://localhost:16686/ ```

Jaeger UI

References