@@ -22,18 +22,18 @@ use std::str::FromStr;
2222use std:: sync:: { Arc , Mutex } ;
2323use std:: time:: Duration ;
2424
25- #[ cfg( feature = "http-retry" ) ]
25+ #[ cfg( feature = "experimental- http-retry" ) ]
2626use crate :: retry_classification:: http:: classify_http_error;
27- #[ cfg( feature = "http-retry" ) ]
27+ #[ cfg( feature = "experimental- http-retry" ) ]
2828use opentelemetry_sdk:: retry:: { RetryErrorType , RetryPolicy } ;
2929
3030// Shared HTTP retry functionality
3131/// HTTP-specific error wrapper for retry classification
3232#[ derive( Debug ) ]
3333pub ( crate ) struct HttpExportError {
34- #[ cfg( feature = "http-retry" ) ]
34+ #[ cfg( feature = "experimental- http-retry" ) ]
3535 pub status_code : u16 ,
36- #[ cfg( feature = "http-retry" ) ]
36+ #[ cfg( feature = "experimental- http-retry" ) ]
3737 pub retry_after : Option < String > ,
3838 pub message : String ,
3939}
@@ -42,9 +42,9 @@ impl HttpExportError {
4242 /// Create a new HttpExportError without retry-after header
4343 pub ( crate ) fn new ( _status_code : u16 , message : String ) -> Self {
4444 Self {
45- #[ cfg( feature = "http-retry" ) ]
45+ #[ cfg( feature = "experimental- http-retry" ) ]
4646 status_code : _status_code,
47- #[ cfg( feature = "http-retry" ) ]
47+ #[ cfg( feature = "experimental- http-retry" ) ]
4848 retry_after : None ,
4949 message,
5050 }
@@ -57,16 +57,16 @@ impl HttpExportError {
5757 message : String ,
5858 ) -> Self {
5959 Self {
60- #[ cfg( feature = "http-retry" ) ]
60+ #[ cfg( feature = "experimental- http-retry" ) ]
6161 status_code : _status_code,
62- #[ cfg( feature = "http-retry" ) ]
62+ #[ cfg( feature = "experimental- http-retry" ) ]
6363 retry_after : Some ( _retry_after) ,
6464 message,
6565 }
6666 }
6767}
6868
69- #[ cfg( feature = "http-retry" ) ]
69+ #[ cfg( feature = "experimental- http-retry" ) ]
7070/// Classify HTTP export errors for retry decisions
7171pub ( crate ) fn classify_http_export_error ( error : & HttpExportError ) -> RetryErrorType {
7272 classify_http_error ( error. status_code , error. retry_after . as_deref ( ) )
@@ -113,7 +113,7 @@ pub struct HttpConfig {
113113 compression : Option < crate :: Compression > ,
114114
115115 /// The retry policy to use for HTTP requests.
116- #[ cfg( feature = "http-retry" ) ]
116+ #[ cfg( feature = "experimental- http-retry" ) ]
117117 retry_policy : Option < RetryPolicy > ,
118118}
119119
@@ -286,7 +286,7 @@ impl HttpExporterBuilder {
286286 self . exporter_config . protocol ,
287287 timeout,
288288 compression,
289- #[ cfg( feature = "http-retry" ) ]
289+ #[ cfg( feature = "experimental- http-retry" ) ]
290290 self . http_config . retry_policy . take ( ) ,
291291 ) )
292292 }
@@ -367,7 +367,7 @@ pub(crate) struct OtlpHttpClient {
367367 protocol : Protocol ,
368368 _timeout : Duration ,
369369 compression : Option < crate :: Compression > ,
370- #[ cfg( feature = "http-retry" ) ]
370+ #[ cfg( feature = "experimental- http-retry" ) ]
371371 retry_policy : RetryPolicy ,
372372 #[ allow( dead_code) ]
373373 // <allow dead> would be removed once we support set_resource for metrics and traces.
@@ -385,7 +385,7 @@ impl OtlpHttpClient {
385385 where
386386 F : Fn ( & Self , T ) -> Result < ( Vec < u8 > , & ' static str , Option < & ' static str > ) , String > ,
387387 {
388- #[ cfg( feature = "http-retry" ) ]
388+ #[ cfg( feature = "experimental- http-retry" ) ]
389389 {
390390 use opentelemetry_sdk:: retry:: retry_with_backoff;
391391 use opentelemetry_sdk:: runtime:: Tokio ;
@@ -419,7 +419,7 @@ impl OtlpHttpClient {
419419 . map_err ( |e| opentelemetry_sdk:: error:: OTelSdkError :: InternalFailure ( e. message ) )
420420 }
421421
422- #[ cfg( not( feature = "http-retry" ) ) ]
422+ #[ cfg( not( feature = "experimental- http-retry" ) ) ]
423423 {
424424 let ( body, content_type, content_encoding) = build_body_fn ( self , data)
425425 . map_err ( opentelemetry_sdk:: error:: OTelSdkError :: InternalFailure ) ?;
@@ -545,7 +545,7 @@ impl OtlpHttpClient {
545545 protocol : Protocol ,
546546 timeout : Duration ,
547547 compression : Option < crate :: Compression > ,
548- #[ cfg( feature = "http-retry" ) ] retry_policy : Option < RetryPolicy > ,
548+ #[ cfg( feature = "experimental- http-retry" ) ] retry_policy : Option < RetryPolicy > ,
549549 ) -> Self {
550550 OtlpHttpClient {
551551 client : Mutex :: new ( Some ( client) ) ,
@@ -554,7 +554,7 @@ impl OtlpHttpClient {
554554 protocol,
555555 _timeout : timeout,
556556 compression,
557- #[ cfg( feature = "http-retry" ) ]
557+ #[ cfg( feature = "experimental- http-retry" ) ]
558558 retry_policy : retry_policy. unwrap_or ( RetryPolicy {
559559 max_retries : 3 ,
560560 initial_delay_ms : 100 ,
@@ -733,7 +733,7 @@ pub trait WithHttpConfig {
733733 fn with_compression ( self , compression : crate :: Compression ) -> Self ;
734734
735735 /// Set the retry policy for HTTP requests.
736- #[ cfg( feature = "http-retry" ) ]
736+ #[ cfg( feature = "experimental- http-retry" ) ]
737737 fn with_retry_policy ( self , policy : RetryPolicy ) -> Self ;
738738}
739739
@@ -760,7 +760,7 @@ impl<B: HasHttpConfig> WithHttpConfig for B {
760760 self
761761 }
762762
763- #[ cfg( feature = "http-retry" ) ]
763+ #[ cfg( feature = "experimental- http-retry" ) ]
764764 fn with_retry_policy ( mut self , policy : RetryPolicy ) -> Self {
765765 self . http_client_config ( ) . retry_policy = Some ( policy) ;
766766 self
@@ -1010,7 +1010,7 @@ mod tests {
10101010 client : None ,
10111011 headers : Some ( initial_headers) ,
10121012 compression : None ,
1013- #[ cfg( feature = "http-retry" ) ]
1013+ #[ cfg( feature = "experimental- http-retry" ) ]
10141014 retry_policy : None ,
10151015 } ,
10161016 exporter_config : crate :: ExportConfig :: default ( ) ,
@@ -1078,7 +1078,7 @@ mod tests {
10781078 crate :: Protocol :: HttpBinary ,
10791079 std:: time:: Duration :: from_secs ( 10 ) ,
10801080 Some ( crate :: Compression :: Gzip ) ,
1081- #[ cfg( feature = "http-retry" ) ]
1081+ #[ cfg( feature = "experimental- http-retry" ) ]
10821082 None ,
10831083 ) ;
10841084
@@ -1111,7 +1111,7 @@ mod tests {
11111111 crate :: Protocol :: HttpBinary ,
11121112 std:: time:: Duration :: from_secs ( 10 ) ,
11131113 Some ( crate :: Compression :: Zstd ) ,
1114- #[ cfg( feature = "http-retry" ) ]
1114+ #[ cfg( feature = "experimental- http-retry" ) ]
11151115 None ,
11161116 ) ;
11171117
@@ -1141,7 +1141,7 @@ mod tests {
11411141 crate :: Protocol :: HttpBinary ,
11421142 std:: time:: Duration :: from_secs ( 10 ) ,
11431143 None , // No compression
1144- #[ cfg( feature = "http-retry" ) ]
1144+ #[ cfg( feature = "experimental- http-retry" ) ]
11451145 None ,
11461146 ) ;
11471147
@@ -1164,7 +1164,7 @@ mod tests {
11641164 crate :: Protocol :: HttpBinary ,
11651165 std:: time:: Duration :: from_secs ( 10 ) ,
11661166 Some ( crate :: Compression :: Gzip ) ,
1167- #[ cfg( feature = "http-retry" ) ]
1167+ #[ cfg( feature = "experimental- http-retry" ) ]
11681168 None ,
11691169 ) ;
11701170
@@ -1188,7 +1188,7 @@ mod tests {
11881188 crate :: Protocol :: HttpBinary ,
11891189 std:: time:: Duration :: from_secs ( 10 ) ,
11901190 Some ( crate :: Compression :: Zstd ) ,
1191- #[ cfg( feature = "http-retry" ) ]
1191+ #[ cfg( feature = "experimental- http-retry" ) ]
11921192 None ,
11931193 ) ;
11941194
@@ -1252,7 +1252,7 @@ mod tests {
12521252 protocol,
12531253 std:: time:: Duration :: from_secs ( 10 ) ,
12541254 compression,
1255- #[ cfg( feature = "http-retry" ) ]
1255+ #[ cfg( feature = "experimental- http-retry" ) ]
12561256 None ,
12571257 )
12581258 }
@@ -1488,7 +1488,7 @@ mod tests {
14881488 ) ) ;
14891489 }
14901490
1491- #[ cfg( feature = "http-retry" ) ]
1491+ #[ cfg( feature = "experimental- http-retry" ) ]
14921492 #[ test]
14931493 fn test_with_retry_policy ( ) {
14941494 use super :: super :: HttpExporterBuilder ;
@@ -1512,23 +1512,23 @@ mod tests {
15121512 assert_eq ! ( retry_policy. jitter_ms, 50 ) ;
15131513 }
15141514
1515- #[ cfg( feature = "http-retry" ) ]
1515+ #[ cfg( feature = "experimental- http-retry" ) ]
15161516 #[ test]
15171517 fn test_default_retry_policy_when_none_configured ( ) {
15181518 let client = create_test_client ( crate :: Protocol :: HttpBinary , None ) ;
1519-
1519+
15201520 // Verify default values are used
15211521 assert_eq ! ( client. retry_policy. max_retries, 3 ) ;
15221522 assert_eq ! ( client. retry_policy. initial_delay_ms, 100 ) ;
15231523 assert_eq ! ( client. retry_policy. max_delay_ms, 1600 ) ;
15241524 assert_eq ! ( client. retry_policy. jitter_ms, 100 ) ;
15251525 }
15261526
1527- #[ cfg( feature = "http-retry" ) ]
1527+ #[ cfg( feature = "experimental- http-retry" ) ]
15281528 #[ test]
15291529 fn test_custom_retry_policy_used ( ) {
15301530 use opentelemetry_sdk:: retry:: RetryPolicy ;
1531-
1531+
15321532 let custom_policy = RetryPolicy {
15331533 max_retries : 7 ,
15341534 initial_delay_ms : 500 ,
@@ -1545,7 +1545,7 @@ mod tests {
15451545 None ,
15461546 Some ( custom_policy) ,
15471547 ) ;
1548-
1548+
15491549 // Verify custom values are used
15501550 assert_eq ! ( client. retry_policy. max_retries, 7 ) ;
15511551 assert_eq ! ( client. retry_policy. initial_delay_ms, 500 ) ;
0 commit comments