Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sile/rustracing_jaeger
Jaeger tracing library for Rust
https://github.com/sile/rustracing_jaeger
jaeger opentracing rust
Last synced: 6 days ago
JSON representation
Jaeger tracing library for Rust
- Host: GitHub
- URL: https://github.com/sile/rustracing_jaeger
- Owner: sile
- License: mit
- Created: 2017-10-11T11:09:02.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-15T06:29:01.000Z (5 months ago)
- Last Synced: 2024-10-13T02:51:24.592Z (about 1 month ago)
- Topics: jaeger, opentracing, rust
- Language: Rust
- Size: 147 KB
- Stars: 83
- Watchers: 3
- Forks: 22
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
rustracing_jaeger
=================[![Crates.io: rustracing_jaeger](https://img.shields.io/crates/v/rustracing_jaeger.svg)](https://crates.io/crates/rustracing_jaeger)
[![Documentation](https://docs.rs/rustracing_jaeger/badge.svg)](https://docs.rs/rustracing_jaeger)
[![Actions Status](https://github.com/sile/rustracing_jaeger/workflows/CI/badge.svg)](https://github.com/sile/rustracing_jaeger/actions)
[![Coverage Status](https://coveralls.io/repos/github/sile/rustracing_jaeger/badge.svg?branch=master)](https://coveralls.io/github/sile/rustracing_jaeger?branch=master)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)[Jaeger][jaeger] client library created on top of [rustracing].
[jaeger]: https://github.com/jaegertracing/jaeger
[rustracing]: https://crates.io/crates/rustracing[Documentation](https://docs.rs/rustracing_jaeger)
Examples
--------### Basic Usage
```rust
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
```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](trace.png)
References
----------- [Jaeger Client Library](https://www.jaegertracing.io/docs/latest/client-libraries/)