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 {
388
388
#[ cfg( feature = "experimental-http-retry" ) ]
389
389
{
390
390
use crate :: retry:: retry_with_backoff;
391
- use opentelemetry_sdk:: runtime:: Tokio ;
392
391
393
392
// Build request body once before retry loop
394
393
let ( body, content_type, content_encoding) = build_body_fn ( self , data)
@@ -400,8 +399,17 @@ impl OtlpHttpClient {
400
399
endpoint : self . collector_endpoint . to_string ( ) ,
401
400
} ) ;
402
401
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
+
403
411
retry_with_backoff (
404
- Tokio ,
412
+ runtime ,
405
413
self . retry_policy . clone ( ) ,
406
414
classify_http_export_error,
407
415
operation_name,
You can’t perform that action at this time.
0 commit comments