#opentracing #jaeger

rustracing_jaeger

Jaeger client library created on top of rustracing

19 releases

✓ Uses Rust 2018 edition

0.4.0 Feb 15, 2020
0.3.0 Nov 19, 2019
0.2.1 Mar 29, 2019
0.1.9 Dec 26, 2018
0.1.3 Oct 30, 2017

#1 in #opentracing

Download history 2292/week @ 2019-12-01 1963/week @ 2019-12-08 764/week @ 2019-12-15 467/week @ 2019-12-22 467/week @ 2019-12-29 450/week @ 2020-01-05 660/week @ 2020-01-12 692/week @ 2020-01-19 567/week @ 2020-01-26 574/week @ 2020-02-02 854/week @ 2020-02-09 517/week @ 2020-02-16 657/week @ 2020-02-23 480/week @ 2020-03-01 584/week @ 2020-03-08 525/week @ 2020-03-15

4,409 downloads per month
Used in 18 crates (5 directly)

MIT license

79KB
957 lines

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

Dependencies

~1.3–1.8MB
~36K SLoC