File tree Expand file tree Collapse file tree 7 files changed +9
-15
lines changed
aws-smithy-observability-otel/src
aws-smithy-observability/src
aws-smithy-runtime/src/client Expand file tree Collapse file tree 7 files changed +9
-15
lines changed Original file line number Diff line number Diff line change 33 * SPDX-License-Identifier: Apache-2.0
44 */
55
6- use aws_runtime :: sdk_feature:: AwsSdkFeature ;
6+ use aws_smithy_runtime :: client :: sdk_feature:: SmithySdkFeature ;
77use aws_smithy_runtime_api:: {
88 box_error:: BoxError ,
99 client:: interceptors:: { context:: BeforeSerializationInterceptorContextRef , Intercept } ,
1010} ;
1111use aws_smithy_types:: config_bag:: ConfigBag ;
1212
13- // Interceptor that tracks AWS SDK features for observability (tracing/metrics).
13+ // Interceptor that tracks Smithy SDK features for observability (tracing/metrics).
1414#[ derive( Debug , Default ) ]
1515pub ( crate ) struct ObservabilityFeatureTrackerInterceptor ;
1616
@@ -35,7 +35,7 @@ impl Intercept for ObservabilityFeatureTrackerInterceptor {
3535 . downcast_ref :: < aws_smithy_observability_otel:: meter:: OtelMeterProvider > (
3636 ) {
3737 cfg. interceptor_state ( )
38- . store_append ( AwsSdkFeature :: ObservabilityOtelMetrics ) ;
38+ . store_append ( SmithySdkFeature :: ObservabilityOtelMetrics ) ;
3939 }
4040 }
4141
Original file line number Diff line number Diff line change @@ -24,8 +24,6 @@ pub enum AwsSdkFeature {
2424 SsoLoginDevice ,
2525 /// Calling an SSO-OIDC operation as part of the SSO login flow, when using the OAuth2.0 authorization code grant
2626 SsoLoginAuth ,
27- /// Indicates that an AWS SDK client has been configured with an OpenTelemetry metrics provider
28- ObservabilityOtelMetrics ,
2927}
3028
3129impl Storable for AwsSdkFeature {
Original file line number Diff line number Diff line change @@ -210,6 +210,7 @@ impl ProvideBusinessMetric for SmithySdkFeature {
210210 FlexibleChecksumsResWhenRequired => {
211211 Some ( BusinessMetric :: FlexibleChecksumsResWhenRequired )
212212 }
213+ ObservabilityOtelMetrics => Some ( BusinessMetric :: ObservabilityOtelMetrics ) ,
213214 otherwise => {
214215 // This may occur if a customer upgrades only the `aws-smithy-runtime-api` crate
215216 // while continuing to use an outdated version of an SDK crate or the `aws-runtime`
@@ -234,7 +235,6 @@ impl ProvideBusinessMetric for AwsSdkFeature {
234235 S3Transfer => Some ( BusinessMetric :: S3Transfer ) ,
235236 SsoLoginDevice => Some ( BusinessMetric :: SsoLoginDevice ) ,
236237 SsoLoginAuth => Some ( BusinessMetric :: SsoLoginAuth ) ,
237- ObservabilityOtelMetrics => Some ( BusinessMetric :: ObservabilityOtelMetrics ) ,
238238 }
239239 }
240240}
Original file line number Diff line number Diff line change @@ -286,10 +286,6 @@ impl ProvideMeter for OtelMeterProvider {
286286 fn get_meter ( & self , scope : & ' static str , _attributes : Option < & Attributes > ) -> Meter {
287287 Meter :: new ( Arc :: new ( MeterWrap ( self . meter_provider . meter ( scope) ) ) )
288288 }
289-
290- fn as_any ( & self ) -> & dyn std:: any:: Any {
291- self
292- }
293289}
294290
295291#[ cfg( test) ]
Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ pub trait ProvideMeter: Send + Sync + Debug {
1919 fn get_meter ( & self , scope : & ' static str , attributes : Option < & Attributes > ) -> Meter ;
2020
2121 /// Returns a reference to `self` as `&dyn Any` for downcasting.
22- fn as_any ( & self ) -> & dyn std:: any:: Any ;
22+ fn as_any ( & self ) -> & dyn std:: any:: Any {
23+ self
24+ }
2325}
2426
2527/// The entry point to creating instruments. A grouping of related metrics.
Original file line number Diff line number Diff line change @@ -24,10 +24,6 @@ impl ProvideMeter for NoopMeterProvider {
2424 fn get_meter ( & self , _scope : & ' static str , _attributes : Option < & Attributes > ) -> Meter {
2525 Meter :: new ( Arc :: new ( NoopMeter ) )
2626 }
27-
28- fn as_any ( & self ) -> & dyn std:: any:: Any {
29- self
30- }
3127}
3228
3329#[ derive( Debug ) ]
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ pub enum SmithySdkFeature {
2323 FlexibleChecksumsReqWhenRequired ,
2424 FlexibleChecksumsResWhenSupported ,
2525 FlexibleChecksumsResWhenRequired ,
26+ /// Indicates that a Smithy SDK client has been configured with an OpenTelemetry metrics provider
27+ ObservabilityOtelMetrics ,
2628}
2729
2830impl Storable for SmithySdkFeature {
You can’t perform that action at this time.
0 commit comments