Update readme example
This commit is contained in:
parent
2e77029b50
commit
d8f1f2e6f6
2 changed files with 8 additions and 3 deletions
|
@ -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"
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue