@@ -690,8 +690,8 @@ mod tests {
690690 "There should be single metric merging duplicate instruments"
691691 ) ;
692692 let metric = & resource_metrics[ 0 ] . scope_metrics [ 0 ] . metrics [ 0 ] ;
693- assert_eq ! ( metric. name, "my_counter" ) ;
694- assert_eq ! ( metric. unit, "my_unit" ) ;
693+ assert_eq ! ( metric. instrument . name, "my_counter" ) ;
694+ assert_eq ! ( metric. instrument . unit, "my_unit" ) ;
695695 let MetricData :: Sum ( sum) = u64:: extract_metrics_data_ref ( & metric. data )
696696 . expect ( "Sum aggregation expected for Counter instruments by default" )
697697 else {
@@ -756,9 +756,9 @@ mod tests {
756756
757757 if let Some ( scope1) = scope1 {
758758 let metric1 = & scope1. metrics [ 0 ] ;
759- assert_eq ! ( metric1. name, "my_counter" ) ;
760- assert_eq ! ( metric1. unit, "my_unit" ) ;
761- assert_eq ! ( metric1. description, "my_description" ) ;
759+ assert_eq ! ( metric1. instrument . name, "my_counter" ) ;
760+ assert_eq ! ( metric1. instrument . unit, "my_unit" ) ;
761+ assert_eq ! ( metric1. instrument . description, "my_description" ) ;
762762 let MetricData :: Sum ( sum1) = u64:: extract_metrics_data_ref ( & metric1. data )
763763 . expect ( "Sum aggregation expected for Counter instruments by default" )
764764 else {
@@ -776,9 +776,9 @@ mod tests {
776776
777777 if let Some ( scope2) = scope2 {
778778 let metric2 = & scope2. metrics [ 0 ] ;
779- assert_eq ! ( metric2. name, "my_counter" ) ;
780- assert_eq ! ( metric2. unit, "my_unit" ) ;
781- assert_eq ! ( metric2. description, "my_description" ) ;
779+ assert_eq ! ( metric2. instrument . name, "my_counter" ) ;
780+ assert_eq ! ( metric2. instrument . unit, "my_unit" ) ;
781+ assert_eq ! ( metric2. instrument . description, "my_description" ) ;
782782
783783 let MetricData :: Sum ( sum2) = u64:: extract_metrics_data_ref ( & metric2. data )
784784 . expect ( "Sum aggregation expected for Counter instruments by default" )
@@ -862,9 +862,9 @@ mod tests {
862862 assert ! ( scope. attributes( ) . eq( & [ KeyValue :: new( "key" , "value1" ) ] ) ) ;
863863
864864 let metric = & resource_metrics[ 0 ] . scope_metrics [ 0 ] . metrics [ 0 ] ;
865- assert_eq ! ( metric. name, "my_counter" ) ;
866- assert_eq ! ( metric. unit, "my_unit" ) ;
867- assert_eq ! ( metric. description, "my_description" ) ;
865+ assert_eq ! ( metric. instrument . name, "my_counter" ) ;
866+ assert_eq ! ( metric. instrument . unit, "my_unit" ) ;
867+ assert_eq ! ( metric. instrument . description, "my_description" ) ;
868868
869869 let MetricData :: Sum ( sum) = u64:: extract_metrics_data_ref ( & metric. data )
870870 . expect ( "Sum aggregation expected for Counter instruments by default" )
@@ -919,11 +919,11 @@ mod tests {
919919 assert ! ( !resource_metrics. is_empty( ) ) ;
920920 let metric = & resource_metrics[ 0 ] . scope_metrics [ 0 ] . metrics [ 0 ] ;
921921 assert_eq ! (
922- metric. name, "test_histogram" ,
922+ metric. instrument . name, "test_histogram" ,
923923 "View rename should be ignored and original name retained."
924924 ) ;
925925 assert_eq ! (
926- metric. unit, "test_unit" ,
926+ metric. instrument . unit, "test_unit" ,
927927 "View rename of unit should be ignored and original unit retained."
928928 ) ;
929929 }
@@ -985,7 +985,7 @@ mod tests {
985985 . expect ( "metrics are expected to be exported." ) ;
986986 assert ! ( !resource_metrics. is_empty( ) ) ;
987987 let metric = & resource_metrics[ 0 ] . scope_metrics [ 0 ] . metrics [ 0 ] ;
988- assert_eq ! ( metric. name, "my_observable_counter" , ) ;
988+ assert_eq ! ( metric. instrument . name, "my_observable_counter" , ) ;
989989
990990 let MetricData :: Sum ( sum) = u64:: extract_metrics_data_ref ( & metric. data )
991991 . expect ( "Sum aggregation expected for ObservableCounter instruments by default" )
@@ -1061,7 +1061,7 @@ mod tests {
10611061 . expect ( "metrics are expected to be exported." ) ;
10621062 assert ! ( !resource_metrics. is_empty( ) ) ;
10631063 let metric = & resource_metrics[ 0 ] . scope_metrics [ 0 ] . metrics [ 0 ] ;
1064- assert_eq ! ( metric. name, "my_counter" , ) ;
1064+ assert_eq ! ( metric. instrument . name, "my_counter" , ) ;
10651065
10661066 let MetricData :: Sum ( sum) = u64:: extract_metrics_data_ref ( & metric. data )
10671067 . expect ( "Sum aggregation expected for Counter instruments by default" )
@@ -3029,9 +3029,9 @@ mod tests {
30293029 assert ! ( !resource_metric. scope_metrics[ 0 ] . metrics. is_empty( ) ) ;
30303030
30313031 let metric = & resource_metric. scope_metrics [ 0 ] . metrics [ 0 ] ;
3032- assert_eq ! ( metric. name, counter_name) ;
3032+ assert_eq ! ( metric. instrument . name, counter_name) ;
30333033 if let Some ( expected_unit) = unit_name {
3034- assert_eq ! ( metric. unit, expected_unit) ;
3034+ assert_eq ! ( metric. instrument . unit, expected_unit) ;
30353035 }
30363036
30373037 T :: extract_metrics_data_ref ( & metric. data )
@@ -3073,10 +3073,10 @@ mod tests {
30733073 assert ! ( !resource_metric. scope_metrics[ 0 ] . metrics. is_empty( ) ) ;
30743074
30753075 let metric = & resource_metric. scope_metrics [ 0 ] . metrics [ 0 ] ;
3076- assert_eq ! ( metric. name, counter_name) ;
3076+ assert_eq ! ( metric. instrument . name, counter_name) ;
30773077
30783078 if let Some ( expected_unit) = unit_name {
3079- assert_eq ! ( metric. unit, expected_unit) ;
3079+ assert_eq ! ( metric. instrument . unit, expected_unit) ;
30803080 }
30813081
30823082 let aggregation = T :: extract_metrics_data_ref ( & metric. data )
0 commit comments