Skip to content

v0.6.0

Latest
Compare
Choose a tag to compare
@asaaki asaaki released this 15 Feb 19:10
· 3 commits to main since this release
v0.6.0
1c07151

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 to BoxedTracer 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(())
    }