Changed
-
Update dependencies and fix breaking changes
opentelemetry = "0.17" opentelemetry-semantic-conventions = "0.9"
Due to lifetime and thread-safety issues (non-Send across await point),
a switch toBoxedTracer
was necessary. Since most examples and implementation do that,
this crate gets in line with the others now.Examples are updated accordingly.
Easiest way is to use
::default()
instead of::new(tracer)
to use the global tracer.#[async_std::main] async fn main() -> surf::Result<()> { let _tracer = opentelemetry_jaeger::new_pipeline().install_batch(opentelemetry::runtime::AsyncStd)?; let otel_mw = opentelemetry_surf::OpenTelemetryTracingMiddleware::default(); let client = surf::client().with(otel_mw); let res = client.get("https://httpbin.org/get").await?; dbg!(res); opentelemetry::global::shutdown_tracer_provider(); Ok(()) }