File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
opentelemetry-otlp/src/exporter/http Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -388,7 +388,6 @@ impl OtlpHttpClient {
388388 #[ cfg( feature = "experimental-http-retry" ) ]
389389 {
390390 use crate :: retry:: retry_with_backoff;
391- use opentelemetry_sdk:: runtime:: Tokio ;
392391
393392 // Build request body once before retry loop
394393 let ( body, content_type, content_encoding) = build_body_fn ( self , data)
@@ -400,8 +399,17 @@ impl OtlpHttpClient {
400399 endpoint : self . collector_endpoint . to_string ( ) ,
401400 } ) ;
402401
402+ // Select runtime based on HTTP client feature - if we're using
403+ // one without Tokio, we don't need or want the Tokio async blocking
404+ // behaviour.
405+ #[ cfg( feature = "reqwest-blocking-client" ) ]
406+ let runtime = opentelemetry_sdk:: runtime:: NoAsync ;
407+
408+ #[ cfg( not( feature = "reqwest-blocking-client" ) ) ]
409+ let runtime = opentelemetry_sdk:: runtime:: Tokio ;
410+
403411 retry_with_backoff (
404- Tokio ,
412+ runtime ,
405413 self . retry_policy . clone ( ) ,
406414 classify_http_export_error,
407415 operation_name,
You can’t perform that action at this time.
0 commit comments