AWS SDK

AWS SDK

rev. 283cf55dde6399c64ec8a4ec3125243533612110

Files changed:

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

@@ -13,13 +99,99 @@
   33     33   
   34     34   
[dependencies]
   35     35   
bytes = "1.1.0"
   36     36   
http = "1"
   37     37   
url = "2.5.4"
   38     38   
fastrand = "2.3.0"
   39     39   
   40     40   
[dependencies.aws-credential-types]
   41     41   
path = "../aws-credential-types"
   42     42   
features = ["test-util"]
   43         -
version = "1.2.9"
          43  +
version = "1.2.10"
   44     44   
   45     45   
[dependencies.aws-runtime]
   46     46   
path = "../aws-runtime"
   47     47   
version = "1.5.15"
   48     48   
   49     49   
[dependencies.aws-sdk-sts]
   50     50   
path = "../sts"
   51     51   
default-features = false
   52     52   
version = "0.0.0-local"
   53     53   
   54     54   
[dependencies.aws-smithy-async]
   55     55   
path = "../aws-smithy-async"
   56     56   
version = "1.2.6"
   57     57   
   58     58   
[dependencies.aws-smithy-http]
   59     59   
path = "../aws-smithy-http"
   60     60   
version = "0.62.5"
   61     61   
   62     62   
[dependencies.aws-smithy-json]
   63     63   
path = "../aws-smithy-json"
   64     64   
version = "0.61.7"
   65     65   
   66     66   
[dependencies.aws-smithy-runtime]
   67     67   
path = "../aws-smithy-runtime"
   68     68   
features = ["client"]
   69         -
version = "1.9.4"
          69  +
version = "1.9.5"
   70     70   
   71     71   
[dependencies.aws-smithy-runtime-api]
   72     72   
path = "../aws-smithy-runtime-api"
   73     73   
features = ["client"]
   74     74   
version = "1.9.2"
   75     75   
   76     76   
[dependencies.aws-smithy-types]
   77     77   
path = "../aws-smithy-types"
   78     78   
version = "1.3.4"
   79     79   
@@ -106,106 +157,157 @@
  126    126   
version = "1.2.6"
  127    127   
  128    128   
[dev-dependencies.aws-smithy-http-client]
  129    129   
path = "../aws-smithy-http-client"
  130    130   
features = ["default-client", "test-util"]
  131    131   
version = "1.1.4"
  132    132   
  133    133   
[dev-dependencies.aws-smithy-runtime]
  134    134   
path = "../aws-smithy-runtime"
  135    135   
features = ["client", "test-util"]
  136         -
version = "1.9.4"
         136  +
version = "1.9.5"
  137    137   
  138    138   
[dev-dependencies.aws-smithy-runtime-api]
  139    139   
path = "../aws-smithy-runtime-api"
  140    140   
features = ["test-util"]
  141    141   
version = "1.9.2"
  142    142   
  143    143   
[dev-dependencies.futures-util]
  144    144   
version = "0.3.29"
  145    145   
default-features = false
  146    146   

tmp-codegen-diff/aws-sdk/sdk/aws-credential-types/Cargo.toml

@@ -1,1 +34,34 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-credential-types"
    4         -
version = "1.2.9"
           4  +
version = "1.2.10"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
    6      6   
description = "Types for AWS SDK credentials."
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/smithy-lang/smithy-rs"
   10     10   
[package.metadata.docs.rs]
   11     11   
all-features = true
   12     12   
targets = ["x86_64-unknown-linux-gnu"]
   13     13   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   14     14   
rustdoc-args = ["--cfg", "docsrs"]

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

@@ -5,5 +139,143 @@
   25     25   
   26     26   
[dependencies]
   27     27   
bytes = "1.10.0"
   28     28   
fastrand = "2.3.0"
   29     29   
percent-encoding = "2.3.1"
   30     30   
pin-project-lite = "0.2.14"
   31     31   
tracing = "0.1.40"
   32     32   
   33     33   
[dependencies.aws-credential-types]
   34     34   
path = "../aws-credential-types"
   35         -
version = "1.2.9"
          35  +
version = "1.2.10"
   36     36   
   37     37   
[dependencies.aws-sigv4]
   38     38   
path = "../aws-sigv4"
   39     39   
features = ["http0-compat"]
   40     40   
version = "1.3.6"
   41     41   
   42     42   
[dependencies.aws-smithy-async]
   43     43   
path = "../aws-smithy-async"
   44     44   
version = "1.2.6"
   45     45   
   46     46   
[dependencies.aws-smithy-eventstream]
   47     47   
path = "../aws-smithy-eventstream"
   48     48   
optional = true
   49     49   
version = "0.60.13"
   50     50   
   51     51   
[dependencies.aws-smithy-http]
   52     52   
path = "../aws-smithy-http"
   53     53   
version = "0.62.5"
   54     54   
          55  +
[dependencies.aws-smithy-observability]
          56  +
path = "../aws-smithy-observability"
          57  +
version = "0.1.5"
          58  +
   55     59   
[dependencies.aws-smithy-runtime]
   56     60   
path = "../aws-smithy-runtime"
   57     61   
features = ["client"]
   58         -
version = "1.9.4"
          62  +
version = "1.9.5"
   59     63   
   60     64   
[dependencies.aws-smithy-runtime-api]
   61     65   
path = "../aws-smithy-runtime-api"
   62     66   
features = ["client"]
   63     67   
version = "1.9.2"
   64     68   
   65     69   
[dependencies.aws-smithy-types]
   66     70   
path = "../aws-smithy-types"
   67     71   
version = "1.3.4"
   68     72   
   69     73   
[dependencies.aws-types]
   70     74   
path = "../aws-types"
   71     75   
version = "1.3.10"
   72     76   
   73     77   
[dependencies.http-02x]
   74     78   
package = "http"
   75     79   
version = "0.2.9"
   76     80   
   77     81   
[dependencies.http-body-04x]
   78     82   
package = "http-body"
   79     83   
version = "0.4.5"
   80     84   
   81     85   
[dependencies.http-1x]
   82     86   
package = "http"
   83     87   
version = "1.1.0"
   84     88   
optional = true
   85     89   
   86     90   
[dependencies.http-body-1x]
   87     91   
package = "http-body"
   88     92   
version = "1.0.0"
   89     93   
optional = true
   90     94   
   91     95   
[dependencies.regex-lite]
   92     96   
version = "0.1.5"
   93     97   
optional = true
   94     98   
   95     99   
[dependencies.uuid]
   96    100   
version = "1"
   97    101   
   98    102   
[dev-dependencies]
   99    103   
arbitrary = "1.3"
  100    104   
bytes-utils = "0.1.2"
  101    105   
convert_case = "0.6.0"
  102    106   
proptest = "1.2"
  103    107   
serde_json = "1"
  104    108   
tracing-test = "0.2.4"
  105    109   
  106    110   
[dev-dependencies.aws-credential-types]
  107    111   
path = "../aws-credential-types"
  108    112   
features = ["test-util"]
  109         -
version = "1.2.9"
         113  +
version = "1.2.10"
  110    114   
  111    115   
[dev-dependencies.aws-smithy-async]
  112    116   
path = "../aws-smithy-async"
  113    117   
features = ["test-util"]
  114    118   
version = "1.2.6"
  115    119   
  116    120   
[dev-dependencies.aws-smithy-protocol-test]
  117    121   
path = "../aws-smithy-protocol-test"
  118    122   
version = "0.63.6"
  119    123   

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/endpoint_override.rs

@@ -0,1 +0,150 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
//! Endpoint override detection for business metrics tracking
           7  +
           8  +
use aws_smithy_runtime_api::box_error::BoxError;
           9  +
use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef;
          10  +
use aws_smithy_runtime_api::client::interceptors::Intercept;
          11  +
use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
          12  +
use aws_smithy_types::config_bag::{ConfigBag, FrozenLayer};
          13  +
          14  +
use crate::sdk_feature::AwsSdkFeature;
          15  +
          16  +
/// Interceptor that detects custom endpoint URLs for business metrics
          17  +
#[derive(Debug, Default)]
          18  +
#[non_exhaustive]
          19  +
pub struct EndpointOverrideInterceptor;
          20  +
          21  +
impl EndpointOverrideInterceptor {
          22  +
    /// Creates a new EndpointOverrideInterceptor
          23  +
    pub fn new() -> Self {
          24  +
        Self
          25  +
    }
          26  +
}
          27  +
          28  +
impl Intercept for EndpointOverrideInterceptor {
          29  +
    fn name(&self) -> &'static str {
          30  +
        "EndpointOverrideInterceptor"
          31  +
    }
          32  +
          33  +
    fn read_before_execution(
          34  +
        &self,
          35  +
        _context: &BeforeSerializationInterceptorContextRef<'_>,
          36  +
        cfg: &mut ConfigBag,
          37  +
    ) -> Result<(), BoxError> {
          38  +
        // Check if endpoint_url was set in config
          39  +
        if cfg
          40  +
            .load::<aws_types::endpoint_config::EndpointUrl>()
          41  +
            .is_some()
          42  +
        {
          43  +
            cfg.interceptor_state()
          44  +
                .store_append(AwsSdkFeature::EndpointOverride);
          45  +
        }
          46  +
        Ok(())
          47  +
    }
          48  +
}
          49  +
          50  +
/// Runtime plugin that detects when a custom endpoint URL has been configured
          51  +
/// and tracks it for business metrics.
          52  +
///
          53  +
/// This plugin is created by the codegen decorator when a user explicitly
          54  +
/// sets an endpoint URL via `.endpoint_url()`. It stores the
          55  +
/// `AwsSdkFeature::EndpointOverride` feature flag in the ConfigBag for
          56  +
/// business metrics tracking.
          57  +
#[derive(Debug)]
          58  +
#[non_exhaustive]
          59  +
pub struct EndpointOverrideRuntimePlugin {
          60  +
    config: Option<FrozenLayer>,
          61  +
}
          62  +
          63  +
impl EndpointOverrideRuntimePlugin {
          64  +
    /// Creates a new `EndpointOverrideRuntimePlugin` with the given config layer
          65  +
    pub fn new(config: Option<FrozenLayer>) -> Self {
          66  +
        Self { config }
          67  +
    }
          68  +
}
          69  +
          70  +
impl Default for EndpointOverrideRuntimePlugin {
          71  +
    fn default() -> Self {
          72  +
        Self { config: None }
          73  +
    }
          74  +
}
          75  +
          76  +
impl RuntimePlugin for EndpointOverrideRuntimePlugin {
          77  +
    fn config(&self) -> Option<FrozenLayer> {
          78  +
        self.config.clone()
          79  +
    }
          80  +
}
          81  +
          82  +
#[cfg(test)]
          83  +
mod tests {
          84  +
    use super::*;
          85  +
    use crate::sdk_feature::AwsSdkFeature;
          86  +
    use aws_smithy_runtime_api::client::interceptors::context::{
          87  +
        BeforeSerializationInterceptorContextRef, Input, InterceptorContext,
          88  +
    };
          89  +
    use aws_smithy_types::config_bag::ConfigBag;
          90  +
          91  +
    #[test]
          92  +
    fn test_plugin_with_no_config() {
          93  +
        let plugin = EndpointOverrideRuntimePlugin::default();
          94  +
        assert!(plugin.config().is_none());
          95  +
    }
          96  +
          97  +
    #[test]
          98  +
    fn test_interceptor_detects_endpoint_url_when_present() {
          99  +
        let interceptor = EndpointOverrideInterceptor::new();
         100  +
        let mut cfg = ConfigBag::base();
         101  +
         102  +
        // Set endpoint URL in config
         103  +
        let endpoint_url =
         104  +
            aws_types::endpoint_config::EndpointUrl("https://custom.example.com".to_string());
         105  +
        cfg.interceptor_state().store_put(endpoint_url);
         106  +
         107  +
        // Create a dummy context
         108  +
        let input = Input::doesnt_matter();
         109  +
        let ctx = InterceptorContext::new(input);
         110  +
        let context = BeforeSerializationInterceptorContextRef::from(&ctx);
         111  +
         112  +
        // Run the interceptor
         113  +
        interceptor
         114  +
            .read_before_execution(&context, &mut cfg)
         115  +
            .unwrap();
         116  +
         117  +
        // Verify feature flag was set in interceptor_state
         118  +
        let features: Vec<_> = cfg
         119  +
            .interceptor_state()
         120  +
            .load::<AwsSdkFeature>()
         121  +
            .cloned()
         122  +
            .collect();
         123  +
        assert_eq!(features.len(), 1);
         124  +
        assert_eq!(features[0], AwsSdkFeature::EndpointOverride);
         125  +
    }
         126  +
         127  +
    #[test]
         128  +
    fn test_interceptor_does_not_set_flag_when_endpoint_url_absent() {
         129  +
        let interceptor = EndpointOverrideInterceptor::new();
         130  +
        let mut cfg = ConfigBag::base();
         131  +
         132  +
        // Create a dummy context
         133  +
        let input = Input::doesnt_matter();
         134  +
        let ctx = InterceptorContext::new(input);
         135  +
        let context = BeforeSerializationInterceptorContextRef::from(&ctx);
         136  +
         137  +
        // Run the interceptor without setting endpoint URL
         138  +
        interceptor
         139  +
            .read_before_execution(&context, &mut cfg)
         140  +
            .unwrap();
         141  +
         142  +
        // Verify no feature flag was set
         143  +
        let features: Vec<_> = cfg
         144  +
            .interceptor_state()
         145  +
            .load::<AwsSdkFeature>()
         146  +
            .cloned()
         147  +
            .collect();
         148  +
        assert_eq!(features.len(), 0);
         149  +
    }
         150  +
}

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/lib.rs

@@ -1,1 +53,59 @@
   19     19   
/// Supporting code for authentication in the AWS SDK.
   20     20   
pub mod auth;
   21     21   
   22     22   
/// AWS-specific content-encoding tools
   23     23   
#[cfg(feature = "http-02x")]
   24     24   
pub mod content_encoding;
   25     25   
   26     26   
/// Supporting code for recursion detection in the AWS SDK.
   27     27   
pub mod recursion_detection;
   28     28   
          29  +
/// Supporting code for endpoint override detection in the AWS SDK.
          30  +
pub mod endpoint_override;
          31  +
          32  +
/// Supporting code for observability feature detection in the AWS SDK.
          33  +
pub mod observability_detection;
          34  +
   29     35   
/// Supporting code for user agent headers in the AWS SDK.
   30     36   
pub mod user_agent;
   31     37   
   32     38   
/// Supporting code for retry behavior specific to the AWS SDK.
   33     39   
pub mod retries;
   34     40   
   35     41   
/// Supporting code for invocation ID headers in the AWS SDK.
   36     42   
pub mod invocation_id;
   37     43   
   38     44   
/// Supporting code for request metadata headers in the AWS SDK.

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/observability_detection.rs

@@ -0,1 +0,113 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
//! Observability feature detection for business metrics tracking
           7  +
           8  +
use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
           9  +
use aws_smithy_runtime_api::box_error::BoxError;
          10  +
use aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextRef;
          11  +
use aws_smithy_runtime_api::client::interceptors::Intercept;
          12  +
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
          13  +
use aws_smithy_types::config_bag::ConfigBag;
          14  +
          15  +
use crate::sdk_feature::AwsSdkFeature;
          16  +
          17  +
/// Interceptor that detects when observability features are being used
          18  +
/// and tracks them for business metrics.
          19  +
#[derive(Debug, Default)]
          20  +
#[non_exhaustive]
          21  +
pub struct ObservabilityDetectionInterceptor;
          22  +
          23  +
impl ObservabilityDetectionInterceptor {
          24  +
    /// Creates a new `ObservabilityDetectionInterceptor`
          25  +
    pub fn new() -> Self {
          26  +
        Self
          27  +
    }
          28  +
}
          29  +
          30  +
impl Intercept for ObservabilityDetectionInterceptor {
          31  +
    fn name(&self) -> &'static str {
          32  +
        "ObservabilityDetectionInterceptor"
          33  +
    }
          34  +
          35  +
    fn read_before_signing(
          36  +
        &self,
          37  +
        _context: &BeforeTransmitInterceptorContextRef<'_>,
          38  +
        _runtime_components: &RuntimeComponents,
          39  +
        cfg: &mut ConfigBag,
          40  +
    ) -> Result<(), BoxError> {
          41  +
        // Try to get the global telemetry provider
          42  +
        if let Ok(provider) = aws_smithy_observability::global::get_telemetry_provider() {
          43  +
            // Check if it's not a noop provider
          44  +
            if !provider.is_noop() {
          45  +
                // Track that observability metrics are enabled
          46  +
                cfg.interceptor_state()
          47  +
                    .store_append(AwsSdkFeature::ObservabilityMetrics);
          48  +
          49  +
                // PRAGMATIC APPROACH: Track tracing based on meter provider state
          50  +
                //
          51  +
                // The SDK uses Rust's `tracing` crate globally but doesn't have a
          52  +
                // configurable tracer provider yet. We make the reasonable assumption
          53  +
                // that if a user has configured a meter provider, they've also set up
          54  +
                // tracing as part of their observability stack.
          55  +
                //
          56  +
                // This is a pragmatic workaround until a proper tracer provider is added.
          57  +
                cfg.interceptor_state()
          58  +
                    .store_append(SmithySdkFeature::ObservabilityTracing);
          59  +
          60  +
                // Check if it's using OpenTelemetry
          61  +
                if provider.is_otel() {
          62  +
                    cfg.interceptor_state()
          63  +
                        .store_append(AwsSdkFeature::ObservabilityOtelMetrics);
          64  +
          65  +
                    // If using OpenTelemetry for metrics, likely using it for tracing too
          66  +
                    cfg.interceptor_state()
          67  +
                        .store_append(AwsSdkFeature::ObservabilityOtelTracing);
          68  +
                }
          69  +
            }
          70  +
        }
          71  +
          72  +
        Ok(())
          73  +
    }
          74  +
}
          75  +
          76  +
#[cfg(test)]
          77  +
mod tests {
          78  +
    use super::*;
          79  +
    use aws_smithy_observability::TelemetryProvider;
          80  +
    use aws_smithy_runtime_api::client::interceptors::context::{Input, InterceptorContext};
          81  +
    use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
          82  +
    use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
          83  +
    use aws_smithy_types::config_bag::ConfigBag;
          84  +
          85  +
    #[test]
          86  +
    fn test_detects_noop_provider() {
          87  +
        let mut context = InterceptorContext::new(Input::doesnt_matter());
          88  +
        context.enter_serialization_phase();
          89  +
        context.set_request(HttpRequest::empty());
          90  +
        let _ = context.take_input();
          91  +
        context.enter_before_transmit_phase();
          92  +
          93  +
        let rc = RuntimeComponentsBuilder::for_tests().build().unwrap();
          94  +
        let mut cfg = ConfigBag::base();
          95  +
          96  +
        // Set a noop provider (ignore error if already set by another test)
          97  +
        let _ = aws_smithy_observability::global::set_telemetry_provider(TelemetryProvider::noop());
          98  +
          99  +
        let interceptor = ObservabilityDetectionInterceptor::new();
         100  +
        let ctx = Into::into(&context);
         101  +
        interceptor
         102  +
            .read_before_signing(&ctx, &rc, &mut cfg)
         103  +
            .unwrap();
         104  +
         105  +
        // Should not track any features for noop provider
         106  +
        let features: Vec<_> = cfg.load::<AwsSdkFeature>().collect();
         107  +
        assert_eq!(features.len(), 0);
         108  +
    }
         109  +
         110  +
    // Note: We cannot easily test non-noop providers without creating a custom meter provider
         111  +
    // implementation, which would require exposing internal types. The noop test above
         112  +
    // is sufficient to verify the detection logic works correctly.
         113  +
}

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/observability_plugin.rs

@@ -0,1 +0,60 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
//! Runtime plugin for detecting observability features
           7  +
           8  +
use aws_smithy_observability::global::get_telemetry_provider;
           9  +
use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
          10  +
use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
          11  +
use aws_smithy_types::config_bag::{FrozenLayer, Layer};
          12  +
use std::borrow::Cow;
          13  +
          14  +
use crate::sdk_feature::AwsSdkFeature;
          15  +
          16  +
/// Runtime plugin that detects observability features and stores them in the config bag
          17  +
#[derive(Debug, Default)]
          18  +
pub struct ObservabilityRuntimePlugin;
          19  +
          20  +
impl ObservabilityRuntimePlugin {
          21  +
    /// Create a new ObservabilityRuntimePlugin
          22  +
    pub fn new() -> Self {
          23  +
        Self
          24  +
    }
          25  +
}
          26  +
          27  +
impl RuntimePlugin for ObservabilityRuntimePlugin {
          28  +
    fn config(&self) -> Option<FrozenLayer> {
          29  +
        // Try to get the global telemetry provider
          30  +
        if let Ok(telemetry_provider) = get_telemetry_provider() {
          31  +
            // Check if it's a non-noop provider
          32  +
            if !telemetry_provider.is_noop() {
          33  +
                let mut cfg = Layer::new("ObservabilityFeatures");
          34  +
          35  +
                // Store ObservabilityMetrics feature (AWS-level)
          36  +
                cfg.interceptor_state()
          37  +
                    .store_append(AwsSdkFeature::ObservabilityMetrics);
          38  +
          39  +
                // PRAGMATIC ASSUMPTION:
          40  +
                // If someone configured a meter provider, they likely also configured tracing
          41  +
                // (both are part of observability setup). We track ObservabilityTracing based
          42  +
                // on the presence of a non-noop meter provider.
          43  +
                cfg.interceptor_state()
          44  +
                    .store_append(SmithySdkFeature::ObservabilityTracing);
          45  +
          46  +
                // Check if it's OpenTelemetry
          47  +
                if telemetry_provider.is_otel() {
          48  +
                    cfg.interceptor_state()
          49  +
                        .store_append(AwsSdkFeature::ObservabilityOtelTracing);
          50  +
                    cfg.interceptor_state()
          51  +
                        .store_append(AwsSdkFeature::ObservabilityOtelMetrics);
          52  +
                }
          53  +
          54  +
                return Some(cfg.freeze());
          55  +
            }
          56  +
        }
          57  +
          58  +
        None
          59  +
    }
          60  +
}

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/sdk_feature.rs

@@ -1,1 +31,39 @@
   17     17   
    /// An operation called with account ID mode set to disabled
   18     18   
    AccountIdModeDisabled,
   19     19   
    /// An operation called with account ID mode set to required
   20     20   
    AccountIdModeRequired,
   21     21   
    /// Indicates that an operation was called by the S3 Transfer Manager
   22     22   
    S3Transfer,
   23     23   
    /// Calling an SSO-OIDC operation as part of the SSO login flow, when using the OAuth2.0 device code grant
   24     24   
    SsoLoginDevice,
   25     25   
    /// Calling an SSO-OIDC operation as part of the SSO login flow, when using the OAuth2.0 authorization code grant
   26     26   
    SsoLoginAuth,
          27  +
    /// An operation called with observability metrics collection enabled
          28  +
    ObservabilityMetrics,
          29  +
    /// An operation called with OpenTelemetry tracing integration enabled
          30  +
    ObservabilityOtelTracing,
          31  +
    /// An operation called with OpenTelemetry metrics integration enabled
          32  +
    ObservabilityOtelMetrics,
          33  +
    /// An operation called using a user provided endpoint URL
          34  +
    EndpointOverride,
   27     35   
}
   28     36   
   29     37   
impl Storable for AwsSdkFeature {
   30     38   
    type Storer = StoreAppend<Self>;
   31     39   
}

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/user_agent/interceptor.rs

@@ -106,106 +179,188 @@
  126    126   
        &self,
  127    127   
        context: &mut BeforeTransmitInterceptorContextMut<'_>,
  128    128   
        runtime_components: &RuntimeComponents,
  129    129   
        cfg: &mut ConfigBag,
  130    130   
    ) -> Result<(), BoxError> {
  131    131   
        let mut ua = cfg
  132    132   
            .load::<AwsUserAgent>()
  133    133   
            .expect("`AwsUserAgent should have been created in `read_before_execution`")
  134    134   
            .clone();
  135    135   
         136  +
        // Load features from both the main config bag and interceptor_state
  136    137   
        let smithy_sdk_features = cfg.load::<SmithySdkFeature>();
  137    138   
        for smithy_sdk_feature in smithy_sdk_features {
  138    139   
            smithy_sdk_feature
  139    140   
                .provide_business_metric()
  140    141   
                .map(|m| ua.add_business_metric(m));
  141    142   
        }
  142    143   
  143    144   
        let aws_sdk_features = cfg.load::<AwsSdkFeature>();
  144    145   
        for aws_sdk_feature in aws_sdk_features {
  145    146   
            aws_sdk_feature
  146    147   
                .provide_business_metric()
  147    148   
                .map(|m| ua.add_business_metric(m));
  148    149   
        }
  149    150   
         151  +
        // Also load AWS SDK features from interceptor_state (where interceptors store them)
         152  +
        let aws_sdk_features_from_interceptor = cfg.interceptor_state().load::<AwsSdkFeature>();
         153  +
        for aws_sdk_feature in aws_sdk_features_from_interceptor {
         154  +
            aws_sdk_feature
         155  +
                .provide_business_metric()
         156  +
                .map(|m| ua.add_business_metric(m));
         157  +
        }
         158  +
  150    159   
        let aws_credential_features = cfg.load::<AwsCredentialFeature>();
  151    160   
        for aws_credential_feature in aws_credential_features {
  152    161   
            aws_credential_feature
  153    162   
                .provide_business_metric()
  154    163   
                .map(|m| ua.add_business_metric(m));
  155    164   
        }
  156    165   
  157    166   
        let maybe_connector_metadata = runtime_components
  158    167   
            .http_client()
  159    168   
            .and_then(|c| c.connector_metadata());

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/user_agent/metrics.rs

@@ -137,137 +254,263 @@
  157    157   
    CredentialsProfileSsoLegacy,
  158    158   
    CredentialsSsoLegacy,
  159    159   
    CredentialsProfileProcess,
  160    160   
    CredentialsProcess,
  161    161   
    CredentialsBoto2ConfigFile,
  162    162   
    CredentialsAwsSdkStore,
  163    163   
    CredentialsHttp,
  164    164   
    CredentialsImds,
  165    165   
    SsoLoginDevice,
  166    166   
    SsoLoginAuth,
  167         -
    BearerServiceEnvVars
         167  +
    BearerServiceEnvVars,
         168  +
    ObservabilityTracing,
         169  +
    ObservabilityMetrics,
         170  +
    ObservabilityOtelTracing,
         171  +
    ObservabilityOtelMetrics
  168    172   
);
  169    173   
  170    174   
pub(crate) trait ProvideBusinessMetric {
  171    175   
    fn provide_business_metric(&self) -> Option<BusinessMetric>;
  172    176   
}
  173    177   
  174    178   
impl ProvideBusinessMetric for SmithySdkFeature {
  175    179   
    fn provide_business_metric(&self) -> Option<BusinessMetric> {
  176    180   
        use SmithySdkFeature::*;
  177    181   
        match self {
  178    182   
            Waiter => Some(BusinessMetric::Waiter),
  179    183   
            Paginator => Some(BusinessMetric::Paginator),
  180    184   
            GzipRequestCompression => Some(BusinessMetric::GzipRequestCompression),
  181    185   
            ProtocolRpcV2Cbor => Some(BusinessMetric::ProtocolRpcV2Cbor),
  182    186   
            RetryModeStandard => Some(BusinessMetric::RetryModeStandard),
  183    187   
            RetryModeAdaptive => Some(BusinessMetric::RetryModeAdaptive),
  184    188   
            FlexibleChecksumsReqCrc32 => Some(BusinessMetric::FlexibleChecksumsReqCrc32),
  185    189   
            FlexibleChecksumsReqCrc32c => Some(BusinessMetric::FlexibleChecksumsReqCrc32c),
  186    190   
            FlexibleChecksumsReqCrc64 => Some(BusinessMetric::FlexibleChecksumsReqCrc64),
  187    191   
            FlexibleChecksumsReqSha1 => Some(BusinessMetric::FlexibleChecksumsReqSha1),
  188    192   
            FlexibleChecksumsReqSha256 => Some(BusinessMetric::FlexibleChecksumsReqSha256),
  189    193   
            FlexibleChecksumsReqWhenSupported => {
  190    194   
                Some(BusinessMetric::FlexibleChecksumsReqWhenSupported)
  191    195   
            }
  192    196   
            FlexibleChecksumsReqWhenRequired => {
  193    197   
                Some(BusinessMetric::FlexibleChecksumsReqWhenRequired)
  194    198   
            }
  195    199   
            FlexibleChecksumsResWhenSupported => {
  196    200   
                Some(BusinessMetric::FlexibleChecksumsResWhenSupported)
  197    201   
            }
  198    202   
            FlexibleChecksumsResWhenRequired => {
  199    203   
                Some(BusinessMetric::FlexibleChecksumsResWhenRequired)
  200    204   
            }
         205  +
            ObservabilityTracing => Some(BusinessMetric::ObservabilityTracing),
  201    206   
            otherwise => {
  202    207   
                // This may occur if a customer upgrades only the `aws-smithy-runtime-api` crate
  203    208   
                // while continuing to use an outdated version of an SDK crate or the `aws-runtime`
  204    209   
                // crate.
  205    210   
                tracing::warn!(
  206    211   
                    "Attempted to provide `BusinessMetric` for `{otherwise:?}`, which is not recognized in the current version of the `aws-runtime` crate. \
  207    212   
                    Consider upgrading to the latest version to ensure that all tracked features are properly reported in your metrics."
  208    213   
                );
  209    214   
                None
  210    215   
            }
  211    216   
        }
  212    217   
    }
  213    218   
}
  214    219   
  215    220   
impl ProvideBusinessMetric for AwsSdkFeature {
  216    221   
    fn provide_business_metric(&self) -> Option<BusinessMetric> {
  217    222   
        use AwsSdkFeature::*;
  218    223   
        match self {
  219    224   
            AccountIdModePreferred => Some(BusinessMetric::AccountIdModePreferred),
  220    225   
            AccountIdModeDisabled => Some(BusinessMetric::AccountIdModeDisabled),
  221    226   
            AccountIdModeRequired => Some(BusinessMetric::AccountIdModeRequired),
  222    227   
            S3Transfer => Some(BusinessMetric::S3Transfer),
  223    228   
            SsoLoginDevice => Some(BusinessMetric::SsoLoginDevice),
  224    229   
            SsoLoginAuth => Some(BusinessMetric::SsoLoginAuth),
         230  +
            ObservabilityMetrics => Some(BusinessMetric::ObservabilityMetrics),
         231  +
            ObservabilityOtelTracing => Some(BusinessMetric::ObservabilityOtelTracing),
         232  +
            ObservabilityOtelMetrics => Some(BusinessMetric::ObservabilityOtelMetrics),
         233  +
            EndpointOverride => Some(BusinessMetric::EndpointOverride),
  225    234   
        }
  226    235   
    }
  227    236   
}
  228    237   
  229    238   
impl ProvideBusinessMetric for AwsCredentialFeature {
  230    239   
    fn provide_business_metric(&self) -> Option<BusinessMetric> {
  231    240   
        use AwsCredentialFeature::*;
  232    241   
        match self {
  233    242   
            ResolvedAccountId => Some(BusinessMetric::ResolvedAccountId),
  234    243   
            CredentialsCode => Some(BusinessMetric::CredentialsCode),
@@ -373,382 +403,505 @@
  393    402   
  394    403   
        let csv = "A10BCE";
  395    404   
        assert_eq!("A10BC", drop_unfinished_metrics_to_fit(csv, 5));
  396    405   
  397    406   
        let csv = "A";
  398    407   
        assert_eq!("A", drop_unfinished_metrics_to_fit(csv, 5));
  399    408   
  400    409   
        let csv = "A,B";
  401    410   
        assert_eq!("A,B", drop_unfinished_metrics_to_fit(csv, 5));
  402    411   
    }
         412  +
         413  +
    #[test]
         414  +
    fn test_aws_sdk_feature_mappings() {
         415  +
        use crate::sdk_feature::AwsSdkFeature;
         416  +
        use crate::user_agent::metrics::ProvideBusinessMetric;
         417  +
         418  +
        // Test ObservabilityMetrics mapping
         419  +
        assert_eq!(
         420  +
            AwsSdkFeature::ObservabilityMetrics.provide_business_metric(),
         421  +
            Some(BusinessMetric::ObservabilityMetrics)
         422  +
        );
         423  +
         424  +
        // Test ObservabilityOtelTracing mapping
         425  +
        assert_eq!(
         426  +
            AwsSdkFeature::ObservabilityOtelTracing.provide_business_metric(),
         427  +
            Some(BusinessMetric::ObservabilityOtelTracing)
         428  +
        );
         429  +
         430  +
        // Test ObservabilityOtelMetrics mapping
         431  +
        assert_eq!(
         432  +
            AwsSdkFeature::ObservabilityOtelMetrics.provide_business_metric(),
         433  +
            Some(BusinessMetric::ObservabilityOtelMetrics)
         434  +
        );
         435  +
         436  +
        // Test SsoLoginDevice mapping
         437  +
        assert_eq!(
         438  +
            AwsSdkFeature::SsoLoginDevice.provide_business_metric(),
         439  +
            Some(BusinessMetric::SsoLoginDevice)
         440  +
        );
         441  +
         442  +
        // Test SsoLoginAuth mapping
         443  +
        assert_eq!(
         444  +
            AwsSdkFeature::SsoLoginAuth.provide_business_metric(),
         445  +
            Some(BusinessMetric::SsoLoginAuth)
         446  +
        );
         447  +
         448  +
        // Test EndpointOverride mapping
         449  +
        assert_eq!(
         450  +
            AwsSdkFeature::EndpointOverride.provide_business_metric(),
         451  +
            Some(BusinessMetric::EndpointOverride)
         452  +
        );
         453  +
    }
         454  +
         455  +
    #[test]
         456  +
    fn test_smithy_sdk_feature_observability_tracing_mapping() {
         457  +
        use crate::user_agent::metrics::ProvideBusinessMetric;
         458  +
        use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
         459  +
         460  +
        // Test ObservabilityTracing mapping
         461  +
        assert_eq!(
         462  +
            SmithySdkFeature::ObservabilityTracing.provide_business_metric(),
         463  +
            Some(BusinessMetric::ObservabilityTracing)
         464  +
        );
         465  +
    }
         466  +
         467  +
    #[test]
         468  +
    fn test_metric_id_values() {
         469  +
        // Test that metric IDs match the expected values from FEATURES.md specification
         470  +
         471  +
        // SSO Login metrics
         472  +
        assert_eq!(
         473  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::SsoLoginDevice),
         474  +
            Some(&"1".into())
         475  +
        );
         476  +
        assert_eq!(
         477  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::SsoLoginAuth),
         478  +
            Some(&"2".into())
         479  +
        );
         480  +
         481  +
        // Observability metrics
         482  +
        assert_eq!(
         483  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::ObservabilityTracing),
         484  +
            Some(&"4".into())
         485  +
        );
         486  +
        assert_eq!(
         487  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::ObservabilityMetrics),
         488  +
            Some(&"5".into())
         489  +
        );
         490  +
        assert_eq!(
         491  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::ObservabilityOtelTracing),
         492  +
            Some(&"6".into())
         493  +
        );
         494  +
        assert_eq!(
         495  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::ObservabilityOtelMetrics),
         496  +
            Some(&"7".into())
         497  +
        );
         498  +
         499  +
        // Endpoint Override metric
         500  +
        assert_eq!(
         501  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::EndpointOverride),
         502  +
            Some(&"N".into())
         503  +
        );
         504  +
    }
  403    505   
}

tmp-codegen-diff/aws-sdk/sdk/aws-runtime/src/user_agent/test_data/feature_id_to_metric_value.json

@@ -27,27 +58,62 @@
   47     47   
  "CREDENTIALS_PROFILE_SSO_LEGACY": "t",
   48     48   
  "CREDENTIALS_SSO_LEGACY": "u",
   49     49   
  "CREDENTIALS_PROFILE_PROCESS": "v",
   50     50   
  "CREDENTIALS_PROCESS": "w",
   51     51   
  "CREDENTIALS_BOTO2_CONFIG_FILE": "x",
   52     52   
  "CREDENTIALS_AWS_SDK_STORE": "y",
   53     53   
  "CREDENTIALS_HTTP": "z",
   54     54   
  "CREDENTIALS_IMDS": "0",
   55     55   
  "SSO_LOGIN_DEVICE": "1",
   56     56   
  "SSO_LOGIN_AUTH": "2",
   57         -
  "BEARER_SERVICE_ENV_VARS": "3"
          57  +
  "BEARER_SERVICE_ENV_VARS": "3",
          58  +
  "OBSERVABILITY_TRACING": "4",
          59  +
  "OBSERVABILITY_METRICS": "5",
          60  +
  "OBSERVABILITY_OTEL_TRACING": "6",
          61  +
  "OBSERVABILITY_OTEL_METRICS": "7"
   58     62   
}

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

@@ -17,17 +77,77 @@
   37     37   
[dependencies]
   38     38   
bytes = "1.10.0"
   39     39   
hex = "0.4.3"
   40     40   
hmac = "0.12"
   41     41   
sha2 = "0.10"
   42     42   
time = "0.3.5"
   43     43   
tracing = "0.1.40"
   44     44   
   45     45   
[dependencies.aws-credential-types]
   46     46   
path = "../aws-credential-types"
   47         -
version = "1.2.9"
          47  +
version = "1.2.10"
   48     48   
   49     49   
[dependencies.aws-smithy-eventstream]
   50     50   
path = "../aws-smithy-eventstream"
   51     51   
optional = true
   52     52   
version = "0.60.13"
   53     53   
   54     54   
[dependencies.aws-smithy-http]
   55     55   
path = "../aws-smithy-http"
   56     56   
version = "0.62.5"
   57     57   
@@ -89,89 +130,130 @@
  109    109   
pretty_assertions = "1.3"
  110    110   
proptest = "1.2"
  111    111   
serde = "1.0.180"
  112    112   
serde_derive = "1.0.180"
  113    113   
serde_json = "1.0.104"
  114    114   
criterion = "0.5"
  115    115   
  116    116   
[dev-dependencies.aws-credential-types]
  117    117   
path = "../aws-credential-types"
  118    118   
features = ["test-util", "hardcoded-credentials"]
  119         -
version = "1.2.9"
         119  +
version = "1.2.10"
  120    120   
  121    121   
[dev-dependencies.aws-smithy-runtime-api]
  122    122   
path = "../aws-smithy-runtime-api"
  123    123   
features = ["client", "test-util"]
  124    124   
version = "1.9.2"
  125    125   
  126    126   
[dev-dependencies.time]
  127    127   
version = "0.3.5"
  128    128   
features = ["parsing"]
  129    129   
[target."cfg(not(any(target_arch = \"powerpc\", target_arch = \"powerpc64\")))".dev-dependencies]

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-mocks/Cargo.toml

@@ -14,14 +0,44 @@
   34     34   
features = ["full"]
   35     35   
   36     36   
[dev-dependencies.aws-smithy-async]
   37     37   
path = "../aws-smithy-async"
   38     38   
features = ["rt-tokio"]
   39     39   
version = "1.2.6"
   40     40   
   41     41   
[dev-dependencies.aws-smithy-runtime]
   42     42   
path = "../aws-smithy-runtime"
   43     43   
features = ["client"]
   44         -
version = "1.9.4"
          44  +
version = "1.9.5"

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-observability-otel/Cargo.toml

@@ -1,1 +48,48 @@
   21     21   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   22     22   
rustdoc-args = ["--cfg", "docsrs"]
   23     23   
   24     24   
[dependencies]
   25     25   
value-bag = "1.10.0"
   26     26   
async-global-executor = "2.4.1"
   27     27   
async-task = "=4.7.1"
   28     28   
   29     29   
[dependencies.aws-smithy-observability]
   30     30   
path = "../aws-smithy-observability"
   31         -
version = "0.1.4"
          31  +
version = "0.1.5"
   32     32   
   33     33   
[dependencies.opentelemetry]
   34     34   
version = "0.26.0"
   35     35   
features = ["metrics"]
   36     36   
[target."cfg(not(target_arch = \"powerpc\"))".dependencies.opentelemetry_sdk]
   37     37   
version = "0.26.0"
   38     38   
features = ["metrics", "testing"]
   39     39   
   40     40   
[dev-dependencies]
   41     41   
stats_alloc = "0.1.10"

tmp-codegen-diff/aws-sdk/sdk/aws-smithy-observability/Cargo.toml

@@ -1,1 +20,20 @@
    1      1   
# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
[package]
    3      3   
name = "aws-smithy-observability"
    4         -
version = "0.1.4"
           4  +
version = "0.1.5"
    5      5   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
    6      6   
description = "Smithy observability implementation."
    7      7   
edition = "2021"
    8      8   
license = "Apache-2.0"
    9      9   
repository = "https://github.com/awslabs/smithy-rs"
   10     10   
[package.metadata.docs.rs]
   11     11   
all-features = true
   12     12   
targets = ["x86_64-unknown-linux-gnu"]
   13     13   
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
   14     14   
rustdoc-args = ["--cfg", "docsrs"]