Update readme example
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Aode (Lion) 2022-03-08 12:10:47 -06:00
parent 2e77029b50
commit d8f1f2e6f6
2 changed files with 8 additions and 3 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "tracing-awc"
description = "Tracing instrumentation for the awc http client"
version = "0.1.1"
version = "0.1.2"
authors = ["asonix <asonix@asonix.dog"]
edition = "2018"
license = "AGPL-3.0"

View file

@ -14,11 +14,16 @@ tracing-awc = { version = "0.1.0", features = ["opentelemetry_0_17"]
```rust
use awc::Client;
use std::error::Error;
use tracing_awc::{root_span, Propagate};
use tracing_awc::{root_span, Tracing};
use tracing_futures::Instrument;
async fn request(url: &str) -> Result<(), Box<dyn Error>> {
Client::new().get(url).propagate().send().await?;
Client::builder()
.wrap(Tracing)
.finish()
.get(url)
.send()
.await?;
Ok(())
}