AWS SDK

AWS SDK

rev. 742c376d0200593c4954dcd8fb54e3d41691067a

Files changed:

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

@@ -214,214 +259,261 @@
  234    234   
/// Primitives such as `Blob` or `DateTime` used by other types.
  235    235   
pub mod primitives;
  236    236   
  237    237   
/// Data structures used by operation inputs/outputs.
  238    238   
pub mod types;
  239    239   
  240    240   
pub(crate) mod client_idempotency_token;
  241    241   
  242    242   
mod idempotency_token;
  243    243   
         244  +
mod observability_feature;
         245  +
  244    246   
pub(crate) mod protocol_serde;
  245    247   
  246    248   
mod sdk_feature_tracker;
  247    249   
  248    250   
mod serialization_settings;
  249    251   
  250    252   
mod endpoint_lib;
  251    253   
  252    254   
mod lens;
  253    255   

tmp-codegen-diff/aws-sdk/sdk/codecatalyst/src/observability_feature.rs

@@ -0,1 +0,37 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/*
           3  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           4  +
 * SPDX-License-Identifier: Apache-2.0
           5  +
 */
           6  +
           7  +
use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
           8  +
use aws_smithy_runtime_api::{
           9  +
    box_error::BoxError,
          10  +
    client::interceptors::{context::BeforeSerializationInterceptorContextRef, Intercept},
          11  +
};
          12  +
use aws_smithy_types::config_bag::ConfigBag;
          13  +
          14  +
// Interceptor that tracks Smithy SDK features for observability (tracing/metrics).
          15  +
#[derive(Debug, Default)]
          16  +
pub(crate) struct ObservabilityFeatureTrackerInterceptor;
          17  +
          18  +
impl Intercept for ObservabilityFeatureTrackerInterceptor {
          19  +
    fn name(&self) -> &'static str {
          20  +
        "ObservabilityFeatureTrackerInterceptor"
          21  +
    }
          22  +
          23  +
    fn read_before_execution(&self, _context: &BeforeSerializationInterceptorContextRef<'_>, cfg: &mut ConfigBag) -> Result<(), BoxError> {
          24  +
        // Check if an OpenTelemetry meter provider is configured via the global provider
          25  +
        if let Ok(telemetry_provider) = aws_smithy_observability::global::get_telemetry_provider() {
          26  +
            let meter_provider = telemetry_provider.meter_provider();
          27  +
          28  +
            // Check the provider name to detect OpenTelemetry without importing the otel crate
          29  +
            // This avoids compilation issues with the opentelemetry dependency
          30  +
            if meter_provider.provider_name() == "otel" {
          31  +
                cfg.interceptor_state().store_append(SmithySdkFeature::ObservabilityOtelMetrics);
          32  +
            }
          33  +
        }
          34  +
          35  +
        Ok(())
          36  +
    }
          37  +
}

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

@@ -1,1 +67,71 @@
   14     14   
protocol = "aws.protocols#awsJson1_1"
   15     15   
[package.metadata.docs.rs]
   16     16   
all-features = true
   17     17   
targets = ["x86_64-unknown-linux-gnu"]
   18     18   
[dependencies.aws-credential-types]
   19     19   
path = "../aws-credential-types"
   20     20   
version = "1.2.11"
   21     21   
   22     22   
[dependencies.aws-runtime]
   23     23   
path = "../aws-runtime"
   24         -
version = "1.5.17"
          24  +
version = "1.5.18"
   25     25   
   26     26   
[dependencies.aws-smithy-async]
   27     27   
path = "../aws-smithy-async"
   28     28   
version = "1.2.7"
   29     29   
   30     30   
[dependencies.aws-smithy-http]
   31     31   
path = "../aws-smithy-http"
   32     32   
version = "0.62.6"
   33     33   
   34     34   
[dependencies.aws-smithy-json]
   35     35   
path = "../aws-smithy-json"
   36     36   
version = "0.61.8"
   37     37   
          38  +
[dependencies.aws-smithy-observability]
          39  +
path = "../aws-smithy-observability"
          40  +
version = "0.1.5"
          41  +
   38     42   
[dependencies.aws-smithy-runtime]
   39     43   
path = "../aws-smithy-runtime"
   40     44   
features = ["client"]
   41     45   
version = "1.9.5"
   42     46   
   43     47   
[dependencies.aws-smithy-runtime-api]
   44     48   
path = "../aws-smithy-runtime-api"
   45     49   
features = ["client", "http-02x"]
   46     50   
version = "1.9.3"
   47     51   

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

@@ -1277,1277 +1336,1337 @@
 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   1303   
        runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
 1304   1304   
        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1305   1305   
            ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
 1306   1306   
        ));
        1307  +
        runtime_components.push_interceptor(crate::observability_feature::ObservabilityFeatureTrackerInterceptor);
 1307   1308   
        Self { config, runtime_components }
 1308   1309   
    }
 1309   1310   
}
 1310   1311   
 1311   1312   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
 1312   1313   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
 1313   1314   
        self.config.clone()
 1314   1315   
    }
 1315   1316   
 1316   1317   
    fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {

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

@@ -162,162 +207,209 @@
  182    182   
  183    183   
/// All operations that this crate can perform.
  184    184   
pub mod operation;
  185    185   
  186    186   
/// Primitives such as `Blob` or `DateTime` used by other types.
  187    187   
pub mod primitives;
  188    188   
  189    189   
/// Data structures used by operation inputs/outputs.
  190    190   
pub mod types;
  191    191   
         192  +
mod observability_feature;
         193  +
  192    194   
pub(crate) mod protocol_serde;
  193    195   
  194    196   
mod sdk_feature_tracker;
  195    197   
  196    198   
mod serialization_settings;
  197    199   
  198    200   
mod endpoint_lib;
  199    201   
  200    202   
mod lens;
  201    203   

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

@@ -0,1 +0,37 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/*
           3  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           4  +
 * SPDX-License-Identifier: Apache-2.0
           5  +
 */
           6  +
           7  +
use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
           8  +
use aws_smithy_runtime_api::{
           9  +
    box_error::BoxError,
          10  +
    client::interceptors::{context::BeforeSerializationInterceptorContextRef, Intercept},
          11  +
};
          12  +
use aws_smithy_types::config_bag::ConfigBag;
          13  +
          14  +
// Interceptor that tracks Smithy SDK features for observability (tracing/metrics).
          15  +
#[derive(Debug, Default)]
          16  +
pub(crate) struct ObservabilityFeatureTrackerInterceptor;
          17  +
          18  +
impl Intercept for ObservabilityFeatureTrackerInterceptor {
          19  +
    fn name(&self) -> &'static str {
          20  +
        "ObservabilityFeatureTrackerInterceptor"
          21  +
    }
          22  +
          23  +
    fn read_before_execution(&self, _context: &BeforeSerializationInterceptorContextRef<'_>, cfg: &mut ConfigBag) -> Result<(), BoxError> {
          24  +
        // Check if an OpenTelemetry meter provider is configured via the global provider
          25  +
        if let Ok(telemetry_provider) = aws_smithy_observability::global::get_telemetry_provider() {
          26  +
            let meter_provider = telemetry_provider.meter_provider();
          27  +
          28  +
            // Check the provider name to detect OpenTelemetry without importing the otel crate
          29  +
            // This avoids compilation issues with the opentelemetry dependency
          30  +
            if meter_provider.provider_name() == "otel" {
          31  +
                cfg.interceptor_state().store_append(SmithySdkFeature::ObservabilityOtelMetrics);
          32  +
            }
          33  +
        }
          34  +
          35  +
        Ok(())
          36  +
    }
          37  +
}

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

@@ -1,1 +115,119 @@
   14     14   
protocol = "aws.protocols#awsJson1_0"
   15     15   
[package.metadata.docs.rs]
   16     16   
all-features = true
   17     17   
targets = ["x86_64-unknown-linux-gnu"]
   18     18   
[dependencies.aws-credential-types]
   19     19   
path = "../aws-credential-types"
   20     20   
version = "1.2.11"
   21     21   
   22     22   
[dependencies.aws-runtime]
   23     23   
path = "../aws-runtime"
   24         -
version = "1.5.17"
          24  +
version = "1.5.18"
   25     25   
   26     26   
[dependencies.aws-smithy-async]
   27     27   
path = "../aws-smithy-async"
   28     28   
version = "1.2.7"
   29     29   
   30     30   
[dependencies.aws-smithy-http]
   31     31   
path = "../aws-smithy-http"
   32     32   
version = "0.62.6"
   33     33   
   34     34   
[dependencies.aws-smithy-json]
   35     35   
path = "../aws-smithy-json"
   36     36   
version = "0.61.8"
   37     37   
          38  +
[dependencies.aws-smithy-observability]
          39  +
path = "../aws-smithy-observability"
          40  +
version = "0.1.5"
          41  +
   38     42   
[dependencies.aws-smithy-runtime]
   39     43   
path = "../aws-smithy-runtime"
   40     44   
features = ["client"]
   41     45   
version = "1.9.5"
   42     46   
   43     47   
[dependencies.aws-smithy-runtime-api]
   44     48   
path = "../aws-smithy-runtime-api"
   45     49   
features = ["client", "http-02x"]
   46     50   
version = "1.9.3"
   47     51   
   48     52   
[dependencies.aws-smithy-types]
   49     53   
path = "../aws-smithy-types"
   50     54   
version = "1.3.5"
   51     55   
   52     56   
[dependencies.aws-types]
   53     57   
path = "../aws-types"
   54     58   
version = "1.3.11"
   55     59   
   56     60   
[dependencies.bytes]
   57     61   
version = "1.4.0"
   58     62   
   59     63   
[dependencies.fastrand]
   60     64   
version = "2.0.0"
   61     65   
   62     66   
[dependencies.http]
   63     67   
version = "0.2.9"
   64     68   
   65     69   
[dependencies.regex-lite]
   66     70   
version = "0.1.5"
   67     71   
   68     72   
[dependencies.tracing]
   69     73   
version = "0.1"
   70     74   
[dev-dependencies.approx]
   71     75   
version = "0.5.1"
   72     76   
   73     77   
[dev-dependencies.aws-config]
   74     78   
path = "../aws-config"
   75     79   
version = "1.8.12"
   76     80   
   77     81   
[dev-dependencies.aws-credential-types]
   78     82   
path = "../aws-credential-types"
   79     83   
features = ["test-util"]
   80     84   
version = "1.2.11"
   81     85   
   82     86   
[dev-dependencies.aws-runtime]
   83     87   
path = "../aws-runtime"
   84     88   
features = ["test-util"]
   85         -
version = "1.5.17"
          89  +
version = "1.5.18"
   86     90   
   87     91   
[dev-dependencies.aws-smithy-async]
   88     92   
path = "../aws-smithy-async"
   89     93   
features = ["test-util"]
   90     94   
version = "1.2.7"
   91     95   
   92     96   
[dev-dependencies.aws-smithy-http-client]
   93     97   
path = "../aws-smithy-http-client"
   94     98   
features = ["test-util", "wire-mock"]
   95     99   
version = "1.1.5"

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

@@ -1310,1310 +1369,1370 @@
 1330   1330   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1331   1331   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1332   1332   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
 1333   1333   
        runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
 1334   1334   
        runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
 1335   1335   
        runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
 1336   1336   
        runtime_components.push_interceptor(crate::account_id_endpoint::AccountIdEndpointFeatureTrackerInterceptor);
 1337   1337   
        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1338   1338   
            ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
 1339   1339   
        ));
        1340  +
        runtime_components.push_interceptor(crate::observability_feature::ObservabilityFeatureTrackerInterceptor);
 1340   1341   
        Self { config, runtime_components }
 1341   1342   
    }
 1342   1343   
}
 1343   1344   
 1344   1345   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
 1345   1346   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
 1346   1347   
        self.config.clone()
 1347   1348   
    }
 1348   1349   
 1349   1350   
    fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {

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

@@ -184,184 +234,236 @@
  204    204   
  205    205   
/// Data structures used by operation inputs/outputs.
  206    206   
pub mod types;
  207    207   
  208    208   
mod account_id_endpoint;
  209    209   
  210    210   
pub(crate) mod client_idempotency_token;
  211    211   
  212    212   
mod idempotency_token;
  213    213   
         214  +
mod observability_feature;
         215  +
  214    216   
pub(crate) mod protocol_serde;
  215    217   
  216    218   
mod sdk_feature_tracker;
  217    219   
  218    220   
mod serialization_settings;
  219    221   
  220    222   
mod endpoint_lib;
  221    223   
  222    224   
mod lens;
  223    225   

tmp-codegen-diff/aws-sdk/sdk/dynamodb/src/observability_feature.rs

@@ -0,1 +0,37 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/*
           3  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           4  +
 * SPDX-License-Identifier: Apache-2.0
           5  +
 */
           6  +
           7  +
use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
           8  +
use aws_smithy_runtime_api::{
           9  +
    box_error::BoxError,
          10  +
    client::interceptors::{context::BeforeSerializationInterceptorContextRef, Intercept},
          11  +
};
          12  +
use aws_smithy_types::config_bag::ConfigBag;
          13  +
          14  +
// Interceptor that tracks Smithy SDK features for observability (tracing/metrics).
          15  +
#[derive(Debug, Default)]
          16  +
pub(crate) struct ObservabilityFeatureTrackerInterceptor;
          17  +
          18  +
impl Intercept for ObservabilityFeatureTrackerInterceptor {
          19  +
    fn name(&self) -> &'static str {
          20  +
        "ObservabilityFeatureTrackerInterceptor"
          21  +
    }
          22  +
          23  +
    fn read_before_execution(&self, _context: &BeforeSerializationInterceptorContextRef<'_>, cfg: &mut ConfigBag) -> Result<(), BoxError> {
          24  +
        // Check if an OpenTelemetry meter provider is configured via the global provider
          25  +
        if let Ok(telemetry_provider) = aws_smithy_observability::global::get_telemetry_provider() {
          26  +
            let meter_provider = telemetry_provider.meter_provider();
          27  +
          28  +
            // Check the provider name to detect OpenTelemetry without importing the otel crate
          29  +
            // This avoids compilation issues with the opentelemetry dependency
          30  +
            if meter_provider.provider_name() == "otel" {
          31  +
                cfg.interceptor_state().store_append(SmithySdkFeature::ObservabilityOtelMetrics);
          32  +
            }
          33  +
        }
          34  +
          35  +
        Ok(())
          36  +
    }
          37  +
}

tmp-codegen-diff/aws-sdk/sdk/dynamodb/tests/observability-metrics.rs

@@ -0,1 +0,251 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
           6  +
use aws_config::Region;
           7  +
use aws_credential_types::Credentials;
           8  +
use aws_runtime::user_agent::test_util::assert_ua_contains_metric_values;
           9  +
use aws_sdk_dynamodb::config::Builder;
          10  +
use aws_smithy_observability::TelemetryProvider;
          11  +
use aws_smithy_runtime::client::http::test_util::{ReplayEvent, StaticReplayClient};
          12  +
use aws_smithy_types::body::SdkBody;
          13  +
use std::sync::Arc;
          14  +
          15  +
fn test_client(
          16  +
    update_builder: fn(Builder) -> Builder,
          17  +
) -> (aws_sdk_dynamodb::Client, StaticReplayClient) {
          18  +
    let http_client = StaticReplayClient::new(vec![ReplayEvent::new(
          19  +
        http::Request::builder()
          20  +
            .uri("https://dynamodb.us-east-1.amazonaws.com/")
          21  +
            .body(SdkBody::empty())
          22  +
            .unwrap(),
          23  +
        http::Response::builder()
          24  +
            .status(200)
          25  +
            .body(SdkBody::from(r#"{"TableNames":[]}"#))
          26  +
            .unwrap(),
          27  +
    )]);
          28  +
          29  +
    let config = update_builder(
          30  +
        aws_sdk_dynamodb::Config::builder()
          31  +
            .credentials_provider(Credentials::for_tests())
          32  +
            .region(Region::from_static("us-east-1"))
          33  +
            .http_client(http_client.clone())
          34  +
            .behavior_version_latest(),
          35  +
    )
          36  +
    .build();
          37  +
          38  +
    (aws_sdk_dynamodb::Client::from_conf(config), http_client)
          39  +
}
          40  +
          41  +
async fn call_operation(client: aws_sdk_dynamodb::Client) {
          42  +
    let _ = client.list_tables().send().await;
          43  +
}
          44  +
          45  +
// Mock OTel meter provider for testing
          46  +
// This mimics the real OtelMeterProvider's type name without requiring the broken opentelemetry crate
          47  +
// We create it in a module path that matches what our type checking looks for
          48  +
mod mock_otel {
          49  +
    use aws_smithy_observability::meter::{Meter, ProvideMeter};
          50  +
    use aws_smithy_observability::Attributes;
          51  +
          52  +
    #[derive(Debug)]
          53  +
    pub struct OtelMeterProvider;
          54  +
          55  +
    impl ProvideMeter for OtelMeterProvider {
          56  +
        fn get_meter(&self, _scope: &'static str, _attributes: Option<&Attributes>) -> Meter {
          57  +
            // Return a noop meter - we don't actually need it to work, just to exist
          58  +
            Meter::new(std::sync::Arc::new(NoopInstrumentProvider))
          59  +
        }
          60  +
          61  +
        fn provider_name(&self) -> &'static str {
          62  +
            "otel"
          63  +
        }
          64  +
          65  +
        fn as_any(&self) -> &dyn std::any::Any {
          66  +
            self
          67  +
        }
          68  +
    }
          69  +
          70  +
    #[derive(Debug)]
          71  +
    struct NoopInstrumentProvider;
          72  +
          73  +
    impl aws_smithy_observability::instruments::ProvideInstrument for NoopInstrumentProvider {
          74  +
        fn create_gauge(
          75  +
            &self,
          76  +
            _builder: aws_smithy_observability::instruments::AsyncInstrumentBuilder<
          77  +
                '_,
          78  +
                std::sync::Arc<
          79  +
                    dyn aws_smithy_observability::instruments::AsyncMeasure<Value = f64>,
          80  +
                >,
          81  +
                f64,
          82  +
            >,
          83  +
        ) -> std::sync::Arc<dyn aws_smithy_observability::instruments::AsyncMeasure<Value = f64>>
          84  +
        {
          85  +
            std::sync::Arc::new(NoopAsync::<f64>(std::marker::PhantomData))
          86  +
        }
          87  +
          88  +
        fn create_up_down_counter(
          89  +
            &self,
          90  +
            _builder: aws_smithy_observability::instruments::InstrumentBuilder<
          91  +
                '_,
          92  +
                std::sync::Arc<dyn aws_smithy_observability::instruments::UpDownCounter>,
          93  +
            >,
          94  +
        ) -> std::sync::Arc<dyn aws_smithy_observability::instruments::UpDownCounter> {
          95  +
            std::sync::Arc::new(NoopUpDown)
          96  +
        }
          97  +
          98  +
        fn create_async_up_down_counter(
          99  +
            &self,
         100  +
            _builder: aws_smithy_observability::instruments::AsyncInstrumentBuilder<
         101  +
                '_,
         102  +
                std::sync::Arc<
         103  +
                    dyn aws_smithy_observability::instruments::AsyncMeasure<Value = i64>,
         104  +
                >,
         105  +
                i64,
         106  +
            >,
         107  +
        ) -> std::sync::Arc<dyn aws_smithy_observability::instruments::AsyncMeasure<Value = i64>>
         108  +
        {
         109  +
            std::sync::Arc::new(NoopAsync::<i64>(std::marker::PhantomData))
         110  +
        }
         111  +
         112  +
        fn create_monotonic_counter(
         113  +
            &self,
         114  +
            _builder: aws_smithy_observability::instruments::InstrumentBuilder<
         115  +
                '_,
         116  +
                std::sync::Arc<dyn aws_smithy_observability::instruments::MonotonicCounter>,
         117  +
            >,
         118  +
        ) -> std::sync::Arc<dyn aws_smithy_observability::instruments::MonotonicCounter> {
         119  +
            std::sync::Arc::new(NoopMono)
         120  +
        }
         121  +
         122  +
        fn create_async_monotonic_counter(
         123  +
            &self,
         124  +
            _builder: aws_smithy_observability::instruments::AsyncInstrumentBuilder<
         125  +
                '_,
         126  +
                std::sync::Arc<
         127  +
                    dyn aws_smithy_observability::instruments::AsyncMeasure<Value = u64>,
         128  +
                >,
         129  +
                u64,
         130  +
            >,
         131  +
        ) -> std::sync::Arc<dyn aws_smithy_observability::instruments::AsyncMeasure<Value = u64>>
         132  +
        {
         133  +
            std::sync::Arc::new(NoopAsync::<u64>(std::marker::PhantomData))
         134  +
        }
         135  +
         136  +
        fn create_histogram(
         137  +
            &self,
         138  +
            _builder: aws_smithy_observability::instruments::InstrumentBuilder<
         139  +
                '_,
         140  +
                std::sync::Arc<dyn aws_smithy_observability::instruments::Histogram>,
         141  +
            >,
         142  +
        ) -> std::sync::Arc<dyn aws_smithy_observability::instruments::Histogram> {
         143  +
            std::sync::Arc::new(NoopHist)
         144  +
        }
         145  +
    }
         146  +
         147  +
    #[derive(Debug)]
         148  +
    struct NoopAsync<T>(std::marker::PhantomData<T>);
         149  +
    impl<T: Send + Sync + std::fmt::Debug> aws_smithy_observability::instruments::AsyncMeasure
         150  +
        for NoopAsync<T>
         151  +
    {
         152  +
        type Value = T;
         153  +
        fn record(
         154  +
            &self,
         155  +
            _value: T,
         156  +
            _attributes: Option<&aws_smithy_observability::Attributes>,
         157  +
            _context: Option<&dyn aws_smithy_observability::Context>,
         158  +
        ) {
         159  +
        }
         160  +
        fn stop(&self) {}
         161  +
    }
         162  +
         163  +
    #[derive(Debug)]
         164  +
    struct NoopUpDown;
         165  +
    impl aws_smithy_observability::instruments::UpDownCounter for NoopUpDown {
         166  +
        fn add(
         167  +
            &self,
         168  +
            _value: i64,
         169  +
            _attributes: Option<&aws_smithy_observability::Attributes>,
         170  +
            _context: Option<&dyn aws_smithy_observability::Context>,
         171  +
        ) {
         172  +
        }
         173  +
    }
         174  +
         175  +
    #[derive(Debug)]
         176  +
    struct NoopMono;
         177  +
    impl aws_smithy_observability::instruments::MonotonicCounter for NoopMono {
         178  +
        fn add(
         179  +
            &self,
         180  +
            _value: u64,
         181  +
            _attributes: Option<&aws_smithy_observability::Attributes>,
         182  +
            _context: Option<&dyn aws_smithy_observability::Context>,
         183  +
        ) {
         184  +
        }
         185  +
    }
         186  +
         187  +
    #[derive(Debug)]
         188  +
    struct NoopHist;
         189  +
    impl aws_smithy_observability::instruments::Histogram for NoopHist {
         190  +
        fn record(
         191  +
            &self,
         192  +
            _value: f64,
         193  +
            _attributes: Option<&aws_smithy_observability::Attributes>,
         194  +
            _context: Option<&dyn aws_smithy_observability::Context>,
         195  +
        ) {
         196  +
        }
         197  +
    }
         198  +
}
         199  +
         200  +
#[tokio::test]
         201  +
async fn observability_metrics_in_user_agent() {
         202  +
    // Test case 1: No telemetry provider configured (default noop)
         203  +
    {
         204  +
        let (client, http_client) = test_client(std::convert::identity);
         205  +
        call_operation(client).await;
         206  +
        let req = http_client.actual_requests().last().expect("request");
         207  +
        let user_agent = req
         208  +
            .headers()
         209  +
            .get("x-amz-user-agent")
         210  +
            .expect("user-agent header");
         211  +
         212  +
        // Should NOT contain observability metrics when using noop provider
         213  +
        assert!(!user_agent.contains("m/7")); // OBSERVABILITY_OTEL_METRICS = "7"
         214  +
    }
         215  +
         216  +
    // Test case 2: OpenTelemetry metrics provider configured
         217  +
    {
         218  +
        use mock_otel::OtelMeterProvider;
         219  +
         220  +
        // Create mock OTel meter provider
         221  +
        let sdk_mp = Arc::new(OtelMeterProvider);
         222  +
         223  +
        // Debug: Check what the type name actually is
         224  +
        let type_name = std::any::type_name_of_val(&sdk_mp);
         225  +
        eprintln!("Mock OTel provider Arc type name: {}", type_name);
         226  +
        let type_name2 = std::any::type_name_of_val(sdk_mp.as_ref());
         227  +
        eprintln!("Mock OTel provider as_ref type name: {}", type_name2);
         228  +
         229  +
        let sdk_tp = TelemetryProvider::builder().meter_provider(sdk_mp).build();
         230  +
         231  +
        // Set global telemetry provider
         232  +
        aws_smithy_observability::global::set_telemetry_provider(sdk_tp).unwrap();
         233  +
         234  +
        let (client, http_client) = test_client(std::convert::identity);
         235  +
        call_operation(client).await;
         236  +
        let req = http_client.actual_requests().last().expect("request");
         237  +
        let user_agent = req
         238  +
            .headers()
         239  +
            .get("x-amz-user-agent")
         240  +
            .expect("user-agent header");
         241  +
         242  +
        eprintln!("User-Agent: {}", user_agent);
         243  +
         244  +
        // Should contain OBSERVABILITY_OTEL_METRICS metric
         245  +
        assert_ua_contains_metric_values(user_agent, &["7"]);
         246  +
         247  +
        // Reset to noop for other tests
         248  +
        aws_smithy_observability::global::set_telemetry_provider(TelemetryProvider::noop())
         249  +
            .unwrap();
         250  +
    }
         251  +
}

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

@@ -1,1 +117,121 @@
   14     14   
protocol = "aws.protocols#ec2Query"
   15     15   
[package.metadata.docs.rs]
   16     16   
all-features = true
   17     17   
targets = ["x86_64-unknown-linux-gnu"]
   18     18   
[dependencies.aws-credential-types]
   19     19   
path = "../aws-credential-types"
   20     20   
version = "1.2.11"
   21     21   
   22     22   
[dependencies.aws-runtime]
   23     23   
path = "../aws-runtime"
   24         -
version = "1.5.17"
          24  +
version = "1.5.18"
   25     25   
   26     26   
[dependencies.aws-smithy-async]
   27     27   
path = "../aws-smithy-async"
   28     28   
version = "1.2.7"
   29     29   
   30     30   
[dependencies.aws-smithy-http]
   31     31   
path = "../aws-smithy-http"
   32     32   
version = "0.62.6"
   33     33   
   34     34   
[dependencies.aws-smithy-json]
   35     35   
path = "../aws-smithy-json"
   36     36   
version = "0.61.8"
   37     37   
          38  +
[dependencies.aws-smithy-observability]
          39  +
path = "../aws-smithy-observability"
          40  +
version = "0.1.5"
          41  +
   38     42   
[dependencies.aws-smithy-query]
   39     43   
path = "../aws-smithy-query"
   40     44   
version = "0.60.9"
   41     45   
   42     46   
[dependencies.aws-smithy-runtime]
   43     47   
path = "../aws-smithy-runtime"
   44     48   
features = ["client"]
   45     49   
version = "1.9.5"
   46     50   
   47     51   
[dependencies.aws-smithy-runtime-api]
   48     52   
path = "../aws-smithy-runtime-api"
   49     53   
features = ["client", "http-02x"]
   50     54   
version = "1.9.3"
   51     55   
   52     56   
[dependencies.aws-smithy-types]
   53     57   
path = "../aws-smithy-types"
   54     58   
version = "1.3.5"
   55     59   
   56     60   
[dependencies.aws-smithy-xml]
   57     61   
path = "../aws-smithy-xml"
   58     62   
version = "0.60.13"
   59     63   
   60     64   
[dependencies.aws-types]
   61     65   
path = "../aws-types"
   62     66   
version = "1.3.11"
   63     67   
   64     68   
[dependencies.fastrand]
   65     69   
version = "2.0.0"
   66     70   
   67     71   
[dependencies.http]
   68     72   
version = "0.2.9"
   69     73   
   70     74   
[dependencies.regex-lite]
   71     75   
version = "0.1.5"
   72     76   
   73     77   
[dependencies.tracing]
   74     78   
version = "0.1"
   75     79   
[dev-dependencies.aws-config]
   76     80   
path = "../aws-config"
   77     81   
version = "1.8.12"
   78     82   
   79     83   
[dev-dependencies.aws-credential-types]
   80     84   
path = "../aws-credential-types"
   81     85   
features = ["test-util"]
   82     86   
version = "1.2.11"
   83     87   
   84     88   
[dev-dependencies.aws-runtime]
   85     89   
path = "../aws-runtime"
   86     90   
features = ["test-util"]
   87         -
version = "1.5.17"
          91  +
version = "1.5.18"
   88     92   
   89     93   
[dev-dependencies.aws-smithy-async]
   90     94   
path = "../aws-smithy-async"
   91     95   
features = ["test-util"]
   92     96   
version = "1.2.7"
   93     97   
   94     98   
[dev-dependencies.aws-smithy-http-client]
   95     99   
path = "../aws-smithy-http-client"
   96    100   
features = ["test-util", "wire-mock"]
   97    101   
version = "1.1.5"

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

@@ -1295,1295 +1354,1355 @@
 1315   1315   
        runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default());
 1316   1316   
        runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new());
 1317   1317   
        runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new());
 1318   1318   
        runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new());
 1319   1319   
        runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new());
 1320   1320   
        runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new());
 1321   1321   
        runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new());
 1322   1322   
        runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(
 1323   1323   
            ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(),
 1324   1324   
        ));
        1325  +
        runtime_components.push_interceptor(crate::observability_feature::ObservabilityFeatureTrackerInterceptor);
 1325   1326   
        Self { config, runtime_components }
 1326   1327   
    }
 1327   1328   
}
 1328   1329   
 1329   1330   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin {
 1330   1331   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
 1331   1332   
        self.config.clone()
 1332   1333   
    }
 1333   1334   
 1334   1335   
    fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order {

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

@@ -178,178 +228,230 @@
  198    198   
/// Primitives such as `Blob` or `DateTime` used by other types.
  199    199   
pub mod primitives;
  200    200   
  201    201   
/// Data structures used by operation inputs/outputs.
  202    202   
pub mod types;
  203    203   
  204    204   
pub(crate) mod client_idempotency_token;
  205    205   
  206    206   
mod idempotency_token;
  207    207   
         208  +
mod observability_feature;
         209  +
  208    210   
pub(crate) mod protocol_serde;
  209    211   
  210    212   
mod sdk_feature_tracker;
  211    213   
  212    214   
mod serialization_settings;
  213    215   
  214    216   
mod endpoint_lib;
  215    217   
  216    218   
mod lens;
  217    219   

tmp-codegen-diff/aws-sdk/sdk/ec2/src/observability_feature.rs

@@ -0,1 +0,37 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/*
           3  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           4  +
 * SPDX-License-Identifier: Apache-2.0
           5  +
 */
           6  +
           7  +
use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature;
           8  +
use aws_smithy_runtime_api::{
           9  +
    box_error::BoxError,
          10  +
    client::interceptors::{context::BeforeSerializationInterceptorContextRef, Intercept},
          11  +
};
          12  +
use aws_smithy_types::config_bag::ConfigBag;
          13  +
          14  +
// Interceptor that tracks Smithy SDK features for observability (tracing/metrics).
          15  +
#[derive(Debug, Default)]
          16  +
pub(crate) struct ObservabilityFeatureTrackerInterceptor;
          17  +
          18  +
impl Intercept for ObservabilityFeatureTrackerInterceptor {
          19  +
    fn name(&self) -> &'static str {
          20  +
        "ObservabilityFeatureTrackerInterceptor"
          21  +
    }
          22  +
          23  +
    fn read_before_execution(&self, _context: &BeforeSerializationInterceptorContextRef<'_>, cfg: &mut ConfigBag) -> Result<(), BoxError> {
          24  +
        // Check if an OpenTelemetry meter provider is configured via the global provider
          25  +
        if let Ok(telemetry_provider) = aws_smithy_observability::global::get_telemetry_provider() {
          26  +
            let meter_provider = telemetry_provider.meter_provider();
          27  +
          28  +
            // Check the provider name to detect OpenTelemetry without importing the otel crate
          29  +
            // This avoids compilation issues with the opentelemetry dependency
          30  +
            if meter_provider.provider_name() == "otel" {
          31  +
                cfg.interceptor_state().store_append(SmithySdkFeature::ObservabilityOtelMetrics);
          32  +
            }
          33  +
        }
          34  +
          35  +
        Ok(())
          36  +
    }
          37  +
}

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

@@ -1,1 +67,71 @@
   14     14   
protocol = "aws.protocols#awsJson1_1"
   15     15   
[package.metadata.docs.rs]
   16     16   
all-features = true
   17     17   
targets = ["x86_64-unknown-linux-gnu"]
   18     18   
[dependencies.aws-credential-types]
   19     19   
path = "../aws-credential-types"
   20     20   
version = "1.2.11"
   21     21   
   22     22   
[dependencies.aws-runtime]
   23     23   
path = "../aws-runtime"
   24         -
version = "1.5.17"
          24  +
version = "1.5.18"
   25     25   
   26     26   
[dependencies.aws-smithy-async]
   27     27   
path = "../aws-smithy-async"
   28     28   
version = "1.2.7"
   29     29   
   30     30   
[dependencies.aws-smithy-http]
   31     31   
path = "../aws-smithy-http"
   32     32   
version = "0.62.6"
   33     33   
   34     34   
[dependencies.aws-smithy-json]
   35     35   
path = "../aws-smithy-json"
   36     36   
version = "0.61.8"
   37     37   
          38  +
[dependencies.aws-smithy-observability]
          39  +
path = "../aws-smithy-observability"
          40  +
version = "0.1.5"
          41  +
   38     42   
[dependencies.aws-smithy-runtime]
   39     43   
path = "../aws-smithy-runtime"
   40     44   
features = ["client"]
   41     45   
version = "1.9.5"
   42     46   
   43     47   
[dependencies.aws-smithy-runtime-api]
   44     48   
path = "../aws-smithy-runtime-api"
   45     49   
features = ["client", "http-02x"]
   46     50   
version = "1.9.3"
   47     51