add a test function to reqwest spans

This commit is contained in:
OMGeeky
2023-07-01 23:11:27 +02:00
parent 7aef15c936
commit e21ba0f650
2 changed files with 14 additions and 1 deletions

View File

@@ -11,3 +11,6 @@ tracing-subscriber = "0.3"
serde = { version = "1.0", features=["derive", "default"] }
serde_json = "1.0"
reqwest = "0.11"
tokio = { version = "1.29", features=["macros", "rt", "default", "tracing", "rt-multi-thread"] }

View File

@@ -8,12 +8,22 @@ use tracing_subscriber::Registry;
use appmap_tracing_test::appmap_definition::*;
use appmap_tracing_test::*;
use reqwest;
pub fn main() -> Result<(), Box<dyn Error>> {
#[tokio::main]
pub async fn main() -> Result<(), Box<dyn Error>> {
init_tracing();
sample_json()?;
test_sub_mod();
test_reqwest(true).await?;
Ok(())
}
#[instrument]
async fn test_reqwest(test_param: bool) -> Result<(), Box<dyn Error>> {
let result = reqwest::get("http://google.com").await?;
println!("result: {:?}", result);
Ok(())
}