diff --git a/opentelemetry-otlp/src/exporter/http/mod.rs b/opentelemetry-otlp/src/exporter/http/mod.rs index da6c280a61..e718960686 100644 --- a/opentelemetry-otlp/src/exporter/http/mod.rs +++ b/opentelemetry-otlp/src/exporter/http/mod.rs @@ -66,8 +66,11 @@ pub struct HttpConfig { impl Default for HttpConfig { fn default() -> Self { #[cfg(feature = "reqwest-blocking-client")] - let default_client = - Some(Arc::new(reqwest::blocking::Client::new()) as Arc); + let default_client = std::thread::spawn(|| { + Some(Arc::new(reqwest::blocking::Client::new()) as Arc) + }) + .join() + .expect("creating reqwest::blocking::Client on a new thread not to fail"); #[cfg(all(not(feature = "reqwest-blocking-client"), feature = "reqwest-client"))] let default_client = Some(Arc::new(reqwest::Client::new()) as Arc); #[cfg(all(