```sh
docker run -d -p6831:6831/udp -p6832:6832/udp -p16686:16686 jaegertracing/all-in-one:latest
cargo run --example server
curl http://localhost:3000/
firefox http://localhost:16686/ ```
Cargo.toml
toml
[dependencies]
async-std = { version = "1.7", features = ["attributes"] }
opentelemetry = { version = "0.10", features = ["async-std"] }
opentelemetry-jaeger = { version = "0.9", features = ["async-std"] }
opentelemetry-tide = "0.4"
thrift = "0.13"
tide = "0.13"
server.rs
```rust use opentelemetry::global as otelglobal; use opentelemetry::sdk::propagation::TraceContextPropagator; use opentelemetrysemanticconventions::resource; use opentelemetrytide::OpenTelemetryTracingMiddleware;
const VERSION: &str = env!("CARGOPKGVERSION");
async fn main() -> Result<(), Box
let tags = [resource::SERVICE_VERSION.string(VERSION)];
let (tracer, _uninstall) = opentelemetry_jaeger::new_pipeline()
.with_service_name("example-server")
.with_tags(tags.iter().map(ToOwned::to_owned))
.install()
.expect("pipeline install failure");
let mut app = tide::new();
app.with(OpenTelemetryTracingMiddleware::new(tracer));
app.at("/").get(|_| async move { Ok("Hello, OpenTelemetry!") });
app.listen("127.0.0.1:3000").await?;
Ok(())
} ```
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.