rustracing_jaeger

Crates.iorustracing_jaeger
lib.rsrustracing_jaeger
version0.10.0
sourcesrc
created_at2017-10-17 15:32:33.435527
updated_at2024-06-15 06:28:43.549639
descriptionJaeger client library created on top of rustracing
homepagehttps://github.com/sile/rustracing_jaeger
repositoryhttps://github.com/sile/rustracing_jaeger
max_upload_size
id35990
size151,193
Takeru Ohta (sile)

documentation

README

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

use rustracing::sampler::AllSampler;
use rustracing_jaeger::Tracer;
use rustracing_jaeger::reporter::JaegerCompactReporter;

// Creates a tracer
let (span_tx, span_rx) = crossbeam_channel::bounded(10);
let tracer = Tracer::with_sender(AllSampler, span_tx);
{
    let span = tracer.span("sample_op").start();
    // Do something

} // The dropped span will be sent to `span_rx`

let span = span_rx.try_recv().unwrap();
assert_eq!(span.operation_name(), "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

# 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

Commit count: 132

cargo fmt