mirror of
https://github.com/OMGeeky/appmap_tracing_test.git
synced 2025-12-26 16:07:50 +01:00
add a test function to reqwest spans
This commit is contained in:
@@ -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"] }
|
||||
|
||||
12
src/main.rs
12
src/main.rs
@@ -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(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user