28 releases

0.10.0 Jun 15, 2024
0.9.0 Feb 7, 2023
0.8.1 Apr 6, 2022
0.7.0 Nov 25, 2021
0.1.3 Oct 30, 2017

#35 in Profiling

Download history 16051/week @ 2024-12-18 8515/week @ 2024-12-25 13069/week @ 2025-01-01 19383/week @ 2025-01-08 17805/week @ 2025-01-15 21525/week @ 2025-01-22 23668/week @ 2025-01-29 26243/week @ 2025-02-05 23795/week @ 2025-02-12 21543/week @ 2025-02-19 22542/week @ 2025-02-26 21252/week @ 2025-03-05 21912/week @ 2025-03-12 24635/week @ 2025-03-19 15915/week @ 2025-03-26 13198/week @ 2025-04-02

78,403 downloads per month
Used in 43 crates (7 directly)

MIT license

81KB
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

~2.3–9MB
~91K SLoC