AWS SDK

AWS SDK

rev. b03bf5aed2782c4318a3be6187062c92ef123a66 (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/iam/src/config/endpoint/internals.rs

@@ -5,5 +65,68 @@
   25     25   
        if (*use_fips) == (true) {
   26     26   
            return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
   27     27   
                "Invalid Configuration: FIPS and custom endpoint are not supported".to_string(),
   28     28   
            ));
   29     29   
        }
   30     30   
        if (*use_dual_stack) == (true) {
   31     31   
            return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
   32     32   
                "Invalid Configuration: Dualstack and custom endpoint are not supported".to_string(),
   33     33   
            ));
   34     34   
        }
   35         -
        return Ok(::aws_smithy_types::endpoint::Endpoint::builder().url(endpoint.to_owned()).build());
          35  +
        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
          36  +
            .url(endpoint.to_owned())
          37  +
            .property("is_custom_endpoint", true)
          38  +
            .build());
   36     39   
    }
   37     40   
    #[allow(unused_variables)]
   38     41   
    if let Some(region) = region {
   39     42   
        #[allow(unused_variables)]
   40     43   
        if let Some(partition_result) = partition_resolver.resolve_partition(region.as_ref() as &str, _diagnostic_collector) {
   41     44   
            if (partition_result.name()) == ("aws") {
   42     45   
                if (*use_fips) == (false) {
   43     46   
                    if (*use_dual_stack) == (true) {
   44     47   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
   45     48   
                            .url("https://iam.global.api.aws".to_string())

tmp-codegen-diff/aws-sdk/sdk/kms/Cargo.toml

@@ -11,11 +131,131 @@
   31     31   
path = "../aws-smithy-http"
   32     32   
version = "0.62.5"
   33     33   
   34     34   
[dependencies.aws-smithy-json]
   35     35   
path = "../aws-smithy-json"
   36     36   
version = "0.61.7"
   37     37   
   38     38   
[dependencies.aws-smithy-runtime]
   39     39   
path = "../aws-smithy-runtime"
   40     40   
features = ["client"]
   41         -
version = "1.9.4"
          41  +
version = "1.9.5"
   42     42   
   43     43   
[dependencies.aws-smithy-runtime-api]
   44     44   
path = "../aws-smithy-runtime-api"
   45     45   
features = ["client", "http-02x"]
   46     46   
version = "1.9.2"
   47     47   
   48     48   
[dependencies.aws-smithy-types]
   49     49   
path = "../aws-smithy-types"
   50     50   
version = "1.3.4"
   51     51   
   52     52   
[dependencies.aws-types]
   53     53   
path = "../aws-types"
   54     54   
version = "1.3.10"
   55     55   
   56     56   
[dependencies.bytes]
   57     57   
version = "1.4.0"
   58     58   
   59     59   
[dependencies.fastrand]
   60     60   
version = "2.0.0"
   61     61   
   62     62   
[dependencies.http]
   63     63   
version = "0.2.9"
   64     64   
   65     65   
[dependencies.regex-lite]
   66     66   
version = "0.1.5"
   67     67   
   68     68   
[dependencies.tracing]
   69     69   
version = "0.1"
   70     70   
[dev-dependencies.aws-config]
   71     71   
path = "../aws-config"
   72     72   
version = "1.8.10"
   73     73   
   74     74   
[dev-dependencies.aws-credential-types]
   75     75   
path = "../aws-credential-types"
   76     76   
features = ["test-util"]
   77     77   
version = "1.2.9"
   78     78   
   79     79   
[dev-dependencies.aws-runtime]
   80     80   
path = "../aws-runtime"
   81     81   
features = ["test-util"]
   82     82   
version = "1.5.14"
   83     83   
   84     84   
[dev-dependencies.aws-smithy-async]
   85     85   
path = "../aws-smithy-async"
   86     86   
features = ["test-util"]
   87     87   
version = "1.2.6"
   88     88   
   89     89   
[dev-dependencies.aws-smithy-http-client]
   90     90   
path = "../aws-smithy-http-client"
   91     91   
features = ["test-util", "wire-mock"]
   92     92   
version = "1.1.4"
   93     93   
   94     94   
[dev-dependencies.aws-smithy-protocol-test]
   95     95   
path = "../aws-smithy-protocol-test"
   96     96   
version = "0.63.6"
   97     97   
   98     98   
[dev-dependencies.aws-smithy-runtime]
   99     99   
path = "../aws-smithy-runtime"
  100    100   
features = ["test-util"]
  101         -
version = "1.9.4"
         101  +
version = "1.9.5"
  102    102   
  103    103   
[dev-dependencies.aws-smithy-runtime-api]
  104    104   
path = "../aws-smithy-runtime-api"
  105    105   
features = ["test-util"]
  106    106   
version = "1.9.2"
  107    107   
  108    108   
[dev-dependencies.aws-smithy-types]
  109    109   
path = "../aws-smithy-types"
  110    110   
features = ["test-util"]
  111    111   
version = "1.3.4"

tmp-codegen-diff/aws-sdk/sdk/kms/src/config.rs

@@ -1273,1273 +1332,1334 @@
 1293   1293   
            use crate::config::endpoint::ResolveEndpoint;
 1294   1294   
            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
 1295   1295   
        }));
 1296   1296   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1297   1297   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1298   1298   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1299   1299   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1300   1300   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
 1301   1301   
        runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
 1302   1302   
        runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
        1303  +
        runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
        1304  +
        runtime_components.push_interceptor(::aws_runtime::endpoint_discovery::EndpointOverrideInterceptor::new());
 1303   1305   
        runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
 1304   1306   
        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1305   1307   
            ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
 1306   1308   
        ));
 1307   1309   
        Self { config, runtime_components }
 1308   1310   
    }
 1309   1311   
}
 1310   1312   
 1311   1313   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
 1312   1314   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {

tmp-codegen-diff/aws-sdk/sdk/kms/src/config/endpoint/internals.rs

@@ -5,5 +65,68 @@
   25     25   
        if (*use_fips) == (true) {
   26     26   
            return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
   27     27   
                "Invalid Configuration: FIPS and custom endpoint are not supported".to_string(),
   28     28   
            ));
   29     29   
        }
   30     30   
        if (*use_dual_stack) == (true) {
   31     31   
            return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
   32     32   
                "Invalid Configuration: Dualstack and custom endpoint are not supported".to_string(),
   33     33   
            ));
   34     34   
        }
   35         -
        return Ok(::aws_smithy_types::endpoint::Endpoint::builder().url(endpoint.to_owned()).build());
          35  +
        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
          36  +
            .url(endpoint.to_owned())
          37  +
            .property("is_custom_endpoint", true)
          38  +
            .build());
   36     39   
    }
   37     40   
    #[allow(unused_variables)]
   38     41   
    if let Some(region) = region {
   39     42   
        #[allow(unused_variables)]
   40     43   
        if let Some(partition_result) = partition_resolver.resolve_partition(region.as_ref() as &str, _diagnostic_collector) {
   41     44   
            if (*use_fips) == (true) {
   42     45   
                if (*use_dual_stack) == (true) {
   43     46   
                    if (true) == (partition_result.supports_fips()) {
   44     47   
                        if (true) == (partition_result.supports_dual_stack()) {
   45     48   
                            return Ok(::aws_smithy_types::endpoint::Endpoint::builder()

tmp-codegen-diff/aws-sdk/sdk/lambda/Cargo.toml

@@ -17,17 +77,77 @@
   37     37   
features = ["event-stream"]
   38     38   
version = "0.62.5"
   39     39   
   40     40   
[dependencies.aws-smithy-json]
   41     41   
path = "../aws-smithy-json"
   42     42   
version = "0.61.7"
   43     43   
   44     44   
[dependencies.aws-smithy-runtime]
   45     45   
path = "../aws-smithy-runtime"
   46     46   
features = ["client"]
   47         -
version = "1.9.4"
          47  +
version = "1.9.5"
   48     48   
   49     49   
[dependencies.aws-smithy-runtime-api]
   50     50   
path = "../aws-smithy-runtime-api"
   51     51   
features = ["client", "http-02x"]
   52     52   
version = "1.9.2"
   53     53   
   54     54   
[dependencies.aws-smithy-types]
   55     55   
path = "../aws-smithy-types"
   56     56   
version = "1.3.4"
   57     57   
@@ -82,82 +142,142 @@
  102    102   
features = ["test-util", "wire-mock"]
  103    103   
version = "1.1.4"
  104    104   
  105    105   
[dev-dependencies.aws-smithy-protocol-test]
  106    106   
path = "../aws-smithy-protocol-test"
  107    107   
version = "0.63.6"
  108    108   
  109    109   
[dev-dependencies.aws-smithy-runtime]
  110    110   
path = "../aws-smithy-runtime"
  111    111   
features = ["test-util"]
  112         -
version = "1.9.4"
         112  +
version = "1.9.5"
  113    113   
  114    114   
[dev-dependencies.aws-smithy-runtime-api]
  115    115   
path = "../aws-smithy-runtime-api"
  116    116   
features = ["test-util"]
  117    117   
version = "1.9.2"
  118    118   
  119    119   
[dev-dependencies.aws-smithy-types]
  120    120   
path = "../aws-smithy-types"
  121    121   
features = ["test-util"]
  122    122   
version = "1.3.4"

tmp-codegen-diff/aws-sdk/sdk/lambda/src/config.rs

@@ -1273,1273 +1332,1334 @@
 1293   1293   
            use crate::config::endpoint::ResolveEndpoint;
 1294   1294   
            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
 1295   1295   
        }));
 1296   1296   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1297   1297   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1298   1298   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1299   1299   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1300   1300   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
 1301   1301   
        runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
 1302   1302   
        runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
        1303  +
        runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
        1304  +
        runtime_components.push_interceptor(::aws_runtime::endpoint_discovery::EndpointOverrideInterceptor::new());
 1303   1305   
        runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
 1304   1306   
        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1305   1307   
            ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
 1306   1308   
        ));
 1307   1309   
        Self { config, runtime_components }
 1308   1310   
    }
 1309   1311   
}
 1310   1312   
 1311   1313   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
 1312   1314   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {

tmp-codegen-diff/aws-sdk/sdk/lambda/src/config/endpoint/internals.rs

@@ -5,5 +65,68 @@
   25     25   
        if (*use_fips) == (true) {
   26     26   
            return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
   27     27   
                "Invalid Configuration: FIPS and custom endpoint are not supported".to_string(),
   28     28   
            ));
   29     29   
        }
   30     30   
        if (*use_dual_stack) == (true) {
   31     31   
            return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
   32     32   
                "Invalid Configuration: Dualstack and custom endpoint are not supported".to_string(),
   33     33   
            ));
   34     34   
        }
   35         -
        return Ok(::aws_smithy_types::endpoint::Endpoint::builder().url(endpoint.to_owned()).build());
          35  +
        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
          36  +
            .url(endpoint.to_owned())
          37  +
            .property("is_custom_endpoint", true)
          38  +
            .build());
   36     39   
    }
   37     40   
    #[allow(unused_variables)]
   38     41   
    if let Some(region) = region {
   39     42   
        #[allow(unused_variables)]
   40     43   
        if let Some(partition_result) = partition_resolver.resolve_partition(region.as_ref() as &str, _diagnostic_collector) {
   41     44   
            if (*use_fips) == (true) {
   42     45   
                if (*use_dual_stack) == (true) {
   43     46   
                    if (true) == (partition_result.supports_fips()) {
   44     47   
                        if (true) == (partition_result.supports_dual_stack()) {
   45     48   
                            return Ok(::aws_smithy_types::endpoint::Endpoint::builder()

tmp-codegen-diff/aws-sdk/sdk/polly/Cargo.toml

@@ -15,15 +75,75 @@
   35     35   
path = "../aws-smithy-http"
   36     36   
version = "0.62.5"
   37     37   
   38     38   
[dependencies.aws-smithy-json]
   39     39   
path = "../aws-smithy-json"
   40     40   
version = "0.61.7"
   41     41   
   42     42   
[dependencies.aws-smithy-runtime]
   43     43   
path = "../aws-smithy-runtime"
   44     44   
features = ["client"]
   45         -
version = "1.9.4"
          45  +
version = "1.9.5"
   46     46   
   47     47   
[dependencies.aws-smithy-runtime-api]
   48     48   
path = "../aws-smithy-runtime-api"
   49     49   
features = ["client", "http-02x"]
   50     50   
version = "1.9.2"
   51     51   
   52     52   
[dependencies.aws-smithy-types]
   53     53   
path = "../aws-smithy-types"
   54     54   
version = "1.3.4"
   55     55   
@@ -84,84 +144,144 @@
  104    104   
features = ["test-util", "wire-mock"]
  105    105   
version = "1.1.4"
  106    106   
  107    107   
[dev-dependencies.aws-smithy-protocol-test]
  108    108   
path = "../aws-smithy-protocol-test"
  109    109   
version = "0.63.6"
  110    110   
  111    111   
[dev-dependencies.aws-smithy-runtime]
  112    112   
path = "../aws-smithy-runtime"
  113    113   
features = ["test-util"]
  114         -
version = "1.9.4"
         114  +
version = "1.9.5"
  115    115   
  116    116   
[dev-dependencies.aws-smithy-runtime-api]
  117    117   
path = "../aws-smithy-runtime-api"
  118    118   
features = ["test-util"]
  119    119   
version = "1.9.2"
  120    120   
  121    121   
[dev-dependencies.aws-smithy-types]
  122    122   
path = "../aws-smithy-types"
  123    123   
features = ["test-util"]
  124    124   
version = "1.3.4"

tmp-codegen-diff/aws-sdk/sdk/polly/src/config.rs

@@ -1273,1273 +1332,1334 @@
 1293   1293   
            use crate::config::endpoint::ResolveEndpoint;
 1294   1294   
            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
 1295   1295   
        }));
 1296   1296   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1297   1297   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1298   1298   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1299   1299   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1300   1300   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
 1301   1301   
        runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
 1302   1302   
        runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
        1303  +
        runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
        1304  +
        runtime_components.push_interceptor(::aws_runtime::endpoint_discovery::EndpointOverrideInterceptor::new());
 1303   1305   
        runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
 1304   1306   
        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1305   1307   
            ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
 1306   1308   
        ));
 1307   1309   
        Self { config, runtime_components }
 1308   1310   
    }
 1309   1311   
}
 1310   1312   
 1311   1313   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
 1312   1314   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {

tmp-codegen-diff/aws-sdk/sdk/polly/src/config/endpoint/internals.rs

@@ -5,5 +65,68 @@
   25     25   
        if (*use_fips) == (true) {
   26     26   
            return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
   27     27   
                "Invalid Configuration: FIPS and custom endpoint are not supported".to_string(),
   28     28   
            ));
   29     29   
        }
   30     30   
        if (*use_dual_stack) == (true) {
   31     31   
            return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
   32     32   
                "Invalid Configuration: Dualstack and custom endpoint are not supported".to_string(),
   33     33   
            ));
   34     34   
        }
   35         -
        return Ok(::aws_smithy_types::endpoint::Endpoint::builder().url(endpoint.to_owned()).build());
          35  +
        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
          36  +
            .url(endpoint.to_owned())
          37  +
            .property("is_custom_endpoint", true)
          38  +
            .build());
   36     39   
    }
   37     40   
    #[allow(unused_variables)]
   38     41   
    if let Some(region) = region {
   39     42   
        #[allow(unused_variables)]
   40     43   
        if let Some(partition_result) = partition_resolver.resolve_partition(region.as_ref() as &str, _diagnostic_collector) {
   41     44   
            if (*use_fips) == (true) {
   42     45   
                if (*use_dual_stack) == (true) {
   43     46   
                    if (true) == (partition_result.supports_fips()) {
   44     47   
                        if (true) == (partition_result.supports_dual_stack()) {
   45     48   
                            return Ok(::aws_smithy_types::endpoint::Endpoint::builder()

tmp-codegen-diff/aws-sdk/sdk/route53/Cargo.toml

@@ -11,11 +71,71 @@
   31     31   
path = "../aws-smithy-http"
   32     32   
version = "0.62.5"
   33     33   
   34     34   
[dependencies.aws-smithy-json]
   35     35   
path = "../aws-smithy-json"
   36     36   
version = "0.61.7"
   37     37   
   38     38   
[dependencies.aws-smithy-runtime]
   39     39   
path = "../aws-smithy-runtime"
   40     40   
features = ["client"]
   41         -
version = "1.9.4"
          41  +
version = "1.9.5"
   42     42   
   43     43   
[dependencies.aws-smithy-runtime-api]
   44     44   
path = "../aws-smithy-runtime-api"
   45     45   
features = ["client", "http-02x"]
   46     46   
version = "1.9.2"
   47     47   
   48     48   
[dependencies.aws-smithy-types]
   49     49   
path = "../aws-smithy-types"
   50     50   
version = "1.3.4"
   51     51   

tmp-codegen-diff/aws-sdk/sdk/route53/src/config.rs

@@ -1273,1273 +1332,1334 @@
 1293   1293   
            use crate::config::endpoint::ResolveEndpoint;
 1294   1294   
            crate::config::endpoint::DefaultResolver::new().into_shared_resolver()
 1295   1295   
        }));
 1296   1296   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1297   1297   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1298   1298   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1299   1299   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1300   1300   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
 1301   1301   
        runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
 1302   1302   
        runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
        1303  +
        runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
        1304  +
        runtime_components.push_interceptor(::aws_runtime::endpoint_discovery::EndpointOverrideInterceptor::new());
 1303   1305   
        runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
 1304   1306   
        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1305   1307   
            ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
 1306   1308   
        ));
 1307   1309   
        Self { config, runtime_components }
 1308   1310   
    }
 1309   1311   
}
 1310   1312   
 1311   1313   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
 1312   1314   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {

tmp-codegen-diff/aws-sdk/sdk/route53/src/config/endpoint/internals.rs

@@ -5,5 +65,68 @@
   25     25   
        if (*use_fips) == (true) {
   26     26   
            return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
   27     27   
                "Invalid Configuration: FIPS and custom endpoint are not supported".to_string(),
   28     28   
            ));
   29     29   
        }
   30     30   
        if (*use_dual_stack) == (true) {
   31     31   
            return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(
   32     32   
                "Invalid Configuration: Dualstack and custom endpoint are not supported".to_string(),
   33     33   
            ));
   34     34   
        }
   35         -
        return Ok(::aws_smithy_types::endpoint::Endpoint::builder().url(endpoint.to_owned()).build());
          35  +
        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
          36  +
            .url(endpoint.to_owned())
          37  +
            .property("is_custom_endpoint", true)
          38  +
            .build());
   36     39   
    }
   37     40   
    #[allow(unused_variables)]
   38     41   
    if let Some(region) = region {
   39     42   
        #[allow(unused_variables)]
   40     43   
        if let Some(partition_result) = partition_resolver.resolve_partition(region.as_ref() as &str, _diagnostic_collector) {
   41     44   
            if (partition_result.name()) == ("aws") {
   42     45   
                if (*use_fips) == (false) {
   43     46   
                    if (*use_dual_stack) == (false) {
   44     47   
                        return Ok(::aws_smithy_types::endpoint::Endpoint::builder()
   45     48   
                            .url("https://route53.amazonaws.com".to_string())

tmp-codegen-diff/aws-sdk/sdk/s3/Cargo.toml

@@ -7,7 +85,85 @@
   27     27   
[dependencies.aws-sigv4]
   28     28   
path = "../aws-sigv4"
   29     29   
version = "1.3.6"
   30     30   
   31     31   
[dependencies.aws-smithy-async]
   32     32   
path = "../aws-smithy-async"
   33     33   
version = "1.2.6"
   34     34   
   35     35   
[dependencies.aws-smithy-checksums]
   36     36   
path = "../aws-smithy-checksums"
   37         -
version = "0.63.11"
          37  +
version = "0.63.10"
   38     38   
   39     39   
[dependencies.aws-smithy-eventstream]
   40     40   
path = "../aws-smithy-eventstream"
   41     41   
version = "0.60.13"
   42     42   
   43     43   
[dependencies.aws-smithy-http]
   44     44   
path = "../aws-smithy-http"
   45     45   
features = ["event-stream"]
   46     46   
version = "0.62.5"
   47     47   
   48     48   
[dependencies.aws-smithy-json]
   49     49   
path = "../aws-smithy-json"
   50     50   
version = "0.61.7"
   51     51   
   52     52   
[dependencies.aws-smithy-runtime]
   53     53   
path = "../aws-smithy-runtime"
   54     54   
features = ["client"]
   55         -
version = "1.9.4"
          55  +
version = "1.9.5"
   56     56   
   57     57   
[dependencies.aws-smithy-runtime-api]
   58     58   
path = "../aws-smithy-runtime-api"
   59     59   
features = ["client", "http-02x"]
   60     60   
version = "1.9.2"
   61     61   
   62     62   
[dependencies.aws-smithy-types]
   63     63   
path = "../aws-smithy-types"
   64     64   
version = "1.3.4"
   65     65   
@@ -132,132 +192,192 @@
  152    152   
path = "../aws-smithy-mocks"
  153    153   
version = "0.2.0"
  154    154   
  155    155   
[dev-dependencies.aws-smithy-protocol-test]
  156    156   
path = "../aws-smithy-protocol-test"
  157    157   
version = "0.63.6"
  158    158   
  159    159   
[dev-dependencies.aws-smithy-runtime]
  160    160   
path = "../aws-smithy-runtime"
  161    161   
features = ["test-util"]
  162         -
version = "1.9.4"
         162  +
version = "1.9.5"
  163    163   
  164    164   
[dev-dependencies.aws-smithy-runtime-api]
  165    165   
path = "../aws-smithy-runtime-api"
  166    166   
features = ["test-util", "client", "http-02x"]
  167    167   
version = "1.9.2"
  168    168   
  169    169   
[dev-dependencies.aws-smithy-types]
  170    170   
path = "../aws-smithy-types"
  171    171   
features = ["test-util"]
  172    172   
version = "1.3.4"

tmp-codegen-diff/aws-sdk/sdk/s3/src/config.rs

@@ -1425,1425 +1484,1486 @@
 1445   1445   
        runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new());
 1446   1446   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1447   1447   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1448   1448   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1449   1449   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
 1450   1450   
        runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
 1451   1451   
        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1452   1452   
            crate::s3_express::auth::S3ExpressAuthScheme::new(),
 1453   1453   
        ));
 1454   1454   
        runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
        1455  +
        runtime_components.push_interceptor(::aws_runtime::observability_detection::ObservabilityDetectionInterceptor::new());
        1456  +
        runtime_components.push_interceptor(::aws_runtime::endpoint_discovery::EndpointOverrideInterceptor::new());
 1455   1457   
        runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
 1456   1458   
        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1457   1459   
            ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
 1458   1460   
        ));
 1459   1461   
        #[cfg(feature = "sigv4a")]
 1460   1462   
        {
 1461   1463   
            runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1462   1464   
                ::aws_runtime::auth::sigv4a::SigV4aAuthScheme::new(),
 1463   1465   
            ));
 1464   1466   
        }

tmp-codegen-diff/aws-sdk/sdk/s3/tests/business_metrics.rs

@@ -1,1 +0,653 @@
    6      6   
use aws_config::Region;
    7      7   
use aws_runtime::{
    8      8   
    sdk_feature::AwsSdkFeature, user_agent::test_util::assert_ua_contains_metric_values,
    9      9   
};
   10     10   
use aws_sdk_s3::{
   11     11   
    config::{Intercept, IntoShared},
   12     12   
    primitives::ByteStream,
   13     13   
    Client, Config,
   14     14   
};
   15     15   
use aws_smithy_http_client::test_util::capture_request;
          16  +
use serial_test::serial;
   16     17   
   17     18   
#[derive(Debug)]
   18     19   
struct TransferManagerFeatureInterceptor;
   19     20   
   20     21   
impl Intercept for TransferManagerFeatureInterceptor {
   21     22   
    fn name(&self) -> &'static str {
   22     23   
        "TransferManagerFeature"
   23     24   
    }
   24     25   
   25     26   
    fn read_before_execution(
   26     27   
        &self,
   27     28   
        _ctx: &aws_sdk_s3::config::interceptors::BeforeSerializationInterceptorContextRef<'_>,
   28     29   
        cfg: &mut aws_sdk_s3::config::ConfigBag,
   29     30   
    ) -> Result<(), aws_sdk_s3::error::BoxError> {
   30     31   
        cfg.interceptor_state()
   31     32   
            .store_append(AwsSdkFeature::S3Transfer);
   32     33   
        Ok(())
   33     34   
    }
   34     35   
}
   35     36   
   36     37   
#[tokio::test]
   37     38   
async fn test_track_metric_for_s3_transfer_manager() {
   38     39   
    let (http_client, captured_request) = capture_request(None);
   39     40   
    let mut conf_builder = Config::builder()
   40     41   
        .region(Region::new("us-east-1"))
   41     42   
        .http_client(http_client.clone())
   42     43   
        .with_test_defaults();
   43     44   
    // The S3 Transfer Manager uses a passed-in S3 client SDK for operations.
   44     45   
    // By configuring an interceptor at the client level to track metrics,
   45     46   
    // all operations executed by the client will automatically include the metric.
   46     47   
    // This eliminates the need to apply `.config_override` on individual operations
   47     48   
    // to insert the `TransferManagerFeatureInterceptor`.
   48     49   
    conf_builder.push_interceptor(TransferManagerFeatureInterceptor.into_shared());
   49     50   
    let client = Client::from_conf(conf_builder.build());
   50     51   
   51     52   
    let _ = client
   52     53   
        .put_object()
   53     54   
        .bucket("doesnotmatter")
   54     55   
        .key("doesnotmatter")
   55     56   
        .body(ByteStream::from_static("Hello, world".as_bytes()))
   56     57   
        .send()
   57     58   
        .await
   58     59   
        .unwrap();
   59     60   
   60     61   
    let expected_req = captured_request.expect_request();
   61     62   
    let user_agent = expected_req.headers().get("x-amz-user-agent").unwrap();
   62     63   
    assert_ua_contains_metric_values(user_agent, &["G"]);
   63     64   
}
          65  +
          66  +
#[tokio::test]
          67  +
async fn test_endpoint_override_tracking() {
          68  +
    let (http_client, captured_request) = capture_request(None);
          69  +
    let config = Config::builder()
          70  +
        .region(Region::new("us-east-1"))
          71  +
        .http_client(http_client.clone())
          72  +
        .endpoint_url("http://localhost:9000")
          73  +
        .with_test_defaults()
          74  +
        .build();
          75  +
    let client = Client::from_conf(config);
          76  +
          77  +
    let _ = client
          78  +
        .put_object()
          79  +
        .bucket("test-bucket")
          80  +
        .key("test-key")
          81  +
        .body(ByteStream::from_static("test data".as_bytes()))
          82  +
        .send()
          83  +
        .await;
          84  +
          85  +
    let expected_req = captured_request.expect_request();
          86  +
    let user_agent = expected_req.headers().get("x-amz-user-agent").unwrap();
          87  +
    assert_ua_contains_metric_values(user_agent, &["N"]);
          88  +
}
          89  +
          90  +
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
          91  +
#[serial]
          92  +
async fn test_observability_metrics_tracking() {
          93  +
    use aws_smithy_observability::{
          94  +
        instruments::{
          95  +
            AsyncInstrumentBuilder, AsyncMeasure, Histogram, InstrumentBuilder, MonotonicCounter,
          96  +
            ProvideInstrument, UpDownCounter,
          97  +
        },
          98  +
        meter::{Meter, ProvideMeter},
          99  +
        Attributes, Context, TelemetryProvider,
         100  +
    };
         101  +
    use std::sync::Arc;
         102  +
         103  +
    // Create a test meter provider that is NOT a noop
         104  +
    #[derive(Debug)]
         105  +
    struct TestMeterProvider;
         106  +
         107  +
    impl ProvideMeter for TestMeterProvider {
         108  +
        fn get_meter(&self, _scope: &'static str, _attributes: Option<&Attributes>) -> Meter {
         109  +
            Meter::new(Arc::new(TestMeter))
         110  +
        }
         111  +
    }
         112  +
         113  +
    #[derive(Debug)]
         114  +
    struct TestMeter;
         115  +
         116  +
    impl ProvideInstrument for TestMeter {
         117  +
        fn create_gauge(
         118  +
            &self,
         119  +
            _builder: AsyncInstrumentBuilder<'_, Arc<dyn AsyncMeasure<Value = f64>>, f64>,
         120  +
        ) -> Arc<dyn AsyncMeasure<Value = f64>> {
         121  +
            Arc::new(TestAsyncMeasure::<f64>::default())
         122  +
        }
         123  +
         124  +
        fn create_up_down_counter(
         125  +
            &self,
         126  +
            _builder: InstrumentBuilder<'_, Arc<dyn UpDownCounter>>,
         127  +
        ) -> Arc<dyn UpDownCounter> {
         128  +
            Arc::new(TestUpDownCounter)
         129  +
        }
         130  +
         131  +
        fn create_async_up_down_counter(
         132  +
            &self,
         133  +
            _builder: AsyncInstrumentBuilder<'_, Arc<dyn AsyncMeasure<Value = i64>>, i64>,
         134  +
        ) -> Arc<dyn AsyncMeasure<Value = i64>> {
         135  +
            Arc::new(TestAsyncMeasure::<i64>::default())
         136  +
        }
         137  +
         138  +
        fn create_monotonic_counter(
         139  +
            &self,
         140  +
            _builder: InstrumentBuilder<'_, Arc<dyn MonotonicCounter>>,
         141  +
        ) -> Arc<dyn MonotonicCounter> {
         142  +
            Arc::new(TestMonotonicCounter)
         143  +
        }
         144  +
         145  +
        fn create_async_monotonic_counter(
         146  +
            &self,
         147  +
            _builder: AsyncInstrumentBuilder<'_, Arc<dyn AsyncMeasure<Value = u64>>, u64>,
         148  +
        ) -> Arc<dyn AsyncMeasure<Value = u64>> {
         149  +
            Arc::new(TestAsyncMeasure::<u64>::default())
         150  +
        }
         151  +
         152  +
        fn create_histogram(
         153  +
            &self,
         154  +
            _builder: InstrumentBuilder<'_, Arc<dyn Histogram>>,
         155  +
        ) -> Arc<dyn Histogram> {
         156  +
            Arc::new(TestHistogram)
         157  +
        }
         158  +
    }
         159  +
         160  +
    #[derive(Debug, Default)]
         161  +
    struct TestAsyncMeasure<T: Send + Sync + std::fmt::Debug>(std::marker::PhantomData<T>);
         162  +
         163  +
    impl<T: Send + Sync + std::fmt::Debug> AsyncMeasure for TestAsyncMeasure<T> {
         164  +
        type Value = T;
         165  +
         166  +
        fn record(
         167  +
            &self,
         168  +
            _value: T,
         169  +
            _attributes: Option<&Attributes>,
         170  +
            _context: Option<&dyn Context>,
         171  +
        ) {
         172  +
        }
         173  +
         174  +
        fn stop(&self) {}
         175  +
    }
         176  +
         177  +
    #[derive(Debug)]
         178  +
    struct TestUpDownCounter;
         179  +
         180  +
    impl UpDownCounter for TestUpDownCounter {
         181  +
        fn add(
         182  +
            &self,
         183  +
            _value: i64,
         184  +
            _attributes: Option<&Attributes>,
         185  +
            _context: Option<&dyn Context>,
         186  +
        ) {
         187  +
        }
         188  +
    }
         189  +
         190  +
    #[derive(Debug)]
         191  +
    struct TestMonotonicCounter;
         192  +
         193  +
    impl MonotonicCounter for TestMonotonicCounter {
         194  +
        fn add(
         195  +
            &self,
         196  +
            _value: u64,
         197  +
            _attributes: Option<&Attributes>,
         198  +
            _context: Option<&dyn Context>,
         199  +
        ) {
         200  +
        }
         201  +
    }
         202  +
         203  +
    #[derive(Debug)]
         204  +
    struct TestHistogram;
         205  +
         206  +
    impl Histogram for TestHistogram {
         207  +
        fn record(
         208  +
            &self,
         209  +
            _value: f64,
         210  +
            _attributes: Option<&Attributes>,
         211  +
            _context: Option<&dyn Context>,
         212  +
        ) {
         213  +
        }
         214  +
    }
         215  +
         216  +
    // Set up the test meter provider as the global provider BEFORE creating the client
         217  +
    let telemetry_provider = TelemetryProvider::builder()
         218  +
        .meter_provider(Arc::new(TestMeterProvider))
         219  +
        .build();
         220  +
         221  +
    // Set the global provider first
         222  +
    aws_smithy_observability::global::set_telemetry_provider(telemetry_provider)
         223  +
        .expect("failed to set telemetry provider");
         224  +
         225  +
    // Now create client - the interceptor will detect the non-noop provider
         226  +
    let (http_client, captured_request) = capture_request(None);
         227  +
    let config = Config::builder()
         228  +
        .region(Region::new("us-east-1"))
         229  +
        .http_client(http_client.clone())
         230  +
        .with_test_defaults()
         231  +
        .build();
         232  +
    let client = Client::from_conf(config);
         233  +
         234  +
    let _ = client
         235  +
        .put_object()
         236  +
        .bucket("test-bucket")
         237  +
        .key("test-key")
         238  +
        .body(ByteStream::from_static("test data".as_bytes()))
         239  +
        .send()
         240  +
        .await;
         241  +
         242  +
    // Verify the User-Agent header contains m/5 (ObservabilityMetrics)
         243  +
    let expected_req = captured_request.expect_request();
         244  +
    let user_agent = expected_req.headers().get("x-amz-user-agent").unwrap();
         245  +
    assert_ua_contains_metric_values(user_agent, &["5"]);
         246  +
         247  +
    // Clean up: reset to noop provider
         248  +
    aws_smithy_observability::global::set_telemetry_provider(TelemetryProvider::noop())
         249  +
        .expect("failed to reset telemetry provider");
         250  +
}
         251  +
         252  +
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
         253  +
#[serial]
         254  +
async fn test_otel_tracing_tracking() {
         255  +
    use aws_smithy_observability::{
         256  +
        instruments::{
         257  +
            AsyncInstrumentBuilder, AsyncMeasure, Histogram, InstrumentBuilder, MonotonicCounter,
         258  +
            ProvideInstrument, UpDownCounter,
         259  +
        },
         260  +
        meter::{Meter, ProvideMeter},
         261  +
        Attributes, Context, TelemetryProvider,
         262  +
    };
         263  +
    use std::sync::Arc;
         264  +
         265  +
    // Create a test meter provider that is NOT a noop and is marked as OpenTelemetry
         266  +
    #[derive(Debug)]
         267  +
    struct TestOtelMeterProvider;
         268  +
         269  +
    impl ProvideMeter for TestOtelMeterProvider {
         270  +
        fn get_meter(&self, _scope: &'static str, _attributes: Option<&Attributes>) -> Meter {
         271  +
            Meter::new(Arc::new(TestOtelMeter))
         272  +
        }
         273  +
    }
         274  +
         275  +
    #[derive(Debug)]
         276  +
    struct TestOtelMeter;
         277  +
         278  +
    impl ProvideInstrument for TestOtelMeter {
         279  +
        fn create_gauge(
         280  +
            &self,
         281  +
            _builder: AsyncInstrumentBuilder<'_, Arc<dyn AsyncMeasure<Value = f64>>, f64>,
         282  +
        ) -> Arc<dyn AsyncMeasure<Value = f64>> {
         283  +
            Arc::new(TestAsyncMeasure::<f64>::default())
         284  +
        }
         285  +
         286  +
        fn create_up_down_counter(
         287  +
            &self,
         288  +
            _builder: InstrumentBuilder<'_, Arc<dyn UpDownCounter>>,
         289  +
        ) -> Arc<dyn UpDownCounter> {
         290  +
            Arc::new(TestUpDownCounter)
         291  +
        }
         292  +
         293  +
        fn create_async_up_down_counter(
         294  +
            &self,
         295  +
            _builder: AsyncInstrumentBuilder<'_, Arc<dyn AsyncMeasure<Value = i64>>, i64>,
         296  +
        ) -> Arc<dyn AsyncMeasure<Value = i64>> {
         297  +
            Arc::new(TestAsyncMeasure::<i64>::default())
         298  +
        }
         299  +
         300  +
        fn create_monotonic_counter(
         301  +
            &self,
         302  +
            _builder: InstrumentBuilder<'_, Arc<dyn MonotonicCounter>>,
         303  +
        ) -> Arc<dyn MonotonicCounter> {
         304  +
            Arc::new(TestMonotonicCounter)
         305  +
        }
         306  +
         307  +
        fn create_async_monotonic_counter(
         308  +
            &self,
         309  +
            _builder: AsyncInstrumentBuilder<'_, Arc<dyn AsyncMeasure<Value = u64>>, u64>,
         310  +
        ) -> Arc<dyn AsyncMeasure<Value = u64>> {
         311  +
            Arc::new(TestAsyncMeasure::<u64>::default())
         312  +
        }
         313  +
         314  +
        fn create_histogram(
         315  +
            &self,
         316  +
            _builder: InstrumentBuilder<'_, Arc<dyn Histogram>>,
         317  +
        ) -> Arc<dyn Histogram> {
         318  +
            Arc::new(TestHistogram)
         319  +
        }
         320  +
    }
         321  +
         322  +
    #[derive(Debug, Default)]
         323  +
    struct TestAsyncMeasure<T: Send + Sync + std::fmt::Debug>(std::marker::PhantomData<T>);
         324  +
         325  +
    impl<T: Send + Sync + std::fmt::Debug> AsyncMeasure for TestAsyncMeasure<T> {
         326  +
        type Value = T;
         327  +
         328  +
        fn record(
         329  +
            &self,
         330  +
            _value: T,
         331  +
            _attributes: Option<&Attributes>,
         332  +
            _context: Option<&dyn Context>,
         333  +
        ) {
         334  +
        }
         335  +
         336  +
        fn stop(&self) {}
         337  +
    }
         338  +
         339  +
    #[derive(Debug)]
         340  +
    struct TestUpDownCounter;
         341  +
         342  +
    impl UpDownCounter for TestUpDownCounter {
         343  +
        fn add(
         344  +
            &self,
         345  +
            _value: i64,
         346  +
            _attributes: Option<&Attributes>,
         347  +
            _context: Option<&dyn Context>,
         348  +
        ) {
         349  +
        }
         350  +
    }
         351  +
         352  +
    #[derive(Debug)]
         353  +
    struct TestMonotonicCounter;
         354  +
         355  +
    impl MonotonicCounter for TestMonotonicCounter {
         356  +
        fn add(
         357  +
            &self,
         358  +
            _value: u64,
         359  +
            _attributes: Option<&Attributes>,
         360  +
            _context: Option<&dyn Context>,
         361  +
        ) {
         362  +
        }
         363  +
    }
         364  +
         365  +
    #[derive(Debug)]
         366  +
    struct TestHistogram;
         367  +
         368  +
    impl Histogram for TestHistogram {
         369  +
        fn record(
         370  +
            &self,
         371  +
            _value: f64,
         372  +
            _attributes: Option<&Attributes>,
         373  +
            _context: Option<&dyn Context>,
         374  +
        ) {
         375  +
        }
         376  +
    }
         377  +
         378  +
    // Set up the test meter provider as the global provider with OpenTelemetry flag
         379  +
    let telemetry_provider = TelemetryProvider::builder()
         380  +
        .meter_provider(Arc::new(TestOtelMeterProvider))
         381  +
        .with_otel(true) // Mark as OpenTelemetry
         382  +
        .build();
         383  +
         384  +
    // Set the global provider first
         385  +
    aws_smithy_observability::global::set_telemetry_provider(telemetry_provider)
         386  +
        .expect("failed to set telemetry provider");
         387  +
         388  +
    // Now create client - the plugin will detect the OpenTelemetry provider
         389  +
    let (http_client, captured_request) = capture_request(None);
         390  +
    let config = Config::builder()
         391  +
        .region(Region::new("us-east-1"))
         392  +
        .http_client(http_client.clone())
         393  +
        .with_test_defaults()
         394  +
        .build();
         395  +
    let client = Client::from_conf(config);
         396  +
         397  +
    let _ = client
         398  +
        .put_object()
         399  +
        .bucket("test-bucket")
         400  +
        .key("test-key")
         401  +
        .body(ByteStream::from_static("test data".as_bytes()))
         402  +
        .send()
         403  +
        .await;
         404  +
         405  +
    // Verify the User-Agent header contains both m/4 (ObservabilityTracing) and m/6 (ObservabilityOtelTracing)
         406  +
    // When OpenTelemetry is enabled, we should see:
         407  +
    // - m/4: ObservabilityTracing (Smithy-level, indicates tracing is enabled)
         408  +
    // - m/5: ObservabilityMetrics (AWS-level, indicates metrics are enabled)
         409  +
    // - m/6: ObservabilityOtelTracing (AWS-level, indicates OpenTelemetry tracing)
         410  +
    // - m/7: ObservabilityOtelMetrics (AWS-level, indicates OpenTelemetry metrics)
         411  +
    let expected_req = captured_request.expect_request();
         412  +
    let user_agent = expected_req.headers().get("x-amz-user-agent").unwrap();
         413  +
         414  +
    assert_ua_contains_metric_values(user_agent, &["4", "5", "6", "7"]);
         415  +
         416  +
    // Clean up: reset to noop provider
         417  +
    aws_smithy_observability::global::set_telemetry_provider(TelemetryProvider::noop())
         418  +
        .expect("failed to reset telemetry provider");
         419  +
}
         420  +
         421  +
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
         422  +
#[serial]
         423  +
async fn test_multiple_features_tracked() {
         424  +
    use aws_smithy_observability::{
         425  +
        instruments::{
         426  +
            AsyncInstrumentBuilder, AsyncMeasure, Histogram, InstrumentBuilder, MonotonicCounter,
         427  +
            ProvideInstrument, UpDownCounter,
         428  +
        },
         429  +
        meter::{Meter, ProvideMeter},
         430  +
        Attributes, Context, TelemetryProvider,
         431  +
    };
         432  +
    use std::sync::Arc;
         433  +
         434  +
    // Create a test meter provider that is NOT a noop and is marked as OpenTelemetry
         435  +
    #[derive(Debug)]
         436  +
    struct TestOtelMeterProvider;
         437  +
         438  +
    impl ProvideMeter for TestOtelMeterProvider {
         439  +
        fn get_meter(&self, _scope: &'static str, _attributes: Option<&Attributes>) -> Meter {
         440  +
            Meter::new(Arc::new(TestOtelMeter))
         441  +
        }
         442  +
    }
         443  +
         444  +
    #[derive(Debug)]
         445  +
    struct TestOtelMeter;
         446  +
         447  +
    impl ProvideInstrument for TestOtelMeter {
         448  +
        fn create_gauge(
         449  +
            &self,
         450  +
            _builder: AsyncInstrumentBuilder<'_, Arc<dyn AsyncMeasure<Value = f64>>, f64>,
         451  +
        ) -> Arc<dyn AsyncMeasure<Value = f64>> {
         452  +
            Arc::new(TestAsyncMeasure::<f64>::default())
         453  +
        }
         454  +
         455  +
        fn create_up_down_counter(
         456  +
            &self,
         457  +
            _builder: InstrumentBuilder<'_, Arc<dyn UpDownCounter>>,
         458  +
        ) -> Arc<dyn UpDownCounter> {
         459  +
            Arc::new(TestUpDownCounter)
         460  +
        }
         461  +
         462  +
        fn create_async_up_down_counter(
         463  +
            &self,
         464  +
            _builder: AsyncInstrumentBuilder<'_, Arc<dyn AsyncMeasure<Value = i64>>, i64>,
         465  +
        ) -> Arc<dyn AsyncMeasure<Value = i64>> {
         466  +
            Arc::new(TestAsyncMeasure::<i64>::default())
         467  +
        }
         468  +
         469  +
        fn create_monotonic_counter(
         470  +
            &self,
         471  +
            _builder: InstrumentBuilder<'_, Arc<dyn MonotonicCounter>>,
         472  +
        ) -> Arc<dyn MonotonicCounter> {
         473  +
            Arc::new(TestMonotonicCounter)
         474  +
        }
         475  +
         476  +
        fn create_async_monotonic_counter(
         477  +
            &self,
         478  +
            _builder: AsyncInstrumentBuilder<'_, Arc<dyn AsyncMeasure<Value = u64>>, u64>,
         479  +
        ) -> Arc<dyn AsyncMeasure<Value = u64>> {
         480  +
            Arc::new(TestAsyncMeasure::<u64>::default())
         481  +
        }
         482  +
         483  +
        fn create_histogram(
         484  +
            &self,
         485  +
            _builder: InstrumentBuilder<'_, Arc<dyn Histogram>>,
         486  +
        ) -> Arc<dyn Histogram> {
         487  +
            Arc::new(TestHistogram)
         488  +
        }
         489  +
    }
         490  +
         491  +
    #[derive(Debug, Default)]
         492  +
    struct TestAsyncMeasure<T: Send + Sync + std::fmt::Debug>(std::marker::PhantomData<T>);
         493  +
         494  +
    impl<T: Send + Sync + std::fmt::Debug> AsyncMeasure for TestAsyncMeasure<T> {
         495  +
        type Value = T;
         496  +
         497  +
        fn record(
         498  +
            &self,
         499  +
            _value: T,
         500  +
            _attributes: Option<&Attributes>,
         501  +
            _context: Option<&dyn Context>,
         502  +
        ) {
         503  +
        }
         504  +
         505  +
        fn stop(&self) {}
         506  +
    }
         507  +
         508  +
    #[derive(Debug)]
         509  +
    struct TestUpDownCounter;
         510  +
         511  +
    impl UpDownCounter for TestUpDownCounter {
         512  +
        fn add(
         513  +
            &self,
         514  +
            _value: i64,
         515  +
            _attributes: Option<&Attributes>,
         516  +
            _context: Option<&dyn Context>,
         517  +
        ) {
         518  +
        }
         519  +
    }
         520  +
         521  +
    #[derive(Debug)]
         522  +
    struct TestMonotonicCounter;
         523  +
         524  +
    impl MonotonicCounter for TestMonotonicCounter {
         525  +
        fn add(
         526  +
            &self,
         527  +
            _value: u64,
         528  +
            _attributes: Option<&Attributes>,
         529  +
            _context: Option<&dyn Context>,
         530  +
        ) {
         531  +
        }
         532  +
    }
         533  +
         534  +
    #[derive(Debug)]
         535  +
    struct TestHistogram;
         536  +
         537  +
    impl Histogram for TestHistogram {
         538  +
        fn record(
         539  +
            &self,
         540  +
            _value: f64,
         541  +
            _attributes: Option<&Attributes>,
         542  +
            _context: Option<&dyn Context>,
         543  +
        ) {
         544  +
        }
         545  +
    }
         546  +
         547  +
    // Set up the test meter provider as the global provider with OpenTelemetry flag
         548  +
    let telemetry_provider = TelemetryProvider::builder()
         549  +
        .meter_provider(Arc::new(TestOtelMeterProvider))
         550  +
        .with_otel(true) // Mark as OpenTelemetry
         551  +
        .build();
         552  +
         553  +
    // Set the global provider first
         554  +
    aws_smithy_observability::global::set_telemetry_provider(telemetry_provider)
         555  +
        .expect("failed to set telemetry provider");
         556  +
         557  +
    // Now create client with BOTH custom endpoint AND OpenTelemetry
         558  +
    let (http_client, captured_request) = capture_request(None);
         559  +
    let config = Config::builder()
         560  +
        .region(Region::new("us-east-1"))
         561  +
        .http_client(http_client.clone())
         562  +
        .endpoint_url("http://localhost:9000") // Custom endpoint -> metric N
         563  +
        .with_test_defaults()
         564  +
        .build();
         565  +
    let client = Client::from_conf(config);
         566  +
         567  +
    let _ = client
         568  +
        .put_object()
         569  +
        .bucket("test-bucket")
         570  +
        .key("test-key")
         571  +
        .body(ByteStream::from_static("test data".as_bytes()))
         572  +
        .send()
         573  +
        .await;
         574  +
         575  +
    // Verify the User-Agent header contains all expected metrics:
         576  +
    // - m/4: ObservabilityTracing (Smithy-level, indicates tracing is enabled)
         577  +
    // - m/5: ObservabilityMetrics (AWS-level, indicates metrics are enabled)
         578  +
    // - m/6: ObservabilityOtelTracing (AWS-level, indicates OpenTelemetry tracing)
         579  +
    // - m/7: ObservabilityOtelMetrics (AWS-level, indicates OpenTelemetry metrics)
         580  +
    // - m/N: EndpointOverride (AWS-level, indicates custom endpoint)
         581  +
    let expected_req = captured_request.expect_request();
         582  +
    let user_agent = expected_req.headers().get("x-amz-user-agent").unwrap();
         583  +
         584  +
    // All metrics should appear in the correct order
         585  +
    assert_ua_contains_metric_values(user_agent, &["4", "5", "6", "7", "N"]);
         586  +
         587  +
    // Clean up: reset to noop provider
         588  +
    aws_smithy_observability::global::set_telemetry_provider(TelemetryProvider::noop())
         589  +
        .expect("failed to reset telemetry provider");
         590  +
}
         591  +
         592  +
#[tokio::test]
         593  +
async fn test_no_metrics_without_features() {
         594  +
    let (http_client, captured_request) = capture_request(None);
         595  +
    let config = Config::builder()
         596  +
        .region(Region::new("us-east-1"))
         597  +
        .http_client(http_client.clone())
         598  +
        .with_test_defaults()
         599  +
        .build();
         600  +
    let client = Client::from_conf(config);
         601  +
         602  +
    let _ = client
         603  +
        .put_object()
         604  +
        .bucket("test-bucket")
         605  +
        .key("test-key")
         606  +
        .body(ByteStream::from_static("test data".as_bytes()))
         607  +
        .send()
         608  +
        .await;
         609  +
         610  +
    // Verify the User-Agent header does NOT contain new feature metrics
         611  +
    let expected_req = captured_request.expect_request();
         612  +
    let user_agent = expected_req.headers().get("x-amz-user-agent").unwrap();
         613  +
         614  +
    // Assert that none of the new feature metrics appear in the User-Agent header
         615  +
    // New feature metrics: 1 (SsoLoginDevice), 2 (SsoLoginAuth), 4 (ObservabilityTracing),
         616  +
    // 5 (ObservabilityMetrics), 6 (ObservabilityOtelTracing), 7 (ObservabilityOtelMetrics),
         617  +
    // N (EndpointOverride)
         618  +
    assert!(
         619  +
        !user_agent.contains("m/1"),
         620  +
        "User-Agent should not contain m/1 (SsoLoginDevice) without SSO: {}",
         621  +
        user_agent
         622  +
    );
         623  +
    assert!(
         624  +
        !user_agent.contains("m/2"),
         625  +
        "User-Agent should not contain m/2 (SsoLoginAuth) without SSO: {}",
         626  +
        user_agent
         627  +
    );
         628  +
    assert!(
         629  +
        !user_agent.contains("m/4"),
         630  +
        "User-Agent should not contain m/4 (ObservabilityTracing) without observability: {}",
         631  +
        user_agent
         632  +
    );
         633  +
    assert!(
         634  +
        !user_agent.contains("m/5"),
         635  +
        "User-Agent should not contain m/5 (ObservabilityMetrics) without observability: {}",
         636  +
        user_agent
         637  +
    );
         638  +
    assert!(
         639  +
        !user_agent.contains("m/6"),
         640  +
        "User-Agent should not contain m/6 (ObservabilityOtelTracing) without OpenTelemetry: {}",
         641  +
        user_agent
         642  +
    );
         643  +
    assert!(
         644  +
        !user_agent.contains("m/7"),
         645  +
        "User-Agent should not contain m/7 (ObservabilityOtelMetrics) without OpenTelemetry: {}",
         646  +
        user_agent
         647  +
    );
         648  +
    assert!(
         649  +
        !user_agent.contains("m/N"),
         650  +
        "User-Agent should not contain m/N (EndpointOverride) without custom endpoint: {}",
         651  +
        user_agent
         652  +
    );
         653  +
}