AWS SDK

AWS SDK

rev. 204d06482730ba8b17a7e261a2b6b890cc32a39a (ignoring whitespace)

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.16"
   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,147 @@
   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.2.0"
          58  +
          59  +
[dependencies.aws-smithy-observability-otel]
          60  +
path = "../aws-smithy-observability-otel"
          61  +
version = "0.1.3"
          62  +
   55     63   
[dependencies.aws-smithy-runtime]
   56     64   
path = "../aws-smithy-runtime"
   57     65   
features = ["client"]
   58         -
version = "1.9.4"
          66  +
version = "1.9.5"
   59     67   
   60     68   
[dependencies.aws-smithy-runtime-api]
   61     69   
path = "../aws-smithy-runtime-api"
   62     70   
features = ["client"]
   63     71   
version = "1.9.2"
   64     72   
   65     73   
[dependencies.aws-smithy-types]
   66     74   
path = "../aws-smithy-types"
   67     75   
version = "1.3.4"
   68     76   
   69     77   
[dependencies.aws-types]
   70     78   
path = "../aws-types"
   71     79   
version = "1.3.10"
   72     80   
   73     81   
[dependencies.http-02x]
   74     82   
package = "http"
   75     83   
version = "0.2.9"
   76     84   
   77     85   
[dependencies.http-body-04x]
   78     86   
package = "http-body"
   79     87   
version = "0.4.5"
   80     88   
   81     89   
[dependencies.http-1x]
   82     90   
package = "http"
   83     91   
version = "1.1.0"
   84     92   
optional = true
   85     93   
   86     94   
[dependencies.http-body-1x]
   87     95   
package = "http-body"
   88     96   
version = "1.0.0"
   89     97   
optional = true
   90     98   
   91     99   
[dependencies.regex-lite]
   92    100   
version = "0.1.5"
   93    101   
optional = true
   94    102   
   95    103   
[dependencies.uuid]
   96    104   
version = "1"
   97    105   
   98    106   
[dev-dependencies]
   99    107   
arbitrary = "1.3"
  100    108   
bytes-utils = "0.1.2"
  101    109   
convert_case = "0.6.0"
  102    110   
proptest = "1.2"
  103    111   
serde_json = "1"
  104    112   
tracing-test = "0.2.4"
  105    113   
  106    114   
[dev-dependencies.aws-credential-types]
  107    115   
path = "../aws-credential-types"
  108    116   
features = ["test-util"]
  109         -
version = "1.2.9"
         117  +
version = "1.2.10"
  110    118   
  111    119   
[dev-dependencies.aws-smithy-async]
  112    120   
path = "../aws-smithy-async"
  113    121   
features = ["test-util"]
  114    122   
version = "1.2.6"
  115    123   
  116    124   
[dev-dependencies.aws-smithy-protocol-test]
  117    125   
path = "../aws-smithy-protocol-test"
  118    126   
version = "0.63.6"
  119    127   

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

@@ -0,1 +0,159 @@
           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::BeforeTransmitInterceptorContextRef;
          10  +
use aws_smithy_runtime_api::client::interceptors::Intercept;
          11  +
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
          12  +
use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
          13  +
use aws_smithy_types::config_bag::{ConfigBag, FrozenLayer, Layer};
          14  +
          15  +
use crate::sdk_feature::AwsSdkFeature;
          16  +
          17  +
/// Interceptor that detects custom endpoint URLs for business metrics
          18  +
///
          19  +
/// This interceptor checks at runtime if a `StaticUriEndpointResolver` is configured,
          20  +
/// which indicates that `.endpoint_url()` was called. When detected, it stores the
          21  +
/// `AwsSdkFeature::EndpointOverride` feature flag for business metrics tracking.
          22  +
#[derive(Debug, Default)]
          23  +
#[non_exhaustive]
          24  +
pub struct EndpointOverrideInterceptor;
          25  +
          26  +
impl EndpointOverrideInterceptor {
          27  +
    /// Creates a new EndpointOverrideInterceptor
          28  +
    pub fn new() -> Self {
          29  +
        Self
          30  +
    }
          31  +
}
          32  +
          33  +
impl Intercept for EndpointOverrideInterceptor {
          34  +
    fn name(&self) -> &'static str {
          35  +
        "EndpointOverrideInterceptor"
          36  +
    }
          37  +
          38  +
    fn read_after_serialization(
          39  +
        &self,
          40  +
        _context: &BeforeTransmitInterceptorContextRef<'_>,
          41  +
        runtime_components: &RuntimeComponents,
          42  +
        cfg: &mut ConfigBag,
          43  +
    ) -> Result<(), BoxError> {
          44  +
        // Check if the endpoint resolver is a StaticUriEndpointResolver
          45  +
        // This indicates that .endpoint_url() was called
          46  +
        let resolver = runtime_components.endpoint_resolver();
          47  +
          48  +
        // Check the resolver's debug string to see if it's StaticUriEndpointResolver
          49  +
        let debug_str = format!("{resolver:?}");
          50  +
          51  +
        if debug_str.contains("StaticUriEndpointResolver") {
          52  +
            // Store in interceptor_state
          53  +
            cfg.interceptor_state()
          54  +
                .store_append(AwsSdkFeature::EndpointOverride);
          55  +
        }
          56  +
          57  +
        Ok(())
          58  +
    }
          59  +
}
          60  +
          61  +
/// Runtime plugin that detects when a custom endpoint URL has been configured
          62  +
/// and tracks it for business metrics.
          63  +
///
          64  +
/// This plugin is created by the codegen decorator when a user explicitly
          65  +
/// sets an endpoint URL via `.endpoint_url()`. It stores the
          66  +
/// `AwsSdkFeature::EndpointOverride` feature flag in the ConfigBag for
          67  +
/// business metrics tracking.
          68  +
#[derive(Debug, Default)]
          69  +
#[non_exhaustive]
          70  +
pub struct EndpointOverrideRuntimePlugin {
          71  +
    config: Option<FrozenLayer>,
          72  +
}
          73  +
          74  +
impl EndpointOverrideRuntimePlugin {
          75  +
    /// Creates a new `EndpointOverrideRuntimePlugin` with the given config layer
          76  +
    pub fn new(config: Option<FrozenLayer>) -> Self {
          77  +
        Self { config }
          78  +
    }
          79  +
          80  +
    /// Creates a new `EndpointOverrideRuntimePlugin` and marks that endpoint override is enabled
          81  +
    pub fn new_with_feature_flag() -> Self {
          82  +
        let mut layer = Layer::new("endpoint_override");
          83  +
        layer.store_append(AwsSdkFeature::EndpointOverride);
          84  +
        Self {
          85  +
            config: Some(layer.freeze()),
          86  +
        }
          87  +
    }
          88  +
}
          89  +
          90  +
impl RuntimePlugin for EndpointOverrideRuntimePlugin {
          91  +
    fn config(&self) -> Option<FrozenLayer> {
          92  +
        self.config.clone()
          93  +
    }
          94  +
}
          95  +
          96  +
#[cfg(test)]
          97  +
mod tests {
          98  +
    use super::*;
          99  +
    use crate::sdk_feature::AwsSdkFeature;
         100  +
         101  +
    #[test]
         102  +
    fn test_plugin_with_no_config() {
         103  +
        let plugin = EndpointOverrideRuntimePlugin::default();
         104  +
        assert!(plugin.config().is_none());
         105  +
    }
         106  +
         107  +
    #[test]
         108  +
    fn test_plugin_with_feature_flag() {
         109  +
        let plugin = EndpointOverrideRuntimePlugin::new_with_feature_flag();
         110  +
        let config = plugin.config().expect("config should be set");
         111  +
         112  +
        // Verify the feature flag is present in the config
         113  +
        let features: Vec<_> = config.load::<AwsSdkFeature>().cloned().collect();
         114  +
        assert_eq!(features.len(), 1);
         115  +
        assert_eq!(features[0], AwsSdkFeature::EndpointOverride);
         116  +
    }
         117  +
         118  +
    #[test]
         119  +
    fn test_interceptor_detects_static_uri_resolver() {
         120  +
        use aws_smithy_runtime::client::orchestrator::endpoints::StaticUriEndpointResolver;
         121  +
        use aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver;
         122  +
        use aws_smithy_runtime_api::client::interceptors::context::{Input, InterceptorContext};
         123  +
        use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
         124  +
        use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
         125  +
        use aws_smithy_types::config_bag::ConfigBag;
         126  +
         127  +
        // Create a StaticUriEndpointResolver
         128  +
        let endpoint_resolver = SharedEndpointResolver::new(StaticUriEndpointResolver::uri(
         129  +
            "https://custom.example.com",
         130  +
        ));
         131  +
         132  +
        let mut context = InterceptorContext::new(Input::doesnt_matter());
         133  +
        context.enter_serialization_phase();
         134  +
        context.set_request(HttpRequest::empty());
         135  +
        let _ = context.take_input();
         136  +
        context.enter_before_transmit_phase();
         137  +
         138  +
        let rc = RuntimeComponentsBuilder::for_tests()
         139  +
            .with_endpoint_resolver(Some(endpoint_resolver))
         140  +
            .build()
         141  +
            .unwrap();
         142  +
        let mut cfg = ConfigBag::base();
         143  +
         144  +
        let interceptor = EndpointOverrideInterceptor::new();
         145  +
        let ctx = Into::into(&context);
         146  +
        interceptor
         147  +
            .read_after_serialization(&ctx, &rc, &mut cfg)
         148  +
            .unwrap();
         149  +
         150  +
        // Verify the feature flag was set
         151  +
        let features: Vec<_> = cfg
         152  +
            .interceptor_state()
         153  +
            .load::<AwsSdkFeature>()
         154  +
            .cloned()
         155  +
            .collect();
         156  +
        assert_eq!(features.len(), 1, "Expected 1 feature, got: {:?}", features);
         157  +
        assert_eq!(features[0], AwsSdkFeature::EndpointOverride);
         158  +
    }
         159  +
}

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,177 @@
           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  +
//! This module provides an interceptor for detecting observability features in the AWS SDK:
           9  +
//!
          10  +
//! - [`crate::observability_detection::ObservabilityDetectionInterceptor`]: Detects observability features during
          11  +
//!   request processing and tracks them for business metrics in the User-Agent header.
          12  +
          13  +
use aws_smithy_observability_otel::meter::OtelMeterProvider;
          14  +
use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
          15  +
use aws_smithy_runtime_api::box_error::BoxError;
          16  +
use aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextRef;
          17  +
use aws_smithy_runtime_api::client::interceptors::Intercept;
          18  +
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
          19  +
use aws_smithy_types::config_bag::ConfigBag;
          20  +
          21  +
/// Interceptor that detects when observability features are being used
          22  +
/// and tracks them for business metrics.
          23  +
#[derive(Debug, Default)]
          24  +
#[non_exhaustive]
          25  +
pub struct ObservabilityDetectionInterceptor;
          26  +
          27  +
impl ObservabilityDetectionInterceptor {
          28  +
    /// Creates a new `ObservabilityDetectionInterceptor`
          29  +
    pub fn new() -> Self {
          30  +
        Self
          31  +
    }
          32  +
}
          33  +
          34  +
impl Intercept for ObservabilityDetectionInterceptor {
          35  +
    fn name(&self) -> &'static str {
          36  +
        "ObservabilityDetectionInterceptor"
          37  +
    }
          38  +
          39  +
    fn read_before_signing(
          40  +
        &self,
          41  +
        _context: &BeforeTransmitInterceptorContextRef<'_>,
          42  +
        _runtime_components: &RuntimeComponents,
          43  +
        cfg: &mut ConfigBag,
          44  +
    ) -> Result<(), BoxError> {
          45  +
        // Try to get the global telemetry provider
          46  +
        if let Ok(provider) = aws_smithy_observability::global::get_telemetry_provider() {
          47  +
            // Use type-safe downcasting to detect OpenTelemetry meter provider
          48  +
            // This works with any ProvideMeter implementation and doesn't require
          49  +
            // implementation-specific boolean flags
          50  +
            if provider
          51  +
                .meter_provider()
          52  +
                .as_any()
          53  +
                .downcast_ref::<OtelMeterProvider>()
          54  +
                .is_some()
          55  +
            {
          56  +
                // Track that observability metrics are enabled
          57  +
                cfg.interceptor_state()
          58  +
                    .store_append(SmithySdkFeature::ObservabilityMetrics);
          59  +
            }
          60  +
        }
          61  +
          62  +
        Ok(())
          63  +
    }
          64  +
}
          65  +
          66  +
#[cfg(test)]
          67  +
mod tests {
          68  +
    use super::*;
          69  +
    use crate::sdk_feature::AwsSdkFeature;
          70  +
    use aws_smithy_observability::TelemetryProvider;
          71  +
    use aws_smithy_runtime_api::client::interceptors::context::{Input, InterceptorContext};
          72  +
    use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
          73  +
    use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder;
          74  +
    use aws_smithy_types::config_bag::ConfigBag;
          75  +
          76  +
    #[test]
          77  +
    fn test_detects_noop_provider() {
          78  +
        let mut context = InterceptorContext::new(Input::doesnt_matter());
          79  +
        context.enter_serialization_phase();
          80  +
        context.set_request(HttpRequest::empty());
          81  +
        let _ = context.take_input();
          82  +
        context.enter_before_transmit_phase();
          83  +
          84  +
        let rc = RuntimeComponentsBuilder::for_tests().build().unwrap();
          85  +
        let mut cfg = ConfigBag::base();
          86  +
          87  +
        // Set a noop provider (ignore error if already set by another test)
          88  +
        let _ = aws_smithy_observability::global::set_telemetry_provider(TelemetryProvider::noop());
          89  +
          90  +
        let interceptor = ObservabilityDetectionInterceptor::new();
          91  +
        let ctx = Into::into(&context);
          92  +
        interceptor
          93  +
            .read_before_signing(&ctx, &rc, &mut cfg)
          94  +
            .unwrap();
          95  +
          96  +
        // Should not track any features for noop provider since it doesn't downcast to OtelMeterProvider
          97  +
        let smithy_features: Vec<_> = cfg.load::<SmithySdkFeature>().collect();
          98  +
        assert_eq!(smithy_features.len(), 0);
          99  +
         100  +
        let aws_features: Vec<_> = cfg.load::<AwsSdkFeature>().collect();
         101  +
        assert_eq!(aws_features.len(), 0);
         102  +
    }
         103  +
         104  +
    #[test]
         105  +
    fn test_custom_provider_not_detected_as_otel() {
         106  +
        use aws_smithy_observability::meter::{Meter, ProvideMeter};
         107  +
        use aws_smithy_observability::noop::NoopMeterProvider;
         108  +
        use aws_smithy_observability::Attributes;
         109  +
        use std::sync::Arc;
         110  +
         111  +
        // Create a custom (non-OTel, non-noop) meter provider
         112  +
        // This simulates a user implementing their own metrics provider
         113  +
        #[derive(Debug)]
         114  +
        struct CustomMeterProvider {
         115  +
            inner: NoopMeterProvider,
         116  +
        }
         117  +
         118  +
        impl ProvideMeter for CustomMeterProvider {
         119  +
            fn get_meter(&self, scope: &'static str, attributes: Option<&Attributes>) -> Meter {
         120  +
                // Delegate to noop for simplicity, but this is a distinct type
         121  +
                self.inner.get_meter(scope, attributes)
         122  +
            }
         123  +
         124  +
            fn as_any(&self) -> &dyn std::any::Any {
         125  +
                self
         126  +
            }
         127  +
        }
         128  +
         129  +
        let mut context = InterceptorContext::new(Input::doesnt_matter());
         130  +
        context.enter_serialization_phase();
         131  +
        context.set_request(HttpRequest::empty());
         132  +
        let _ = context.take_input();
         133  +
        context.enter_before_transmit_phase();
         134  +
         135  +
        let rc = RuntimeComponentsBuilder::for_tests().build().unwrap();
         136  +
        let mut cfg = ConfigBag::base();
         137  +
         138  +
        // Set the custom provider
         139  +
        let custom_provider = Arc::new(CustomMeterProvider {
         140  +
            inner: NoopMeterProvider,
         141  +
        });
         142  +
        let telemetry_provider = TelemetryProvider::builder()
         143  +
            .meter_provider(custom_provider)
         144  +
            .build();
         145  +
        let _ = aws_smithy_observability::global::set_telemetry_provider(telemetry_provider);
         146  +
         147  +
        let interceptor = ObservabilityDetectionInterceptor::new();
         148  +
        let ctx = Into::into(&context);
         149  +
        interceptor
         150  +
            .read_before_signing(&ctx, &rc, &mut cfg)
         151  +
            .unwrap();
         152  +
         153  +
        // Should NOT track any features for custom provider since it doesn't downcast to OtelMeterProvider
         154  +
        // The new implementation only emits metrics when OTel is detected
         155  +
        let smithy_features: Vec<_> = cfg
         156  +
            .interceptor_state()
         157  +
            .load::<SmithySdkFeature>()
         158  +
            .cloned()
         159  +
            .collect();
         160  +
        assert!(
         161  +
            !smithy_features.iter().any(|f| *f == SmithySdkFeature::ObservabilityMetrics),
         162  +
            "Should not detect custom provider as having observability metrics (only OTel is tracked)"
         163  +
        );
         164  +
         165  +
        // Verify no AWS-specific features are tracked for custom provider
         166  +
        let aws_features: Vec<_> = cfg
         167  +
            .interceptor_state()
         168  +
            .load::<AwsSdkFeature>()
         169  +
            .cloned()
         170  +
            .collect();
         171  +
        assert_eq!(
         172  +
            aws_features.len(),
         173  +
            0,
         174  +
            "Should not track any AWS-specific features for custom provider"
         175  +
        );
         176  +
    }
         177  +
}

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

@@ -1,1 +31,33 @@
   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 using a user provided endpoint URL
          28  +
    EndpointOverride,
   27     29   
}
   28     30   
   29     31   
impl Storable for AwsSdkFeature {
   30     32   
    type Storer = StoreAppend<Self>;
   31     33   
}

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

@@ -410,410 +440,473 @@
  430    430   
  431    431   
        let header = expect_header(&context, "user-agent");
  432    432   
        assert_eq!(AwsUserAgent::for_tests().ua_header(), header);
  433    433   
        assert!(!header.contains("unused"));
  434    434   
  435    435   
        assert_eq!(
  436    436   
            AwsUserAgent::for_tests().aws_ua_header(),
  437    437   
            expect_header(&context, "x-amz-user-agent")
  438    438   
        );
  439    439   
    }
         440  +
         441  +
    #[test]
         442  +
    fn test_cfg_load_captures_all_feature_layers() {
         443  +
        use crate::sdk_feature::AwsSdkFeature;
         444  +
         445  +
        // Create a ConfigBag with features in both base layer and interceptor_state
         446  +
        let mut base_layer = Layer::new("base");
         447  +
        base_layer.store_append(AwsSdkFeature::EndpointOverride);
         448  +
         449  +
        let mut config = ConfigBag::of_layers(vec![base_layer]);
         450  +
         451  +
        // Store a feature in interceptor_state (simulating what interceptors do)
         452  +
        config
         453  +
            .interceptor_state()
         454  +
            .store_append(AwsSdkFeature::SsoLoginDevice);
         455  +
         456  +
        // Verify that cfg.load() captures features from all layers
         457  +
        let all_features: Vec<&AwsSdkFeature> = config.load::<AwsSdkFeature>().collect();
         458  +
         459  +
        assert_eq!(
         460  +
            all_features.len(),
         461  +
            2,
         462  +
            "cfg.load() should capture features from all layers"
         463  +
        );
         464  +
        assert!(
         465  +
            all_features.contains(&&AwsSdkFeature::EndpointOverride),
         466  +
            "should contain feature from base layer"
         467  +
        );
         468  +
        assert!(
         469  +
            all_features.contains(&&AwsSdkFeature::SsoLoginDevice),
         470  +
            "should contain feature from interceptor_state"
         471  +
        );
         472  +
    }
  440    473   
}

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

@@ -137,137 +254,260 @@
  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  +
            ObservabilityMetrics => Some(BusinessMetric::ObservabilityMetrics),
  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  +
            EndpointOverride => Some(BusinessMetric::EndpointOverride),
  225    231   
        }
  226    232   
    }
  227    233   
}
  228    234   
  229    235   
impl ProvideBusinessMetric for AwsCredentialFeature {
  230    236   
    fn provide_business_metric(&self) -> Option<BusinessMetric> {
  231    237   
        use AwsCredentialFeature::*;
  232    238   
        match self {
  233    239   
            ResolvedAccountId => Some(BusinessMetric::ResolvedAccountId),
  234    240   
            CredentialsCode => Some(BusinessMetric::CredentialsCode),
@@ -373,379 +403,484 @@
  393    399   
  394    400   
        let csv = "A10BCE";
  395    401   
        assert_eq!("A10BC", drop_unfinished_metrics_to_fit(csv, 5));
  396    402   
  397    403   
        let csv = "A";
  398    404   
        assert_eq!("A", drop_unfinished_metrics_to_fit(csv, 5));
  399    405   
  400    406   
        let csv = "A,B";
  401    407   
        assert_eq!("A,B", drop_unfinished_metrics_to_fit(csv, 5));
  402    408   
    }
         409  +
         410  +
    #[test]
         411  +
    fn test_aws_sdk_feature_mappings() {
         412  +
        use crate::sdk_feature::AwsSdkFeature;
         413  +
        use crate::user_agent::metrics::ProvideBusinessMetric;
         414  +
         415  +
        // Test SsoLoginDevice mapping
         416  +
        assert_eq!(
         417  +
            AwsSdkFeature::SsoLoginDevice.provide_business_metric(),
         418  +
            Some(BusinessMetric::SsoLoginDevice)
         419  +
        );
         420  +
         421  +
        // Test SsoLoginAuth mapping
         422  +
        assert_eq!(
         423  +
            AwsSdkFeature::SsoLoginAuth.provide_business_metric(),
         424  +
            Some(BusinessMetric::SsoLoginAuth)
         425  +
        );
         426  +
         427  +
        // Test EndpointOverride mapping
         428  +
        assert_eq!(
         429  +
            AwsSdkFeature::EndpointOverride.provide_business_metric(),
         430  +
            Some(BusinessMetric::EndpointOverride)
         431  +
        );
         432  +
    }
         433  +
         434  +
    #[test]
         435  +
    fn test_smithy_sdk_feature_observability_mappings() {
         436  +
        use crate::user_agent::metrics::ProvideBusinessMetric;
         437  +
        use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
         438  +
         439  +
        // Test ObservabilityMetrics mapping
         440  +
        assert_eq!(
         441  +
            SmithySdkFeature::ObservabilityMetrics.provide_business_metric(),
         442  +
            Some(BusinessMetric::ObservabilityMetrics)
         443  +
        );
         444  +
    }
         445  +
         446  +
    #[test]
         447  +
    fn test_metric_id_values() {
         448  +
        // Test that metric IDs match the expected values from FEATURES.md specification
         449  +
         450  +
        // SSO Login metrics
         451  +
        assert_eq!(
         452  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::SsoLoginDevice),
         453  +
            Some(&"1".into())
         454  +
        );
         455  +
        assert_eq!(
         456  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::SsoLoginAuth),
         457  +
            Some(&"2".into())
         458  +
        );
         459  +
         460  +
        // Observability metrics
         461  +
        assert_eq!(
         462  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::ObservabilityTracing),
         463  +
            Some(&"4".into())
         464  +
        );
         465  +
        assert_eq!(
         466  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::ObservabilityMetrics),
         467  +
            Some(&"5".into())
         468  +
        );
         469  +
        assert_eq!(
         470  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::ObservabilityOtelTracing),
         471  +
            Some(&"6".into())
         472  +
        );
         473  +
        assert_eq!(
         474  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::ObservabilityOtelMetrics),
         475  +
            Some(&"7".into())
         476  +
        );
         477  +
         478  +
        // Endpoint Override metric
         479  +
        assert_eq!(
         480  +
            FEATURE_ID_TO_METRIC_VALUE.get(&BusinessMetric::EndpointOverride),
         481  +
            Some(&"N".into())
         482  +
        );
         483  +
    }
  403    484   
}

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 @@
    2      2   
[[bench]]
    3      3   
name = "sync_instruments"
    4      4   
harness = false
    5      5   
    6      6   
[[bench]]
    7      7   
name = "async_instruments"
    8      8   
harness = false
    9      9   
   10     10   
[package]
   11     11   
name = "aws-smithy-observability-otel"
   12         -
version = "0.1.2"
          12  +
version = "0.1.3"
   13     13   
authors = ["AWS Rust SDK Team <aws-sdk-rust@amazon.com>"]
   14     14   
description = "Smithy OpenTelemetry observability implementation."
   15     15   
edition = "2021"
   16     16   
license = "Apache-2.0"
   17     17   
repository = "https://github.com/awslabs/smithy-rs"
   18     18   
[package.metadata.docs.rs]
   19     19   
all-features = true
   20     20   
targets = ["x86_64-unknown-linux-gnu"]
   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.2.0"
   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-otel/src/meter.rs

@@ -259,259 +318,322 @@
  279    279   
            Ok(_) => Ok(()),
  280    280   
            Err(err) => Err(ObservabilityError::new(ErrorKind::Other, err)),
  281    281   
        }
  282    282   
    }
  283    283   
}
  284    284   
  285    285   
impl ProvideMeter for OtelMeterProvider {
  286    286   
    fn get_meter(&self, scope: &'static str, _attributes: Option<&Attributes>) -> Meter {
  287    287   
        Meter::new(Arc::new(MeterWrap(self.meter_provider.meter(scope))))
  288    288   
    }
         289  +
         290  +
    fn as_any(&self) -> &dyn std::any::Any {
         291  +
        self
         292  +
    }
  289    293   
}
  290    294   
  291    295   
#[cfg(test)]
  292    296   
mod tests {
  293    297   
  294    298   
    use std::sync::Arc;
  295    299   
  296    300   
    use aws_smithy_observability::instruments::AsyncMeasure;
  297    301   
    use aws_smithy_observability::{AttributeValue, Attributes, TelemetryProvider};
  298    302   
    use opentelemetry_sdk::metrics::{

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.2.0"
    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"]